Inherits detail::add_anonymous_error_name_to_mode::type.
|
template<auto has_none_or_error_name = add_missing_error_name_type::has_none_or_error_name> |
constexpr | mode_t (Params... params, std::enable_if_t< has_none_or_error_name > *=nullptr) noexcept |
|
template<typename Validator , bool HasTarget, typename... Parents> |
std::optional< parsing::parse_target > | pre_parse (parsing::pre_parse_data< Validator, HasTarget > pre_parse_data, const Parents &... parents) const |
|
template<typename... Parents> |
void | parse (parsing::parse_target target, const Parents &... parents) const |
|
template<typename... Params>
class arg_router::mode_t< Params >
Allows the grouping of nodes to define operational modes for a program.
If no none name policy is provided, then the node is regarded as 'anonymous', and there can only be one in the parse tree. Conversely, if any mode is named, then there can only be named modes in the parse tree.
A mode must have at least one child node.
- Template Parameters
-
Params | Policies and child node types for the mode |
Definition at line 56 of file mode.hpp.
template<typename... Params>
template<typename Validator , bool HasTarget, typename... Parents>
Mode pre-parse implementation.
Delegates the pre-parsing to any matching child modes, otherwise iterates over the tokens dispatching to any matching children until the tokens are consumed or all of the children have been matched.
- Template Parameters
-
Validator | Validator type |
HasTarget | True if pre_parse_data contains the parent's parse_target. It is a static_assert failure is this true for a mode |
Parents | Pack of parent tree nodes in ascending ancestry order |
- Parameters
-
pre_parse_data | Pre-parse data aggregate |
parents | Parent node instances |
- Returns
- Non-empty if the leading tokens in args are consumable by this node
- Exceptions
-
multi_lang_exception | Thrown if a child node cannot be found, or a delegated child pre-parse policy throws |
Definition at line 184 of file mode.hpp.