bes Updated for version 3.20.13
cmr::rjson_utils Class Reference
Collaboration diagram for cmr::rjson_utils:
Collaboration graph

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)
 

Detailed Description

Definition at line 42 of file rjson_utils.h.

Member Function Documentation

◆ getJsonDoc()

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'

Parameters
urlThe URL of the JSON document to parse.
docThe document that will hopd the parsed result.

Definition at line 57 of file rjson_utils.cc.

◆ getStringValue()

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.

Parameters
objectthe object to serach.
nameThe name of the child object to convert to a string
Returns
The value of the named chalid as a string;

Definition at line 85 of file rjson_utils.cc.

◆ jsonDocToString()

std::string cmr::rjson_utils::jsonDocToString ( rapidjson::Document &  d)

Converts a RapidJson Document object into a "pretty" string.

Parameters
dA reference to the document to convert.
Returns
The string manifestation of the JSON document.

Definition at line 111 of file rjson_utils.cc.


The documentation for this class was generated from the following files: