mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Add Json::to_string:
This allows the declaration for FastWriter to be hidden and makes conversion of Json::Value objects to strings a little less clunky.
This commit is contained in:
committed by
Vinnie Falco
parent
8c1c2f5d05
commit
9cba944d21
@@ -300,8 +300,7 @@ std::string JSONRPCRequest (std::string const& strMethod, Json::Value const& par
|
||||
request[jss::method] = strMethod;
|
||||
request[jss::params] = params;
|
||||
request[jss::id] = id;
|
||||
Json::FastWriter writer;
|
||||
return writer.write (request) + "\n";
|
||||
return to_string (request) + "\n";
|
||||
}
|
||||
|
||||
std::string JSONRPCReply (Json::Value const& result, Json::Value const& error, Json::Value const& id)
|
||||
@@ -310,8 +309,7 @@ std::string JSONRPCReply (Json::Value const& result, Json::Value const& error, J
|
||||
reply[jss::result] = result;
|
||||
//reply["error"]=error;
|
||||
//reply["id"]=id;
|
||||
Json::FastWriter writer;
|
||||
return writer.write (reply) + "\n";
|
||||
return to_string (reply) + "\n";
|
||||
}
|
||||
|
||||
void ErrorReply (std::ostream& stream, Json::Value const& objError, Json::Value const& id)
|
||||
|
||||
Reference in New Issue
Block a user