#include <util.h>
|
| RPCHelpMan (std::string name, std::string description, std::vector< RPCArg > args, RPCResults results, RPCExamples examples) |
|
| RPCHelpMan (std::string name, std::string description, std::vector< RPCArg > args, RPCResults results, RPCExamples examples, RPCMethodImpl fun) |
|
UniValue | HandleRequest (const JSONRPCRequest &request) const |
|
template<typename R > |
auto | Arg (size_t i) const |
| Helper to get a request argument. More...
|
|
template<typename R > |
auto | MaybeArg (size_t i) const |
|
std::string | ToString () const |
|
UniValue | GetArgMap () const |
| Return the named args that need to be converted from string to another JSON type. More...
|
|
bool | IsValidNumArgs (size_t num_args) const |
| If the supplied number of args is neither too small nor too high. More...
|
|
std::vector< std::pair< std::string, bool > > | GetArgNames () const |
| Return list of arguments and whether they are named-only. More...
|
|
|
template<typename R > |
R | ArgValue (size_t i) const |
|
Definition at line 396 of file util.h.
◆ RPCMethodImpl
◆ RPCHelpMan() [1/2]
RPCHelpMan::RPCHelpMan |
( |
std::string |
name, |
|
|
std::string |
description, |
|
|
std::vector< RPCArg > |
args, |
|
|
RPCResults |
results, |
|
|
RPCExamples |
examples |
|
) |
| |
◆ RPCHelpMan() [2/2]
◆ Arg()
template<typename R >
auto RPCHelpMan::Arg |
( |
size_t |
i | ) |
const |
|
inline |
Helper to get a request argument.
This function only works during m_fun(), i.e. it should only be used in RPC method implementations. The helper internally checks whether the user-passed argument isNull() and parses (from JSON) and returns the user-passed argument, or the default value derived from the RPCArg documentation, or a falsy value if no default was given.
Use Arg<Type>(i) to get the argument or its default value. Otherwise, use MaybeArg<Type>(i) to get the optional argument or a falsy value.
The Type passed to this helper must match the corresponding RPCArg::Type.
Definition at line 419 of file util.h.
◆ ArgValue()
template<typename R >
R RPCHelpMan::ArgValue |
( |
size_t |
i | ) |
const |
|
private |
◆ GetArgMap()
UniValue RPCHelpMan::GetArgMap |
( |
| ) |
const |
Return the named args that need to be converted from string to another JSON type.
Definition at line 793 of file util.cpp.
◆ GetArgNames()
std::vector< std::pair< std::string, bool > > RPCHelpMan::GetArgNames |
( |
| ) |
const |
Return list of arguments and whether they are named-only.
Definition at line 716 of file util.cpp.
◆ HandleRequest()
◆ IsValidNumArgs()
bool RPCHelpMan::IsValidNumArgs |
( |
size_t |
num_args | ) |
const |
If the supplied number of args is neither too small nor too high.
Definition at line 704 of file util.cpp.
◆ MaybeArg()
template<typename R >
auto RPCHelpMan::MaybeArg |
( |
size_t |
i | ) |
const |
|
inline |
◆ ToString()
std::string RPCHelpMan::ToString |
( |
| ) |
const |
◆ m_args
const std::vector<RPCArg> RPCHelpMan::m_args |
|
private |
◆ m_description
const std::string RPCHelpMan::m_description |
|
private |
◆ m_examples
◆ m_fun
◆ m_name
const std::string RPCHelpMan::m_name |
◆ m_req
◆ m_results
The documentation for this class was generated from the following files: