diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-04-12 17:09:23 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-04-16 08:45:05 -0400 |
commit | fa5b1f067fcf8bebb23455dd8a16cde5068e79cd (patch) | |
tree | 17dc98f13fa5b4015128b86265989a927f68bcdb /src/rpc/util.h | |
parent | fa86a4bbfc000593ae4ad9dcdaec3fd0c0406086 (diff) | |
download | bitcoin-fa5b1f067fcf8bebb23455dd8a16cde5068e79cd.tar.xz |
rpc: Document all aliases for second arg of getblock
Diffstat (limited to 'src/rpc/util.h')
-rw-r--r-- | src/rpc/util.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/rpc/util.h b/src/rpc/util.h index f65ad1246b..ef813978bd 100644 --- a/src/rpc/util.h +++ b/src/rpc/util.h @@ -142,7 +142,7 @@ struct RPCArg { OMITTED, }; using Fallback = boost::variant<Optional, /* default value for optional args */ std::string>; - const std::string m_name; //!< The name of the arg (can be empty for inner args) + 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; @@ -157,7 +157,7 @@ struct RPCArg { const std::string description, const std::string oneline_description = "", const std::vector<std::string> type_str = {}) - : m_name{std::move(name)}, + : m_names{std::move(name)}, m_type{std::move(type)}, m_fallback{std::move(fallback)}, m_description{std::move(description)}, @@ -175,7 +175,7 @@ struct RPCArg { const std::vector<RPCArg> inner, const std::string oneline_description = "", const std::vector<std::string> type_str = {}) - : m_name{std::move(name)}, + : m_names{std::move(name)}, m_type{std::move(type)}, m_inner{std::move(inner)}, m_fallback{std::move(fallback)}, @@ -188,6 +188,12 @@ struct RPCArg { bool IsOptional() const; + /** Return the first of all aliases */ + std::string GetFirstName() const; + + /** Return the name, throws when there are aliases */ + std::string GetName() const; + /** * Return the type string of the argument. * Set oneline to allow it to be overridden by a custom oneline type string (m_oneline_description). |