62 bool setStr(
const std::string& val);
73 void getObjMap(std::map<std::string,UniValue>& kv)
const;
74 bool checkObject(
const std::map<std::string,UniValue::VType>& memberTypes)
const;
77 bool exists(
const std::string& key)
const {
size_t i;
return findKey(key, i); }
113 bool push_backV(
const std::vector<UniValue>& vec);
117 bool pushKV(
const std::string& key,
const std::string& val_) {
119 return pushKV(key, tmpVal);
121 bool pushKV(
const std::string& key,
const char *val_) {
122 std::string _val(val_);
125 bool pushKV(
const std::string& key, int64_t val_) {
127 return pushKV(key, tmpVal);
129 bool pushKV(
const std::string& key, uint64_t val_) {
131 return pushKV(key, tmpVal);
133 bool pushKV(
const std::string& key,
int val_) {
135 return pushKV(key, tmpVal);
137 bool pushKV(
const std::string& key,
double val_) {
139 return pushKV(key, tmpVal);
143 std::string
write(
unsigned int prettyIndent = 0,
144 unsigned int indentLevel = 0)
const;
146 bool read(
const char *raw,
size_t len);
147 bool read(
const char *raw) {
return read(raw, strlen(raw)); }
148 bool read(
const std::string& rawStr) {
149 return read(rawStr.data(), rawStr.size());
158 bool findKey(
const std::string& key,
size_t& retIdx)
const;
159 void writeArray(
unsigned int prettyIndent,
unsigned int indentLevel, std::string& s)
const;
160 void writeObject(
unsigned int prettyIndent,
unsigned int indentLevel, std::string& s)
const;
165 const std::vector<std::string>&
getKeys()
const;
166 const std::vector<UniValue>&
getValues()
const;
168 const std::string&
get_str()
const;
177 return pushKV(pear.first, pear.second);
186 static inline std::pair<std::string,UniValue> Pair(
const char *cKey,
const char *cVal)
188 std::string key(cKey);
190 return std::make_pair(key, uVal);
193 static inline std::pair<std::string,UniValue> Pair(
const char *cKey, std::string strVal)
195 std::string key(cKey);
197 return std::make_pair(key, uVal);
200 static inline std::pair<std::string,UniValue> Pair(
const char *cKey, uint64_t u64Val)
202 std::string key(cKey);
204 return std::make_pair(key, uVal);
207 static inline std::pair<std::string,UniValue> Pair(
const char *cKey, int64_t i64Val)
209 std::string key(cKey);
211 return std::make_pair(key, uVal);
214 static inline std::pair<std::string,UniValue> Pair(
const char *cKey,
bool iVal)
216 std::string key(cKey);
218 return std::make_pair(key, uVal);
221 static inline std::pair<std::string,UniValue> Pair(
const char *cKey,
int iVal)
223 std::string key(cKey);
225 return std::make_pair(key, uVal);
228 static inline std::pair<std::string,UniValue> Pair(
const char *cKey,
double dVal)
230 std::string key(cKey);
232 return std::make_pair(key, uVal);
235 static inline std::pair<std::string,UniValue> Pair(
const char *cKey,
const UniValue& uVal)
237 std::string key(cKey);
238 return std::make_pair(key, uVal);
241 static inline std::pair<std::string,UniValue> Pair(std::string key,
const UniValue& uVal)
243 return std::make_pair(key, uVal);
263 unsigned int& consumed,
const char *raw,
const char *end);
266 static inline bool jsonTokenIsValue(
enum jtokentype jtt)
283 static inline bool json_isspace(
int ch)
303 #endif // __UNIVALUE_H__
const std::string & get_str() const
bool setNumStr(const std::string &val)
bool read(const std::string &rawStr)
bool pushKV(const std::string &key, int val_)
void writeArray(unsigned int prettyIndent, unsigned int indentLevel, std::string &s) const
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)
const std::vector< UniValue > & getValues() const
bool push_back(uint64_t val_)
UniValue(const char *val_)
void getObjMap(std::map< std::string, UniValue > &kv) const
std::vector< UniValue > values
bool pushKVs(const UniValue &obj)
const UniValue & operator[](const std::string &key) const
enum VType getType() 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)
int64_t get_int64() const
bool push_back(const UniValue &val)
bool setFloat(double val)
bool pushKV(const std::string &key, const UniValue &val)
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 setStr(const std::string &val)
bool setInt(uint64_t val)
bool pushKV(const std::string &key, uint64_t val_)
const std::string & getValStr() const
const UniValue & get_array() 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)
bool checkObject(const std::map< std::string, UniValue::VType > &memberTypes) const
bool exists(const std::string &key) const
const std::vector< std::string > & getKeys() const
bool findKey(const std::string &key, size_t &retIdx) const
bool pushKV(const std::string &key, int64_t val_)
void __pushKV(const std::string &key, const UniValue &val)
std::string write(unsigned int prettyIndent=0, unsigned int indentLevel=0) const
uint32_t ch(uint32_t x, uint32_t y, uint32_t z)
const UniValue & get_obj() const
bool push_back(double val_)
UniValue(UniValue::VType initialType, const std::string &initialStr="")
bool push_back(const char *val_)