JSON RPC
JSON-RPC 2.0 library for C++
utils.cpp File Reference

Implemenmtation of utility functions for JSON RPC handling. More...

#include "utils.h"
#include "exception.h"
+ Include dependency graph for utils.cpp:

Go to the source code of this file.

Namespaces

namespace  wwa
 
namespace  wwa::json_rpc
 Library namespace.
 

Functions

WWA_JSONRPC_EXPORT nlohmann::json wwa::json_rpc::generate_error_response (const exception &e, const nlohmann::json &id=nlohmann::json::value_t::null)
 Generates an error response.
 
WWA_JSONRPC_EXPORT int wwa::json_rpc::get_error_code (const nlohmann::json &response)
 Gets the error code from an error response.
 
WWA_JSONRPC_EXPORT std::string wwa::json_rpc::get_error_message (const nlohmann::json &response)
 Gets the error message from an error response.
 
WWA_JSONRPC_EXPORT nlohmann::json wwa::json_rpc::get_request_id (const nlohmann::json &request)
 Get the request id object.
 
WWA_JSONRPC_EXPORT bool wwa::json_rpc::is_error_response (const nlohmann::json &response)
 Checks whether response is an error response.
 
WWA_JSONRPC_EXPORT bool wwa::json_rpc::is_valid_request_id (const nlohmann::json &id)
 Checks if the provided JSON value is a valid JSON RPC request ID.
 
WWA_JSONRPC_EXPORT std::string wwa::json_rpc::serialize_repsonse (const nlohmann::json &response)
 Serializes the JSON RPC response to a string.
 

Detailed Description

Implemenmtation of utility functions for JSON RPC handling.

Definition in file utils.cpp.