nlib
JsonRpcServerExec.h
Go to the documentation of this file.
1 
2 /*--------------------------------------------------------------------------------*
3  Project: CrossRoad
4  Copyright (C)Nintendo All rights reserved.
5 
6  These coded instructions, statements, and computer programs contain proprietary
7  information of Nintendo and/or its licensed developers and are protected by
8  national and international copyright laws. They may not be disclosed to third
9  parties or copied or duplicated in any form, in whole or in part, without the
10  prior written consent of Nintendo.
11 
12  The content herein is highly confidential and should be handled accordingly.
13  *--------------------------------------------------------------------------------*/
14 
15 #pragma once
16 #ifndef INCLUDE_NN_NLIB_MSGPACK_JSONRPC_JSONRPCSERVEREXEC_H_
17 #define INCLUDE_NN_NLIB_MSGPACK_JSONRPC_JSONRPCSERVEREXEC_H_
18 
19 #include "nn/nlib/Config.h"
20 #include "nn/nlib/Nlist.h"
21 #include "nn/nlib/OutputStream.h"
22 #include "nn/nlib/UniquePtr.h"
26 
27 #if defined(_MSC_VER) && defined(nx_msgpack_EXPORTS)
28 #undef NLIB_VIS_PUBLIC
29 #define NLIB_VIS_PUBLIC NLIB_WINEXPORT
30 #endif
31 
32 NLIB_NAMESPACE_BEGIN
33 namespace msgpack {
34 namespace jsonrpc {
35 
43  JSONSERVER_OK = kJsonServerOk,
44  JSONSERVER_PARSE_ERROR = kJsonServerParseError,
45  JSONSERVER_INVALID_REQUEST = kJsonServerInvalidRequest,
46  JSONSERVER_METHOD_NOT_FOUND = kJsonServerMethodNotFound,
47  JSONSERVER_INVALID_PARAMS = kJsonServerInvalidParams,
48  JSONSERVER_INTERNAL_ERROR = kJsonServerInternalError
49 };
50 
52  JsonRpcResponse& response) NLIB_NOEXCEPT_FUNCPTR; // NOLINT
53 
57 
58 NLIB_VIS_PUBLIC size_t JsonRpcServerExec(const void* p, size_t n,
60 
61 } // namespace jsonrpc
62 } // namespace msgpack
63 NLIB_NAMESPACE_END
64 
65 #if defined(_MSC_VER) && defined(nx_msgpack_EXPORTS)
66 #undef NLIB_VIS_PUBLIC
67 #define NLIB_VIS_PUBLIC NLIB_WINIMPORT
68 #endif
69 
70 #endif // INCLUDE_NN_NLIB_MSGPACK_JSONRPC_JSONRPCSERVEREXEC_H_
JsonRpcServerFuncCallError
Return value of the server-side JSON-RPC method handler.
Class for representing the JSON-RPC response.
void ClearJsonRpcServerMethodTable()
Deletes all registered JSON-RPC method handlers.
JsonRpcServerFuncCallError(* JsonRpcServerFunc)(MpObject &param, JsonRpcResponse &response) NLIB_NOEXCEPT_FUNCPTR
JSON-RPC method handler.
Sets the JSON-RPC2.0 -32700 error. Parsing the JSON-RPC request is successful if the JSON-RPC metho...
UniquePtr owns the pointer, and when it goes out of scope, the pointer is released by the destructor ...
Definition: UniquePtr.h:109
Defines that class that is corresponding to std::unique_ptr.
#define NLIB_VIS_PUBLIC
Symbols for functions and classes are made available outside of the library.
Definition: Platform_unix.h:89
Object created when MessagePack or JSON is read.
Definition: MpObject.h:95
Defines the class that resembles std::vector but can store objects that cannot be copied...
Object created when MessagePack, JSON, or CSV is read.
Sets the JSON-RPC2.0 -32602 error. Returning this value when the JSON-RPC request parameter is not ...
errno_t AddJsonRpcServerMethod(const char *method, JsonRpcServerFunc func)
Sets the JSON-RPC method handler.
A file that contains the configuration information for each development environment.
Returned when the function process is successful. Set the response and return this value when retur...
size_t JsonRpcServerExec(const void *p, size_t n, ReallocOutputStream::UniquePtrType *ptr)
Creates the JSON-RPC response byte string by processing the JSON-RPC request.
JsonRpcServerFunc GetJsonRpcServerMethod(const char *method)
Gets the method handler of the JSON-RPC registered by specifying the method name. ...
Defines the base class for output streams.
Sets the JSON-RPC2.0 -32601 error. The method is already found if the JSON-RPC method handler is ca...
Sets the JSON-RPC2.0 -32603 error. Returning this value when an error has occurred within the JSON-...
Sets the JSON-RPC2.0 -32600 error. The JSON-RPC request is already known to be valid if the JSON-RP...
int errno_t
Indicates with an int-type typedef that a POSIX error value is returned as the return value...
Definition: NMalloc.h:37