![]() |
Bitcoin Core 31.1.0
P2P Digital Currency
|
#include <util.h>
Public Types | |
| enum class | Type { OBJ , ARR , STR , NUM , BOOL , OBJ_NAMED_PARAMS , OBJ_USER_KEYS , AMOUNT , STR_HEX , RANGE } |
| enum class | Optional { NO , OMITTED } |
| using | DefaultHint = std::string |
| Hint for default value. | |
| using | Default = UniValue |
| Default constant value. | |
| using | Fallback = std::variant<Optional, DefaultHint, Default> |
Public Member Functions | |
| RPCArg (std::string name, Type type, Fallback fallback, std::string description, RPCArgOptions opts={}) | |
| RPCArg (std::string name, Type type, Fallback fallback, std::string description, std::vector< RPCArg > inner, RPCArgOptions opts={}) | |
| bool | IsOptional () const |
| UniValue | MatchesType (const UniValue &request) const |
| Check whether the request JSON type matches. | |
| std::string | GetFirstName () const |
| Return the first of all aliases. | |
| std::string | GetName () const |
| Return the name, throws when there are aliases. | |
| std::string | ToString (bool oneline) const |
| Return the type string of the argument. | |
| std::string | ToStringObj (bool oneline) const |
| Return the type string of the argument when it is in an object (dict). | |
| std::string | ToDescriptionString (bool is_named_arg) const |
| Return the description string, including the argument type and whether the argument is required. | |
Public Attributes | |
| const std::string | m_names |
| The name of the arg (can be empty for inner args, can contain multiple aliases separated by | for named request arguments). | |
| const Type | m_type |
| const std::vector< RPCArg > | m_inner |
| Only used for arrays or dicts. | |
| const Fallback | m_fallback |
| const std::string | m_description |
| const RPCArgOptions | m_opts |
| using RPCArg::Default = UniValue |
| using RPCArg::DefaultHint = std::string |
| using RPCArg::Fallback = std::variant<Optional, DefaultHint, Default> |
|
strong |
| Enumerator | |
|---|---|
| NO | Required arg. |
| OMITTED | Optional argument for which the default value is omitted from help text for one of two reasons:
|
|
strong |
|
inline |
|
inline |
| std::string RPCArg::GetFirstName | ( | ) | const |
| std::string RPCArg::GetName | ( | ) | const |
| bool RPCArg::IsOptional | ( | ) | const |
| std::string RPCArg::ToDescriptionString | ( | bool | is_named_arg | ) | const |
| std::string RPCArg::ToString | ( | bool | oneline | ) | const |
| std::string RPCArg::ToStringObj | ( | bool | oneline | ) | const |
| const std::vector<RPCArg> RPCArg::m_inner |
| const std::string RPCArg::m_names |
| const RPCArgOptions RPCArg::m_opts |