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

Keeps track of RPCArgs by transforming them into sections for the purpose of serializing everything to a single string. More...

Public Types

enum  OuterType { OuterType::ARR, OuterType::OBJ, OuterType::NAMED_ARG }
 Serializing RPCArgs depends on the outer type. More...
 

Public Member Functions

void PushSection (const Section &s)
 
void Push (const RPCArg &arg, const size_t current_indent=5, const OuterType outer_type=OuterType::NAMED_ARG)
 Recursive helper to translate an RPCArg into sections. More...
 
std::string ToString () const
 Concatenate all sections with proper padding. More...
 

Public Attributes

std::vector< Sectionm_sections
 
size_t m_max_pad {0}
 

Detailed Description

Keeps track of RPCArgs by transforming them into sections for the purpose of serializing everything to a single string.

Definition at line 304 of file util.cpp.

Member Enumeration Documentation

◆ OuterType

enum Sections::OuterType
strong

Serializing RPCArgs depends on the outer type.

Only arrays and dictionaries can be nested in json. The top-level outer type is "named arguments", a mix between a dictionary and arrays.

Enumerator
ARR 
OBJ 
NAMED_ARG 

Definition at line 319 of file util.cpp.

Member Function Documentation

◆ Push()

void Sections::Push ( const RPCArg arg,
const size_t  current_indent = 5,
const OuterType  outer_type = OuterType::NAMED_ARG 
)
inline

Recursive helper to translate an RPCArg into sections.

Definition at line 328 of file util.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PushSection()

void Sections::PushSection ( const Section s)
inline

Definition at line 308 of file util.cpp.

◆ ToString()

std::string Sections::ToString ( ) const
inline

Concatenate all sections with proper padding.

Definition at line 386 of file util.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ m_max_pad

size_t Sections::m_max_pad {0}

Definition at line 306 of file util.cpp.

◆ m_sections

std::vector<Section> Sections::m_sections

Definition at line 305 of file util.cpp.


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