diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-06-22 16:28:21 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-06-24 09:39:51 -0700 |
commit | 16c435b1517b15a5ea8654987979ef58800b838b (patch) | |
tree | 8f81c4e202e1337d0966a06f27842d45a113fded /include/mbgl/style/conversion.hpp | |
parent | c4e4cc5081965d03132eea754c27ece3c95961cb (diff) | |
download | qtlocation-mapboxgl-16c435b1517b15a5ea8654987979ef58800b838b.tar.gz |
[core, node] Implement bindings for addLayer
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 |