5using Json = nlohmann::json;
11 inline T
getValue(
const ga::Json& json,
const std::string& keyOrPointer,
const T& defaultValue )
15 if ( keyOrPointer.empty() || keyOrPointer.at( 0 ) ==
'/' ) {
17 ret = json.at(ga::Json::json_pointer( keyOrPointer )).get<T>();
20 ret = json.at(keyOrPointer).get<T>();
28 inline std::string
getValue(
const ga::Json& json,
const std::string& keyOrPointer,
const char* defaultValue )
30 return getValue( json, keyOrPointer, std::string( defaultValue ) );
T getValue(const ga::Json &json, const std::string &keyOrPointer, const T &defaultValue)
Definition: json.h:11
nlohmann::json Json
Definition: json.h:5