diff options
Diffstat (limited to 'include/mbgl/style/conversion.hpp')
-rw-r--r-- | include/mbgl/style/conversion.hpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/mbgl/style/conversion.hpp b/include/mbgl/style/conversion.hpp index eff7e293a3..2cb3ced376 100644 --- a/include/mbgl/style/conversion.hpp +++ b/include/mbgl/style/conversion.hpp @@ -28,6 +28,8 @@ namespace conversion { The implementation of `convert` requires that the following are legal expressions for a value `v` of type `const V&`: + * `isUndefined(v)` -- returns a boolean indication whether `v` is undefined or a JSON null + * `isArray(v)` -- returns a boolean indicating whether `v` represents a JSON array * `arrayLength(v)` -- called only if `isArray(v)`; returns a size_t length * `arrayMember(v)` -- called only if `isArray(v)`; returns `V` or `V&` @@ -36,6 +38,9 @@ namespace conversion { * `objectMember(v, name)` -- called only if `isObject(v)`; `name` is `const char *`; return value: * is true when evaluated in a boolean context iff the named member exists * is convertable to a `V` or `V&` when dereferenced + * `eachMember(v, [] (const std::string&, const V&) -> optional<Error> {...})` -- called + only if `isObject(v)`; calls the provided lambda once for each key and value of the object; + short-circuits if any call returns an `Error` * `toBool(v)` -- returns `optional<bool>`, absence indicating `v` is not a JSON boolean * `toNumber(v)` -- returns `optional<float>`, absence indicating `v` is not a JSON number |