Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
Go to the documentation of this file. 25 if (str.size() != strlen(str.c_str()))
30 bool ParseInt32(
const std::string& str, int32_t *out)
36 long int n = strtol(str.c_str(), &endp, 10);
37 if(out) *out = (int32_t)n;
41 return endp && *endp == 0 && !errno &&
42 n >= std::numeric_limits<int32_t>::min() &&
43 n <= std::numeric_limits<int32_t>::max();
46 bool ParseInt64(
const std::string& str, int64_t *out)
52 long long int n = strtoll(str.c_str(), &endp, 10);
53 if(out) *out = (int64_t)n;
56 return endp && *endp == 0 && !errno &&
57 n >= std::numeric_limits<int64_t>::min() &&
58 n <= std::numeric_limits<int64_t>::max();
61 bool ParseDouble(
const std::string& str,
double *out)
65 if (str.size() >= 2 && str[0] ==
'0' && str[1] ==
'x')
67 std::istringstream text(str);
68 text.imbue(std::locale::classic());
71 if(out) *out = result;
72 return text.eof() && !text.fail();
79 throw std::runtime_error(
"JSON value is not an object as expected");
86 throw std::runtime_error(
"JSON value is not an object or array as expected");
93 throw std::runtime_error(
"JSON value is not a boolean as expected");
100 throw std::runtime_error(
"JSON value is not a string as expected");
107 throw std::runtime_error(
"JSON value is not an integer as expected");
110 throw std::runtime_error(
"JSON integer out of range");
117 throw std::runtime_error(
"JSON value is not an integer as expected");
120 throw std::runtime_error(
"JSON integer out of range");
127 throw std::runtime_error(
"JSON value is not a number as expected");
130 throw std::runtime_error(
"JSON double out of range");
137 throw std::runtime_error(
"JSON value is not an object as expected");
144 throw std::runtime_error(
"JSON value is not an array as expected");
const std::vector< UniValue > & getValues() const
const std::string & get_str() const
const UniValue & get_array() const
std::vector< UniValue > values
int64_t get_int64() const
const std::vector< std::string > & getKeys() const
bool ParseDouble(const std::string &str, double *out)
Convert string to double with strict parse error feedback.
const std::string & getValStr() const
static bool json_isspace(int ch)
bool ParseInt64(const std::string &str, int64_t *out)
Convert string to signed 64-bit integer with strict parse error feedback.
bool ParseInt32(const std::string &str, int32_t *out)
Convert string to signed 32-bit integer with strict parse error feedback.
static bool ParsePrechecks(const std::string &str)
const UniValue & get_obj() const
std::vector< std::string > keys