diff options
Diffstat (limited to 'src/rpc/message.h')
-rw-r--r-- | src/rpc/message.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/rpc/message.h b/src/rpc/message.h index 4cbc84fe4..5c369cdfc 100644 --- a/src/rpc/message.h +++ b/src/rpc/message.h @@ -29,10 +29,11 @@ #pragma once #include <rapidjson/document.h> -#include <rapidjson/stringbuffer.h> #include <rapidjson/writer.h> #include <string> +#include "byte_slice.h" +#include "byte_stream.h" #include "rpc/message_data_structs.h" namespace cryptonote @@ -43,7 +44,7 @@ namespace rpc class Message { - virtual void doToJson(rapidjson::Writer<rapidjson::StringBuffer>& dest) const + virtual void doToJson(rapidjson::Writer<epee::byte_stream>& dest) const {} public: @@ -57,7 +58,7 @@ namespace rpc virtual ~Message() { } - void toJson(rapidjson::Writer<rapidjson::StringBuffer>& dest) const; + void toJson(rapidjson::Writer<epee::byte_stream>& dest) const; virtual void fromJson(const rapidjson::Value& val); @@ -85,8 +86,8 @@ namespace rpc cryptonote::rpc::error getError(); - static std::string getRequest(const std::string& request, const Message& message, unsigned id); - static std::string getResponse(const Message& message, const rapidjson::Value& id); + static epee::byte_slice getRequest(const std::string& request, const Message& message, unsigned id); + static epee::byte_slice getResponse(const Message& message, const rapidjson::Value& id); private: FullMessage() = default; @@ -99,10 +100,10 @@ namespace rpc // convenience functions for bad input - std::string BAD_REQUEST(const std::string& request); - std::string BAD_REQUEST(const std::string& request, const rapidjson::Value& id); + epee::byte_slice BAD_REQUEST(const std::string& request); + epee::byte_slice BAD_REQUEST(const std::string& request, const rapidjson::Value& id); - std::string BAD_JSON(const std::string& error_details); + epee::byte_slice BAD_JSON(const std::string& error_details); } // namespace rpc |