arg_router
1.4.0
C++ command line argument parsing and routing
|
#include <arg_router/flag.hpp>
Public Types | |
using | value_type = bool |
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::default_value< 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 | flag_t (Policies... policies) noexcept |
template<typename... Parents> | |
value_type | parse ([[maybe_unused]] parsing::parse_target &&target, [[maybe_unused]] const Parents &... parents) const |
Public Member Functions inherited from arg_router::tree_node< policy::default_value< 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::default_value< 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::default_value< 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 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. It has a default value of false and a fixed count of 0. 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 flag(Policies...) function for consistency with arg_t.
Policies | Pack of policies that define its behaviour |
using arg_router::flag_t< Policies >::help_data_type = typename parent_type::template default_leaf_help_data_type<Flatten> |
using arg_router::flag_t< Policies >::value_type = bool |
|
inlineexplicitconstexprnoexcept |
|
inline |
Parse function.
Parents | Pack of parent tree nodes in ascending ancestry order |
target | Parse target |
parents | Parents instances pack |
multi_lang_exception | Thrown if routing phase failed |