/* */ #ifndef D_RPC_RESPONSE_H #define D_RPC_RESPONSE_H #include "common.h" #include #include #include "ValueBase.h" namespace aria2 { namespace rpc { struct RpcResponse { // 0 for success, non-zero for error int code; std::unique_ptr param; std::unique_ptr id; RpcResponse (int code, std::unique_ptr param, std::unique_ptr id); }; std::string toXml(const RpcResponse& response, bool gzip = false); // Encodes RPC response in JSON. If callback is not empty, the // resulting string is JSONP. std::string toJson (const RpcResponse& response, const std::string& callback, bool gzip = false); std::string toJsonBatch (const std::vector& results, const std::string& callback, bool gzip = false); } // namespace rpc } // namespace aria2 #endif // D_RPC_RESPONSE_H