0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-12 11:19:08 -05:00

rpc: Add m_skip_type_check to RPCResult

Used in the next commit.
This commit is contained in:
MarcoFalke 2021-09-23 20:48:44 +02:00
parent 4a0ab355b3
commit f4bc4a705a

View file

@ -256,6 +256,7 @@ struct RPCResult {
const std::string m_key_name; //!< Only used for dicts const std::string m_key_name; //!< Only used for dicts
const std::vector<RPCResult> m_inner; //!< Only used for arrays or dicts const std::vector<RPCResult> m_inner; //!< Only used for arrays or dicts
const bool m_optional; const bool m_optional;
const bool m_skip_type_check;
const std::string m_description; const std::string m_description;
const std::string m_cond; const std::string m_cond;
@ -270,6 +271,7 @@ struct RPCResult {
m_key_name{std::move(m_key_name)}, m_key_name{std::move(m_key_name)},
m_inner{std::move(inner)}, m_inner{std::move(inner)},
m_optional{optional}, m_optional{optional},
m_skip_type_check{false},
m_description{std::move(description)}, m_description{std::move(description)},
m_cond{std::move(cond)} m_cond{std::move(cond)}
{ {
@ -290,11 +292,13 @@ struct RPCResult {
const std::string m_key_name, const std::string m_key_name,
const bool optional, const bool optional,
const std::string description, const std::string description,
const std::vector<RPCResult> inner = {}) const std::vector<RPCResult> inner = {},
bool skip_type_check = false)
: m_type{std::move(type)}, : m_type{std::move(type)},
m_key_name{std::move(m_key_name)}, m_key_name{std::move(m_key_name)},
m_inner{std::move(inner)}, m_inner{std::move(inner)},
m_optional{optional}, m_optional{optional},
m_skip_type_check{skip_type_check},
m_description{std::move(description)}, m_description{std::move(description)},
m_cond{} m_cond{}
{ {
@ -305,8 +309,9 @@ struct RPCResult {
const Type type, const Type type,
const std::string m_key_name, const std::string m_key_name,
const std::string description, const std::string description,
const std::vector<RPCResult> inner = {}) const std::vector<RPCResult> inner = {},
: RPCResult{type, m_key_name, false, description, inner} {} bool skip_type_check = false)
: RPCResult{type, m_key_name, false, description, inner, skip_type_check} {}
/** Append the sections of the result. */ /** Append the sections of the result. */
void ToSections(Sections& sections, OuterType outer_type = OuterType::NONE, const int current_indent = 0) const; void ToSections(Sections& sections, OuterType outer_type = OuterType::NONE, const int current_indent = 0) const;