koutil
|
Collection of subcommands. More...
#include <subcommand.h>
Public Member Functions | |
constexpr | Commands (const Cmd &... cmd) |
constexpr std::size_t | size () const override |
Gets the number of subcommands. | |
constexpr const SubcommandBase * | find (std::string_view name) const override |
Finds a subcommand by name. | |
Public Member Functions inherited from koutil::argparser::CommandsBase | |
virtual constexpr | ~CommandsBase ()=default |
Private Types | |
using | storage_t = std::conditional_t<count != 1, std::tuple<Cmd...>, type::types_get_t<type::types<std::decay_t<Cmd>...>, 0>> |
Private Member Functions | |
constexpr bool | contains_duplicate () const |
Checks for duplicate subcommand names. | |
template<std::size_t I, std::size_t J> requires (I < count && J < count) | |
constexpr bool | contains_duplicate_impl () const |
Checks for duplicate subcommand names recursively.*. | |
template<std::size_t I, std::size_t J> requires (I >= count || J >= count) | |
constexpr bool | contains_duplicate_impl () const |
template<std::size_t I> | |
constexpr const SubcommandBase * | find_impl (std::string_view name) const |
Finds a subcommand by name recursively. | |
Private Attributes | |
storage_t | m_cmds |
Static Private Attributes | |
static constexpr std::size_t | count = sizeof...(Cmd) |
Collection of subcommands.
Cmd | Types of subcommands. |
|
private |
|
inlineconstexpr |
|
inlinenodiscardconstexprprivate |
Checks for duplicate subcommand names.
|
inlinenodiscardconstexprprivate |
Checks for duplicate subcommand names recursively.*.
I | Index of the current subcommand. |
J | Index of the subcommand to compare against. |
|
inlinenodiscardconstexprprivate |
|
inlinenodiscardconstexproverridevirtual |
Finds a subcommand by name.
name | The name of the subcommand to find. |
Implements koutil::argparser::CommandsBase.
|
inlinenodiscardconstexprprivate |
Finds a subcommand by name recursively.
I | Index of the current subcommand. |
name | The name of the subcommand to find. |
|
inlinenodiscardconstexproverridevirtual |
Gets the number of subcommands.
Implements koutil::argparser::CommandsBase.
|
staticconstexprprivate |
|
private |