Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/client.cpp
Show First 20 Lines • Show All 198 Lines • ▼ Show 20 Lines | |||||
/** | /** | ||||
* Non-RFC4627 JSON parser, accepts internal values (such as numbers, true, | * Non-RFC4627 JSON parser, accepts internal values (such as numbers, true, | ||||
* false, null) as well as objects and arrays. | * false, null) as well as objects and arrays. | ||||
*/ | */ | ||||
UniValue ParseNonRFCJSONValue(const std::string &strVal) { | UniValue ParseNonRFCJSONValue(const std::string &strVal) { | ||||
UniValue jVal; | UniValue jVal; | ||||
if (!jVal.read(std::string("[") + strVal + std::string("]")) || | if (!jVal.read(std::string("[") + strVal + std::string("]")) || | ||||
!jVal.isArray() || jVal.size() != 1) { | !jVal.isArray() || jVal.size() != 1) { | ||||
throw std::runtime_error(std::string("Error parsing JSON:") + strVal); | throw std::runtime_error(std::string("Error parsing JSON: ") + strVal); | ||||
} | } | ||||
return jVal[0]; | return jVal[0]; | ||||
} | } | ||||
UniValue RPCConvertValues(const std::string &strMethod, | UniValue RPCConvertValues(const std::string &strMethod, | ||||
const std::vector<std::string> &strParams) { | const std::vector<std::string> &strParams) { | ||||
UniValue params(UniValue::VARR); | UniValue params(UniValue::VARR); | ||||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |