Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/client.cpp
Show First 20 Lines • Show All 201 Lines • ▼ Show 20 Lines | UniValue RPCConvertValues(const std::string &strMethod, | ||||
return params; | return params; | ||||
} | } | ||||
UniValue RPCConvertNamedValues(const std::string &strMethod, | UniValue RPCConvertNamedValues(const std::string &strMethod, | ||||
const std::vector<std::string> &strParams) { | const std::vector<std::string> &strParams) { | ||||
UniValue params(UniValue::VOBJ); | UniValue params(UniValue::VOBJ); | ||||
for (const std::string &s : strParams) { | for (const std::string &s : strParams) { | ||||
size_t pos = s.find("="); | size_t pos = s.find('='); | ||||
if (pos == std::string::npos) { | if (pos == std::string::npos) { | ||||
throw(std::runtime_error("No '=' in named argument '" + s + | throw(std::runtime_error("No '=' in named argument '" + s + | ||||
"', this needs to be present for every " | "', this needs to be present for every " | ||||
"argument (even if it is empty)")); | "argument (even if it is empty)")); | ||||
} | } | ||||
std::string name = s.substr(0, pos); | std::string name = s.substr(0, pos); | ||||
std::string value = s.substr(pos + 1); | std::string value = s.substr(pos + 1); | ||||
Show All 12 Lines |