arg_router  1.4.0
C++ command line argument parsing and routing
arg_router::multi_arg_base_t< T, MinCount, Policies > Class Template Reference

#include <arg_router/multi_arg_base.hpp>

Inherits add_missing_min_max_policy::type.

Protected Types

using value_type = T
 
template<bool Flatten>
using help_data_type = typename parent_type::template default_leaf_help_data_type< Flatten >
 

Protected Member Functions

template<auto has_min_max = add_missing_min_max_policy<MinCount, Policies...>::has_min_max>
constexpr multi_arg_base_t (Policies... policies, std::enable_if_t< has_min_max > *=nullptr) noexcept
 
template<typename... Parents>
value_type parse (parsing::parse_target target, const Parents &... parents) const
 

Detailed Description

template<typename T, std::size_t MinCount, typename... Policies>
class arg_router::multi_arg_base_t< T, MinCount, Policies >

Base class for nodes that support multiple value tokens.

If no policy implementing minimum_count() and maximum_count() methods is used (e.g. policy::min_max_count_t), then an unbounded policy::min_max_count_t is prepended to the policies internally.

This is the base class for arg_t, multi_arg_t, and postional_arg_t.

Note
Only supports nodes with a minimum of 1 value token (i.e. is not used for flag-like types)
Template Parameters
TArgument value type
MinCountMinimum count value to use if one not specified by user
PoliciesPack of policies that define its behaviour

Definition at line 25 of file multi_arg_base.hpp.

Member Typedef Documentation

◆ help_data_type

template<typename T , std::size_t MinCount, typename... Policies>
template<bool Flatten>
using arg_router::multi_arg_base_t< T, MinCount, Policies >::help_data_type = typename parent_type::template default_leaf_help_data_type<Flatten>
protected

Help data type.

Definition at line 55 of file multi_arg_base.hpp.

◆ value_type

template<typename T , std::size_t MinCount, typename... Policies>
using arg_router::multi_arg_base_t< T, MinCount, Policies >::value_type = T
protected

Argument value type.

Definition at line 51 of file multi_arg_base.hpp.

Constructor & Destructor Documentation

◆ multi_arg_base_t()

template<typename T , std::size_t MinCount, typename... Policies>
template<auto has_min_max = add_missing_min_max_policy<MinCount, Policies...>::has_min_max>
constexpr arg_router::multi_arg_base_t< T, MinCount, Policies >::multi_arg_base_t ( Policies...  policies,
std::enable_if_t< has_min_max > *  = nullptr 
)
inlineexplicitconstexprprotectednoexcept

Constructor.

Parameters
policiesPolicy instances

Definition at line 62 of file multi_arg_base.hpp.

Member Function Documentation

◆ parse()

template<typename T , std::size_t MinCount, typename... Policies>
template<typename... Parents>
value_type arg_router::multi_arg_base_t< T, MinCount, Policies >::parse ( parsing::parse_target  target,
const Parents &...  parents 
) const
inlineprotected

Parse function.

Template Parameters
ParentsPack of parent tree nodes in ascending ancestry order
Parameters
targetParse target
parentsParents instances pack
Returns
Parsed result, note that if a routing policy is present then the result is moved into that so this value is the moved-from result
Exceptions
multi_lang_exceptionThrown if parsing failed

Definition at line 98 of file multi_arg_base.hpp.


The documentation for this class was generated from the following file: