39 unsigned int consumed;
41 getJsonToken(tokenVal, consumed, s.data(), s.data() + s.size());
47 throw std::runtime_error{
"The string '" + str +
48 "' is not a valid JSON number"};
57 std::ostringstream oss;
65 std::ostringstream oss;
73 std::ostringstream oss;
75 oss << std::setprecision(16) << val_;
99 values.push_back(std::move(val_));
111 keys.push_back(std::move(key));
112 values.push_back(std::move(val_));
120 values[idx] = std::move(val_);
122 pushKVEnd(std::move(key), std::move(val_));
130 for (
size_t i = 0; i < obj.
keys.size(); i++) {
141 for (
size_t i = 0; i <
keys.size(); i++) {
147 for (
size_t i = 0; i <
keys.size(); i++) {
148 if (
keys[i] == key) {
158 const std::map<std::string, UniValue::VType> &t)
const {
163 for (
const auto &
object : t) {
165 if (!
findKey(
object.first, idx)) {
169 if (
values.at(idx).getType() !=
object.second) {
194 if (index >=
values.size()) {
202 if (
typ != expected) {
204 " is not of expected type " +
230 for (
unsigned int i = 0; i <
keys.size(); ++i) {
231 if (
keys[i] == key) {
void push_back(UniValue val)
bool checkObject(const std::map< std::string, UniValue::VType > &memberTypes) const
const UniValue & find_value(std::string_view key) const
void pushKVs(UniValue obj)
void setInt(uint64_t val)
void pushKVEnd(std::string key, UniValue val)
std::vector< UniValue > values
std::vector< std::string > keys
void checkType(const VType &expected) const
bool findKey(const std::string &key, size_t &retIdx) const
const UniValue & operator[](const std::string &key) const
void setFloat(double val)
void setStr(std::string str)
void pushKV(std::string key, UniValue val)
void setNumStr(std::string str)
void getObjMap(std::map< std::string, UniValue > &kv) const
void push_backV(const std::vector< UniValue > &vec)
static bool validNumStr(const std::string &s)
const UniValue NullUniValue
const char * uvTypeName(UniValue::VType t)
enum jtokentype getJsonToken(std::string &tokenVal, unsigned int &consumed, const char *raw, const char *end)