Electroneum
json_object.h File Reference
Include dependency graph for json_object.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  cryptonote::json::JSON_ERROR
 
struct  cryptonote::json::MISSING_KEY
 
struct  cryptonote::json::WRONG_TYPE
 
struct  cryptonote::json::BAD_INPUT
 
struct  cryptonote::json::PARSE_FAIL
 

Namespaces

 cryptonote
 Holds cryptonote related classes and helpers.
 
 cryptonote::json
 

Macros

#define OBJECT_HAS_MEMBER_OR_THROW(val, key)
 
#define INSERT_INTO_JSON_OBJECT(jsonVal, doc, key, source)
 
#define GET_FROM_JSON_OBJECT(source, dst, key)
 

Functions

template<typename Type >
constexpr bool cryptonote::json::is_to_hex ()
 
template<class Type >
std::enable_if< is_to_hex< Type >)>::type cryptonote::json::toJsonValue (rapidjson::Document &doc, const Type &pod, rapidjson::Value &value)
 
template<class Type >
std::enable_if< is_to_hex< Type >)>::type cryptonote::json::fromJsonValue (const rapidjson::Value &val, Type &t)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const std::string &i, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, std::string &str)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, bool i, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, bool &b)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, unsigned char &i)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, signed char &i)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, char &i)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, unsigned short &i)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, short &i)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const unsigned i, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, unsigned &i)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const unsigned long long i, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, unsigned long long &i)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const long long i, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, long long &i)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const unsigned long i, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, unsigned long &i)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const long i, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, long &i)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::transaction &tx, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::transaction &tx)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::block &b, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::block &b)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::txin_v &txin, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::txin_v &txin)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::txin_gen &txin, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::txin_gen &txin)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::txin_to_script &txin, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::txin_to_script &txin)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::txin_to_scripthash &txin, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::txin_to_scripthash &txin)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::txin_to_key &txin, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::txin_to_key &txin)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::txin_to_key_public &txin, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::txin_to_key_public &txin)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::txout_target_v &txout, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::txout_target_v &txout)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::txout_to_script &txout, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::txout_to_script &txout)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::txout_to_scripthash &txout, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::txout_to_scripthash &txout)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::txout_to_key &txout, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::txout_to_key &txout)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::txout_to_key_public &txout, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::txout_to_key_public &txout)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::tx_out &txout, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::tx_out &txout)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::connection_info &info, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::connection_info &info)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::block_complete_entry &blk, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::block_complete_entry &blk)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::rpc::block_with_transactions &blk, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::rpc::block_with_transactions &blk)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::rpc::transaction_info &tx_info, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::rpc::transaction_info &tx_info)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::rpc::output_key_and_amount_index &out, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::rpc::output_key_and_amount_index &out)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::rpc::amount_with_random_outputs &out, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::rpc::amount_with_random_outputs &out)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::rpc::peer &peer, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::rpc::peer &peer)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::rpc::tx_in_pool &tx, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::rpc::tx_in_pool &tx)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::rpc::hard_fork_info &info, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::rpc::hard_fork_info &info)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::rpc::output_amount_count &out, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::rpc::output_amount_count &out)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::rpc::output_amount_and_index &out, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::rpc::output_amount_and_index &out)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::rpc::output_key_mask_unlocked &out, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::rpc::output_key_mask_unlocked &out)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::rpc::error &err, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::rpc::error &error)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::rpc::BlockHeaderResponse &response, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::rpc::BlockHeaderResponse &response)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const rct::rctSig &sig, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, rct::rctSig &sig)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const rct::ecdhTuple &tuple, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, rct::ecdhTuple &tuple)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const rct::rangeSig &sig, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, rct::rangeSig &sig)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const rct::Bulletproof &p, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, rct::Bulletproof &p)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const rct::boroSig &sig, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, rct::boroSig &sig)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const rct::mgSig &sig, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, rct::mgSig &sig)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::rpc::DaemonInfo &info, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::rpc::DaemonInfo &info)
 
void cryptonote::json::toJsonValue (rapidjson::Document &doc, const cryptonote::rpc::output_distribution &dist, rapidjson::Value &val)
 
void cryptonote::json::fromJsonValue (const rapidjson::Value &val, cryptonote::rpc::output_distribution &dist)
 
template<typename Map >
std::enable_if< sfinae::is_map_like< Map >::value, void >::type cryptonote::json::toJsonValue (rapidjson::Document &doc, const Map &map, rapidjson::Value &val)
 
template<typename Map >
std::enable_if< sfinae::is_map_like< Map >::value, void >::type cryptonote::json::fromJsonValue (const rapidjson::Value &val, Map &map)
 
template<typename Vec >
std::enable_if< sfinae::is_vector_like< Vec >::value, void >::type cryptonote::json::toJsonValue (rapidjson::Document &doc, const Vec &vec, rapidjson::Value &val)
 
template<typename Vec >
std::enable_if< sfinae::is_vector_like< Vec >::value, void >::type cryptonote::json::fromJsonValue (const rapidjson::Value &val, Vec &vec)
 

Macro Definition Documentation

◆ GET_FROM_JSON_OBJECT

#define GET_FROM_JSON_OBJECT (   source,
  dst,
  key 
)
Value:
decltype(dst) dstVal##key; \
dst = dstVal##key;
const CharType(& source)[N]
Definition: pointer.h:1147
const char * key
Definition: hmac_keccak.cpp:39
#define OBJECT_HAS_MEMBER_OR_THROW(val, key)
Definition: json_object.h:38
std::enable_if< sfinae::is_vector_like< Vec >::value, void >::type fromJsonValue(const rapidjson::Value &val, Vec &vec)
Definition: json_object.h:361

Definition at line 52 of file json_object.h.

◆ INSERT_INTO_JSON_OBJECT

#define INSERT_INTO_JSON_OBJECT (   jsonVal,
  doc,
  key,
  source 
)
Value:
jsonVal.AddMember(#key, key##Val, doc.GetAllocator());
std::enable_if< sfinae::is_vector_like< Vec >::value, void >::type toJsonValue(rapidjson::Document &doc, const Vec &vec, rapidjson::Value &val)
Definition: json_object.h:348
const CharType(& source)[N]
Definition: pointer.h:1147
const char * key
Definition: hmac_keccak.cpp:39
GenericValue< UTF8<> > Value
GenericValue with UTF8 encoding.
Definition: document.h:2116

Definition at line 47 of file json_object.h.

◆ OBJECT_HAS_MEMBER_OR_THROW

#define OBJECT_HAS_MEMBER_OR_THROW (   val,
  key 
)
Value:
do \
{ \
if (!val.HasMember(key)) \
{ \
} \
} while (0);
const char * key
Definition: hmac_keccak.cpp:39

Definition at line 38 of file json_object.h.