4#include <rapidjson/fwd.h>
24 static std::optional<double>
35 const rapidjson::Value& tileJson,
36 const std::string& key);
53 const rapidjson::Value& json,
55 const std::string& key);
67 const rapidjson::Value& json,
68 const std::string& key,
69 const std::string& defaultValue);
79 const rapidjson::Value& json,
80 const std::string& defaultValue);
92 const rapidjson::Value& json,
93 const std::string& key,
116 const rapidjson::Value& json,
117 const std::string& key,
118 uint32_t defaultValue);
140 const rapidjson::Value& json,
141 const std::string& key,
142 int32_t defaultValue);
164 const rapidjson::Value& json,
165 const std::string& key,
166 uint64_t defaultValue);
188 const rapidjson::Value& json,
189 const std::string& key,
190 int64_t defaultValue);
212 const rapidjson::Value& json,
213 const std::string& key,
232 static std::vector<std::string>
233 getStrings(
const rapidjson::Value& json,
const std::string& key);
242 static std::vector<int64_t>
243 getInt64s(
const rapidjson::Value& json,
const std::string& key);
A collection of helper functions to make reading JSON simpler.
static int32_t getInt32OrDefault(const rapidjson::Value &json, const std::string &key, int32_t defaultValue)
Attempts to obtain a int32_t from the given key on the JSON object, returning a default value if this...
static std::string getStringOrDefault(const rapidjson::Value &json, const std::string &key, const std::string &defaultValue)
Attempts to obtain a string from the given key on the JSON object, returning a default value if this ...
static std::optional< double > getScalarProperty(const rapidjson::Value &tileJson, const std::string &key)
Attempts to read the value at key of tileJson as a double, returning std::nullopt if it wasn't found ...
static bool getBoolOrDefault(const rapidjson::Value &json, bool defaultValue)
Attempts to read json as a bool, returning a default value if this isn't possible.
static uint32_t getUint32OrDefault(const rapidjson::Value &json, uint32_t defaultValue)
Attempts to read json as a uint32_t, returning a default value if this isn't possible.
static std::optional< glm::dmat4x4 > getTransformProperty(const rapidjson::Value &tileJson, const std::string &key)
Attempts to read the value at key of tileJson as a glm::dmat4x4, returning std::nullopt if it wasn't ...
static std::string getStringOrDefault(const rapidjson::Value &json, const std::string &defaultValue)
Attempts to read json as a string, returning a default value if this isn't possible.
static int32_t getInt32OrDefault(const rapidjson::Value &json, int32_t defaultValue)
Attempts to read json as a int32_t, returning a default value if this isn't possible.
static uint32_t getUint32OrDefault(const rapidjson::Value &json, const std::string &key, uint32_t defaultValue)
Attempts to obtain a uint32_t from the given key on the JSON object, returning a default value if thi...
static int64_t getInt64OrDefault(const rapidjson::Value &json, const std::string &key, int64_t defaultValue)
Attempts to obtain a int64_t from the given key on the JSON object, returning a default value if this...
static std::vector< int64_t > getInt64s(const rapidjson::Value &json, const std::string &key)
Attempts to read an int64_t array from the property key of json, returning an empty vector if this is...
static bool getBoolOrDefault(const rapidjson::Value &json, const std::string &key, bool defaultValue)
Attempts to obtain a bool from the given key on the JSON object, returning a default value if this is...
static int64_t getInt64OrDefault(const rapidjson::Value &json, int64_t defaultValue)
Attempts to read json as a int64_t, returning a default value if this isn't possible.
static double getDoubleOrDefault(const rapidjson::Value &json, double defaultValue)
Attempts to read json as a double, returning a default value if this isn't possible.
static std::optional< std::vector< double > > getDoubles(const rapidjson::Value &json, int32_t expectedSize, const std::string &key)
Obtains an array of numbers from the given JSON.
static std::vector< std::string > getStrings(const rapidjson::Value &json, const std::string &key)
Attempts to read an array of strings from the property key of json, returning an empty vector if this...
static uint64_t getUint64OrDefault(const rapidjson::Value &json, const std::string &key, uint64_t defaultValue)
Attempts to obtain a uint64_t from the given key on the JSON object, returning a default value if thi...
static uint64_t getUint64OrDefault(const rapidjson::Value &json, uint64_t defaultValue)
Attempts to read json as a uint64_t, returning a default value if this isn't possible.
static double getDoubleOrDefault(const rapidjson::Value &json, const std::string &key, double defaultValue)
Attempts to obtain a double from the given key on the JSON object, returning a default value if this ...
Utility classes for Cesium.