nlib
|
Class for representing the JSON-RPC response. More...
#include "nn/nlib/msgpack/jsonrpc/JsonRpcResponse.h"
Public Types | |
enum | ErrorCode { OK = 0, PARSE_ERROR = -32700, INVALID_REQUEST = -32600, METHOD_NOT_FOUND = -32601, INVALID_PARAMS = -32602, INTERNAL_ERROR = -32603, CLIENT_ABORT = -31000 } |
Definition of the predefined error code contained in the JSON-RPC response. More... | |
Public Member Functions | |
JsonRpcResponse () | |
Instantiates the object with default parameters (default constructor). | |
void | MoveResultFrom (MpObject &obj) |
Sets the JSON-RPC return value (when not an error). More... | |
void | SetError (int errcode, const char *msg, MpObject &data) |
Sets the JSON-RPC function error. More... | |
void | SetError (int errcode, const char *msg) |
Sets the JSON-RPC function error. More... | |
bool | IsError () const |
Returns whether an error has occurred. More... | |
int | GetErrorCode () const |
Returns an error code. More... | |
reqid_t | GetId () const |
Returns the ID of the JSON-RPC response. More... | |
const char * | GetErrorMessage () const |
Returns an error message. More... | |
MpObject & | GetMpObject () |
Returns the JSON-RPC return value, or additional information about an error. More... | |
const MpObject & | GetMpObject () const |
Returns the JSON-RPC return value, or additional information about an error. More... | |
operator bool () const | |
Returns true if an error has not occurred. | |
Class for representing the JSON-RPC response.
2.0
becomes the value.Definition at line 24 of file JsonRpcResponse.h.
Definition of the predefined error code contained in the JSON-RPC response.
Definition at line 26 of file JsonRpcResponse.h.
|
inline |
|
inline |
|
inline |
Returns the ID of the JSON-RPC response.
Definition at line 46 of file JsonRpcResponse.h.
|
inline |
Returns the JSON-RPC return value, or additional information about an error.
Definition at line 51 of file JsonRpcResponse.h.
|
inline |
Returns the JSON-RPC return value, or additional information about an error.
Definition at line 52 of file JsonRpcResponse.h.
|
inline |
Returns whether an error has occurred.
true
if an error has occurred. Definition at line 44 of file JsonRpcResponse.h.
nn::nlib::msgpack::jsonrpc::JsonRpcResponse::MoveResultFrom | ( | MpObject & | obj | ) |
Sets the JSON-RPC return value (when not an error).
[in,out] | obj | The specified return value. |
JsonRpcResponse
object to avoid the overhead of copying. nn::nlib::msgpack::jsonrpc::JsonRpcResponse::SetError | ( | int | errcode, |
const char * | msg, | ||
MpObject & | data | ||
) |
Sets the JSON-RPC function error.
[in] | errcode | Error code. |
[in] | msg | Error message. |
[in,out] | data | Additional information about the error. |
JsonRpcResponse
object to avoid the overhead of copying.
|
inline |
Sets the JSON-RPC function error.
[in] | errcode | Error code. |
[in] | msg | Error message. |
Definition at line 39 of file JsonRpcResponse.h.
© 2013, 2014, 2015 Nintendo Co., Ltd. All rights reserved.