bes Updated for version 3.20.13
|
Public Member Functions | |
void | getJsonDoc (const std::string &url, rapidjson::Document &d) |
std::string | getStringValue (const rapidjson::Value &object, const std::string &name) |
std::string | jsonDocToString (rapidjson::Document &d) |
Definition at line 42 of file rjson_utils.h.
void cmr::rjson_utils::getJsonDoc | ( | const std::string & | url, |
rapidjson::Document & | doc | ||
) |
Utilizes the RemoteHttpResource machinery to retrieve the document referenced by the parameter 'url'. Once retrieved the document is fed to the RapidJSON parser to populate the parameter 'd'
url | The URL of the JSON document to parse. |
doc | The document that will hopd the parsed result. |
Definition at line 57 of file rjson_utils.cc.
std::string cmr::rjson_utils::getStringValue | ( | const rapidjson::Value & | object, |
const std::string & | name | ||
) |
Gets the child of 'object' named 'name' and returns it's value as a string. If the 'name' is not a member of 'object', or if IsString() for the named child returns false, then the empty string is returned.
object | the object to serach. |
name | The name of the child object to convert to a string |
Definition at line 85 of file rjson_utils.cc.
std::string cmr::rjson_utils::jsonDocToString | ( | rapidjson::Document & | d | ) |
Converts a RapidJson Document object into a "pretty" string.
d | A reference to the document to convert. |
Definition at line 111 of file rjson_utils.cc.