Bitcoin Core  0.20.99
P2P Digital Currency
Public Types | Public Member Functions | Public Attributes | List of all members
RPCResult Struct Reference

#include <util.h>

Public Types

enum  Type {
  Type::OBJ, Type::ARR, Type::STR, Type::NUM,
  Type::BOOL, Type::NONE, Type::STR_AMOUNT, Type::STR_HEX,
  Type::OBJ_DYN, Type::ARR_FIXED, Type::NUM_TIME, Type::ELISION
}
 

Public Member Functions

 RPCResult (const std::string cond, const Type type, const std::string m_key_name, const bool optional, const std::string description, const std::vector< RPCResult > inner={})
 
 RPCResult (const std::string cond, const Type type, const std::string m_key_name, const std::string description, const std::vector< RPCResult > inner={})
 
 RPCResult (const Type type, const std::string m_key_name, const bool optional, const std::string description, const std::vector< RPCResult > inner={})
 
 RPCResult (const Type type, const std::string m_key_name, const std::string description, const std::vector< RPCResult > inner={})
 
void ToSections (Sections &sections, OuterType outer_type=OuterType::NONE, const int current_indent=0) const
 Append the sections of the result. More...
 
std::string ToStringObj () const
 Return the type string of the result when it is in an object (dict). More...
 
std::string ToDescriptionString () const
 Return the description string, including the result type. More...
 

Public Attributes

const Type m_type
 
const std::string m_key_name
 Only used for dicts. More...
 
const std::vector< RPCResultm_inner
 Only used for arrays or dicts. More...
 
const bool m_optional
 
const std::string m_description
 
const std::string m_cond
 

Detailed Description

Definition at line 221 of file util.h.

Member Enumeration Documentation

◆ Type

enum RPCResult::Type
strong
Enumerator
OBJ 
ARR 
STR 
NUM 
BOOL 
NONE 
STR_AMOUNT 

Special string to represent a floating point amount.

STR_HEX 

Special string with only hex chars.

OBJ_DYN 

Special dictionary with keys that are not literals.

ARR_FIXED 

Special array that has a fixed number of entries.

NUM_TIME 

Special numeric to denote unix epoch time.

ELISION 

Special type to denote elision (...)

Definition at line 222 of file util.h.

Constructor & Destructor Documentation

◆ RPCResult() [1/4]

RPCResult::RPCResult ( const std::string  cond,
const Type  type,
const std::string  m_key_name,
const bool  optional,
const std::string  description,
const std::vector< RPCResult inner = {} 
)
inline

Definition at line 244 of file util.h.

◆ RPCResult() [2/4]

RPCResult::RPCResult ( const std::string  cond,
const Type  type,
const std::string  m_key_name,
const std::string  description,
const std::vector< RPCResult inner = {} 
)
inline

Definition at line 263 of file util.h.

◆ RPCResult() [3/4]

RPCResult::RPCResult ( const Type  type,
const std::string  m_key_name,
const bool  optional,
const std::string  description,
const std::vector< RPCResult inner = {} 
)
inline

Definition at line 271 of file util.h.

◆ RPCResult() [4/4]

RPCResult::RPCResult ( const Type  type,
const std::string  m_key_name,
const std::string  description,
const std::vector< RPCResult inner = {} 
)
inline

Definition at line 288 of file util.h.

Member Function Documentation

◆ ToDescriptionString()

std::string RPCResult::ToDescriptionString ( ) const

Return the description string, including the result type.

◆ ToSections()

void RPCResult::ToSections ( Sections sections,
OuterType  outer_type = OuterType::NONE,
const int  current_indent = 0 
) const

Append the sections of the result.

Definition at line 634 of file util.cpp.

Here is the call graph for this function:

◆ ToStringObj()

std::string RPCResult::ToStringObj ( ) const

Return the type string of the result when it is in an object (dict).

Member Data Documentation

◆ m_cond

const std::string RPCResult::m_cond

Definition at line 242 of file util.h.

◆ m_description

const std::string RPCResult::m_description

Definition at line 241 of file util.h.

◆ m_inner

const std::vector<RPCResult> RPCResult::m_inner

Only used for arrays or dicts.

Definition at line 239 of file util.h.

◆ m_key_name

const std::string RPCResult::m_key_name

Only used for dicts.

Definition at line 238 of file util.h.

◆ m_optional

const bool RPCResult::m_optional

Definition at line 240 of file util.h.

◆ m_type

const Type RPCResult::m_type

Definition at line 237 of file util.h.


The documentation for this struct was generated from the following files: