25 #ifndef INCLUDED_JSONHelpers_h_GUID_6DB9F077_A09D_44AB_C180_AABFE369637B 26 #define INCLUDED_JSONHelpers_h_GUID_6DB9F077_A09D_44AB_C180_AABFE369637B 32 #include <json/value.h> 33 #include <json/reader.h> 34 #include <json/writer.h> 42 inline Json::Value
jsonParse(std::string
const &str) {
44 Json::Value val = Json::nullValue;
45 if (!reader.parse(str, val)) {
47 val = Json::nullValue;
54 Json::FastWriter writer;
55 return writer.write(val);
61 return val.toStyledString();
67 #endif // INCLUDED_JSONHelpers_h_GUID_6DB9F077_A09D_44AB_C180_AABFE369637B Handles spatial transformations.
Definition: SerializationTraitExample_Complicated.h:40
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
std::string jsonToStyledString(Json::Value const &val)
Turns the JSON value into a pretty-printed, human-targeted string representation. ...
Definition: JSONHelpers.h:60
std::string jsonToCompactString(Json::Value const &val)
Turns the JSON value into a compact string representation.
Definition: JSONHelpers.h:53
Json::Value jsonParse(std::string const &str)
Parses a string as JSON, returning a null value if parsing fails.
Definition: JSONHelpers.h:42