72 void getObjMap(std::map<std::string,UniValue>& kv)
const;
73 bool checkObject(
const std::map<std::string,UniValue::VType>& memberTypes)
const;
76 bool exists(
const std::string& key)
const {
size_t i;
return findKey(key, i); }
112 bool push_backV(
const std::vector<UniValue>& vec);
116 bool pushKV(
const std::string& key,
const std::string& val_) {
118 return pushKV(key, tmpVal);
120 bool pushKV(
const std::string& key,
const char *val_) {
121 std::string _val(val_);
124 bool pushKV(
const std::string& key, int64_t val_) {
126 return pushKV(key, tmpVal);
128 bool pushKV(
const std::string& key, uint64_t val_) {
130 return pushKV(key, tmpVal);
132 bool pushKV(
const std::string& key,
int val_) {
134 return pushKV(key, tmpVal);
136 bool pushKV(
const std::string& key,
double val_) {
138 return pushKV(key, tmpVal);
142 std::string
write(
unsigned int prettyIndent = 0,
143 unsigned int indentLevel = 0)
const;
145 bool read(
const char *raw,
size_t len);
146 bool read(
const char *raw) {
return read(raw, strlen(raw)); }
147 bool read(
const std::string& rawStr) {
148 return read(rawStr.data(), rawStr.size());
157 bool findKey(
const std::string& key,
size_t& retIdx)
const;
158 void writeArray(
unsigned int prettyIndent,
unsigned int indentLevel, std::string& s)
const;
159 void writeObject(
unsigned int prettyIndent,
unsigned int indentLevel, std::string& s)
const;
164 const std::vector<std::string>&
getKeys()
const;
165 const std::vector<UniValue>&
getValues()
const;
167 const std::string&
get_str()
const;
176 return pushKV(pear.first, pear.second);
185 static inline std::pair<std::string,UniValue>
Pair(
const char *cKey,
const char *cVal)
187 std::string key(cKey);
189 return std::make_pair(key, uVal);
192 static inline std::pair<std::string,UniValue>
Pair(
const char *cKey, std::string strVal)
194 std::string key(cKey);
196 return std::make_pair(key, uVal);
199 static inline std::pair<std::string,UniValue>
Pair(
const char *cKey, uint64_t u64Val)
201 std::string key(cKey);
203 return std::make_pair(key, uVal);
206 static inline std::pair<std::string,UniValue>
Pair(
const char *cKey, int64_t i64Val)
208 std::string key(cKey);
210 return std::make_pair(key, uVal);
213 static inline std::pair<std::string,UniValue>
Pair(
const char *cKey,
bool iVal)
215 std::string key(cKey);
217 return std::make_pair(key, uVal);
220 static inline std::pair<std::string,UniValue>
Pair(
const char *cKey,
int iVal)
222 std::string key(cKey);
224 return std::make_pair(key, uVal);
227 static inline std::pair<std::string,UniValue>
Pair(
const char *cKey,
double dVal)
229 std::string key(cKey);
231 return std::make_pair(key, uVal);
234 static inline std::pair<std::string,UniValue>
Pair(
const char *cKey,
const UniValue& uVal)
236 std::string key(cKey);
237 return std::make_pair(key, uVal);
240 static inline std::pair<std::string,UniValue>
Pair(std::string key,
const UniValue& uVal)
242 return std::make_pair(key, uVal);
262 unsigned int& consumed,
const char *raw,
const char *end);
302 #endif // __UNIVALUE_H__
static bool jsonTokenIsValue(enum jtokentype jtt)
bool setNumStr(const std::string &val)
bool read(const std::string &rawStr)
const std::vector< UniValue > & getValues() const
bool pushKV(const std::string &key, int val_)
bool read(const char *raw, size_t len)
UniValue(const std::string &val_)
bool pushKV(const std::string &key, const char *val_)
bool read(const char *raw)
bool push_back(uint64_t val_)
UniValue(const char *val_)
bool findKey(const std::string &key, size_t &retIdx) const
std::string write(unsigned int prettyIndent=0, unsigned int indentLevel=0) const
const std::string & get_str() const
enum VType getType() const
const UniValue & get_array() const
std::vector< UniValue > values
int64_t get_int64() const
bool pushKVs(const UniValue &obj)
const std::vector< std::string > & getKeys() const
const std::string & getValStr() const
const UniValue & find_value(const UniValue &obj, const std::string &name)
static bool json_isspace(int ch)
const UniValue & operator[](const std::string &key) const
bool push_back(const std::string &val_)
enum jtokentype getJsonToken(std::string &tokenVal, unsigned int &consumed, const char *raw, const char *end)
const char * uvTypeName(UniValue::VType t)
bool push_back(const UniValue &val)
void getObjMap(std::map< std::string, UniValue > &kv) const
bool exists(const std::string &key) const
bool setFloat(double val)
bool pushKV(const std::string &key, const UniValue &val)
static std::pair< std::string, UniValue > Pair(const char *cKey, const char *cVal)
bool push_back(int64_t val_)
bool pushKV(const std::string &key, double val_)
bool pushKV(const std::string &key, const std::string &val_)
bool checkObject(const std::map< std::string, UniValue::VType > &memberTypes) const
bool setStr(const std::string &val)
bool setInt(uint64_t val)
bool pushKV(const std::string &key, uint64_t val_)
const UniValue & get_obj() const
bool push_backV(const std::vector< UniValue > &vec)
void writeObject(unsigned int prettyIndent, unsigned int indentLevel, std::string &s) const
std::vector< std::string > keys
const UniValue NullUniValue
bool push_back(std::pair< std::string, UniValue > pear)
friend const UniValue & find_value(const UniValue &obj, const std::string &name)
void writeArray(unsigned int prettyIndent, unsigned int indentLevel, std::string &s) const
bool pushKV(const std::string &key, int64_t val_)
void __pushKV(const std::string &key, const UniValue &val)
bool push_back(double val_)
UniValue(UniValue::VType initialType, const std::string &initialStr="")
bool push_back(const char *val_)