/* */ #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; SharedHandle param; SharedHandle id; RpcResponse (int code, const SharedHandle& param, const SharedHandle& id); RpcResponse(const RpcResponse& c); ~RpcResponse(); RpcResponse& operator=(const RpcResponse& c); }; 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