|
nlohmann::json | get_as_json (const std::string &url) const |
|
std::string | get_str_if_present (const std::string &key, const nlohmann::json &json_obj) const |
|
std::string | probe_json (const nlohmann::json &j) const |
|
bool | qc_boolean (const std::string &key, const nlohmann::json &json_obj) const |
|
double | qc_double (const std::string &key, const nlohmann::json &json_obj) const |
|
const nlohmann::json & | qc_get_array (const std::string &key, const nlohmann::json &json_obj) const |
|
const nlohmann::json & | qc_get_object (const std::string &key, const nlohmann::json &json_obj) const |
|
unsigned long int | qc_integer (const std::string &key, const nlohmann::json &json_obj) const |
|
Definition at line 42 of file JsonUtils.h.
◆ get_as_json()
json cmr::JsonUtils::get_as_json |
( |
const std::string & | url | ) |
const |
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
-
url | The URL of the JSON document to parse. |
- Returns
- The json document parsed from the source URL response..
Definition at line 58 of file JsonUtils.cc.
◆ get_str_if_present()
std::string cmr::JsonUtils::get_str_if_present |
( |
const std::string & | key, |
|
|
const nlohmann::json & | json_obj ) const |
◆ probe_json()
std::string cmr::JsonUtils::probe_json |
( |
const nlohmann::json & | j | ) |
const |
◆ qc_boolean()
bool cmr::JsonUtils::qc_boolean |
( |
const std::string & | key, |
|
|
const nlohmann::json & | json_obj ) const |
Tries to get the value of the json object named "key" as a bool.
- Parameters
-
- Returns
Definition at line 136 of file JsonUtils.cc.
◆ qc_double()
double cmr::JsonUtils::qc_double |
( |
const std::string & | key, |
|
|
const nlohmann::json & | json_obj ) const |
Tries to get the value of the json object named "key" as a double.
- Parameters
-
- Returns
Definition at line 86 of file JsonUtils.cc.
◆ qc_get_array()
const nlohmann::json & cmr::JsonUtils::qc_get_array |
( |
const std::string & | key, |
|
|
const nlohmann::json & | json_obj ) const |
◆ qc_get_object()
const nlohmann::json & cmr::JsonUtils::qc_get_object |
( |
const std::string & | key, |
|
|
const nlohmann::json & | json_obj ) const |
◆ qc_integer()
unsigned long int cmr::JsonUtils::qc_integer |
( |
const std::string & | key, |
|
|
const nlohmann::json & | json_obj ) const |
Tries to get the value of the json object named "key" as an unsigned long.
- Parameters
-
- Returns
Definition at line 187 of file JsonUtils.cc.
◆ typeName()
std::string cmr::JsonUtils::typeName |
( |
unsigned int | t | ) |
|
|
static |
A wee helper method to convert type numbers to type strings
- Parameters
-
- Returns
Definition at line 73 of file JsonUtils.cc.
The documentation for this class was generated from the following files: