arg_router
1.4.0
C++ command line argument parsing and routing
|
#include <arg_router/counting_flag.hpp>
Public Types | |
using | value_type = T |
template<bool Flatten> | |
using | help_data_type = typename parent_type::template default_leaf_help_data_type< Flatten > |
Public Types inherited from arg_router::tree_node< policy::multi_stage_value< T, bool >, policy::min_max_count_t< traits::integral_constant< std::size_t{0}>, traits::integral_constant< std::size_t{0}> >, std::decay_t< Policies >... > | |
using | parameters_type = std::tuple< std::decay_t< Params >... > |
using | policies_type = boost::mp11::mp_filter< policy::is_policy, parameters_type > |
using | priority_ordered_policies_type = boost::mp11::mp_sort< policies_type, priority_order > |
using | children_type = boost::mp11::mp_filter< is_tree_node, std::decay_t< decltype(list_expander(std::declval< std::decay_t< Params > >()...))> > |
using | phase_finder_t = typename phase_finder< PolicyChecker, Args... >::type |
Public Member Functions | |
constexpr | counting_flag_t (Policies... policies) noexcept |
template<typename... Parents> | |
bool | parse ([[maybe_unused]] parsing::parse_target &&target, [[maybe_unused]] const Parents &... parents) const noexcept |
Public Member Functions inherited from arg_router::tree_node< policy::multi_stage_value< T, bool >, policy::min_max_count_t< traits::integral_constant< std::size_t{0}>, traits::integral_constant< std::size_t{0}> >, std::decay_t< Policies >... > | |
children_type & | children () noexcept |
constexpr const children_type & | children () const noexcept |
Additional Inherited Members | |
Static Public Attributes inherited from arg_router::tree_node< policy::multi_stage_value< T, bool >, policy::min_max_count_t< traits::integral_constant< std::size_t{0}>, traits::integral_constant< std::size_t{0}> >, std::decay_t< Policies >... > | |
constexpr static auto | is_named |
constexpr static bool | any_phases_v |
Protected Member Functions inherited from arg_router::tree_node< policy::multi_stage_value< T, bool >, policy::min_max_count_t< traits::integral_constant< std::size_t{0}>, traits::integral_constant< std::size_t{0}> >, std::decay_t< Policies >... > | |
constexpr | tree_node (Params... params) noexcept |
std::optional< parsing::parse_target > | pre_parse (parsing::pre_parse_data< Validator, HasTarget > pre_parse_data, const Node &node, const Parents &... parents) const |
auto | parse (std::string_view token, const Node &node, const Parents &... parents) const |
Represents a flag that can appear multiple times in the command line.
A flag is a boolean indicator, it has no value assigned on the command line, its presence represents a positive boolean value. However a counting flag's value is the number of times it appears on the command line. By default this type does not do short-form name collapsing, add policy::short_form_expander to the policies during construction to enable that.
Create with the counting_flag(Policies...) function for consistency with arg_t.
T | Counting value type, must be explicitly convertible to std::size_t |
Policies | Pack of policies that define its behaviour |
Definition at line 30 of file counting_flag.hpp.
using arg_router::counting_flag_t< T, Policies >::help_data_type = typename parent_type::template default_leaf_help_data_type<Flatten> |
Help data type.
Definition at line 62 of file counting_flag.hpp.
using arg_router::counting_flag_t< T, Policies >::value_type = T |
Flag value type.
Definition at line 58 of file counting_flag.hpp.
|
inlineexplicitconstexprnoexcept |
|
inlinenoexcept |
Parse function.
Parents | Pack of parent tree nodes in ascending ancestry order |
target | Parse target |
parents | Parents instances pack |
Definition at line 93 of file counting_flag.hpp.