Safeheron-SGX-Native-Development-Framework v1.2.0
Loading...
Searching...
No Matches
ssgx::json_t Namespace Reference

This module is a lightweight wrapper for nlohmann::json, designed for extracting values from a JSON object. More...

Functions

bool fetch_json_string_node (const nlohmann::json &root, const std::string &node_name, std::string &value, std::string &err_msg)
 Extract a string from a JSON object.
 
bool fetch_json_int_node (const nlohmann::json &root, const std::string &node_name, int &value, std::string &err_msg)
 Extract an integer from a JSON object.
 
bool fetch_json_bool_node (const nlohmann::json &root, const std::string &node_name, bool &value, std::string &err_msg)
 Extract a boolean value from a JSON object.
 
bool fetch_json_long_node (const nlohmann::json &root, const std::string &node_name, long &value, std::string &err_msg)
 Extract a long integer from a JSON object.
 
bool fetch_json_array_node (const nlohmann::json &root, const std::string &node_name, nlohmann::json &value, std::string &err_msg)
 Extract a json array from a JSON object.
 
bool fetch_json_object_node (const nlohmann::json &root, const std::string &node_name, nlohmann::json &value, std::string &err_msg)
 Extract a json object from a JSON object.
 

Detailed Description

This module is a lightweight wrapper for nlohmann::json, designed for extracting values from a JSON object.

Function Documentation

◆ fetch_json_array_node()

bool ssgx::json_t::fetch_json_array_node ( const nlohmann::json & root,
const std::string & node_name,
nlohmann::json & value,
std::string & err_msg )

Extract a json array from a JSON object.

Parameters
[in]rootjson object
[in]node_namekey in a JSON object
[out]valuevalue in a JSON object
[out]err_msgerror message
Returns
Return true if successful; otherwise, return false

◆ fetch_json_bool_node()

bool ssgx::json_t::fetch_json_bool_node ( const nlohmann::json & root,
const std::string & node_name,
bool & value,
std::string & err_msg )

Extract a boolean value from a JSON object.

Parameters
[in]root
[in]node_name
[out]value
[out]err_msg
Returns
Return true if successful; otherwise, return false

◆ fetch_json_int_node()

bool ssgx::json_t::fetch_json_int_node ( const nlohmann::json & root,
const std::string & node_name,
int & value,
std::string & err_msg )

Extract an integer from a JSON object.

Parameters
[in]rootjson object
[in]node_namekey in a JSON object
[out]valuevalue in a JSON object
[out]err_msgerror message
Returns
Return true if successful; otherwise, return false

◆ fetch_json_long_node()

bool ssgx::json_t::fetch_json_long_node ( const nlohmann::json & root,
const std::string & node_name,
long & value,
std::string & err_msg )

Extract a long integer from a JSON object.

Parameters
[in]rootjson object
[in]node_namekey in a JSON object
[out]valuevalue in a JSON object
[out]err_msgerror message
Returns
Return true if successful; otherwise, return false

◆ fetch_json_object_node()

bool ssgx::json_t::fetch_json_object_node ( const nlohmann::json & root,
const std::string & node_name,
nlohmann::json & value,
std::string & err_msg )

Extract a json object from a JSON object.

Parameters
[in]rootjson object
[in]node_namekey in a JSON object
[out]valuevalue in a JSON object
[out]err_msgerror message
Returns
Return true if successful; otherwise, return false

◆ fetch_json_string_node()

bool ssgx::json_t::fetch_json_string_node ( const nlohmann::json & root,
const std::string & node_name,
std::string & value,
std::string & err_msg )

Extract a string from a JSON object.

Parameters
[in]rootjson object
[in]node_namekey in a JSON object
[out]valuevalue in a JSON object
[out]err_msgerror message
Returns
Return true if successful; otherwise, return false