From 16c435b1517b15a5ea8654987979ef58800b838b Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 22 Jun 2016 16:28:21 -0700 Subject: [core, node] Implement bindings for addLayer --- include/mbgl/style/conversion.hpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/mbgl/style/conversion.hpp') 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 {...})` -- 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`, absence indicating `v` is not a JSON boolean * `toNumber(v)` -- returns `optional`, absence indicating `v` is not a JSON number -- cgit v1.2.1