arg_router  1.4.0
C++ command line argument parsing and routing
arg_router::policy::min_max_count_t< MinType, MaxType > Class Template Reference

#include <arg_router/policy/min_max_count.hpp>

Public Member Functions

template<typename ProcessedTarget , typename... Parents>
parsing::pre_parse_result pre_parse_phase (parsing::dynamic_token_adapter &tokens, [[maybe_unused]] utility::compile_time_optional< ProcessedTarget > processed_target, [[maybe_unused]] parsing::parse_target &target, [[maybe_unused]] const Parents &... parents) const
 

Static Public Member Functions

constexpr static std::size_t minimum_count () noexcept
 
constexpr static std::size_t maximum_count () noexcept
 

Static Public Attributes

constexpr static auto priority = std::size_t{750}
 

Detailed Description

template<typename MinType, typename MaxType>
class arg_router::policy::min_max_count_t< MinType, MaxType >

Exposes the number of tokens the owning node will consume.

It also checks that there are enough pending tokens available to reach the minimum in the pre-parse phase.

Template Parameters
MinTypeCompile-time integral constant value representing the minimum
MaxTypeCompile-time integral constant value representing the maximum

Definition at line 27 of file min_max_count.hpp.

Member Function Documentation

◆ maximum_count()

template<typename MinType , typename MaxType >
constexpr static std::size_t arg_router::policy::min_max_count_t< MinType, MaxType >::maximum_count ( )
inlinestaticconstexprnoexcept
Returns
Maximum count value.

Definition at line 51 of file min_max_count.hpp.

◆ minimum_count()

template<typename MinType , typename MaxType >
constexpr static std::size_t arg_router::policy::min_max_count_t< MinType, MaxType >::minimum_count ( )
inlinestaticconstexprnoexcept
Returns
Minimum count value.

Definition at line 48 of file min_max_count.hpp.

◆ pre_parse_phase()

template<typename MinType , typename MaxType >
template<typename ProcessedTarget , typename... Parents>
parsing::pre_parse_result arg_router::policy::min_max_count_t< MinType, MaxType >::pre_parse_phase ( parsing::dynamic_token_adapter tokens,
[[maybe_unused] ] utility::compile_time_optional< ProcessedTarget >  processed_target,
[[maybe_unused] ] parsing::parse_target target,
[[maybe_unused] ] const Parents &...  parents 
) const
inline

Copies an appropriate amount of tokens from args to result.

This policy performs label and bulk value token processing. If the owning node is named, then the first token is expected to match, if not then false is returned immediately.

Then up to maximum_count()

Returns
the
  • tokens are processed. If the maximum available is less than minimum_count(), a parse error will occur.
Template Parameters
ProcessedTargetprocessed_target payload type
ParentsPack of parent tree nodes in ascending ancestry order
Parameters
tokensCurrently processed tokens
processed_targetPreviously processed parse_target of parent node, or empty is there is no non-root parent
targetPre-parse generated target
parentsParent node instances
Returns
Either true if successful, or a multi_lang_exception if the minimum count is not reached

Definition at line 72 of file min_max_count.hpp.

Member Data Documentation

◆ priority

template<typename MinType , typename MaxType >
constexpr static auto arg_router::policy::min_max_count_t< MinType, MaxType >::priority = std::size_t{750}
staticconstexpr

Policy priority.

Definition at line 45 of file min_max_count.hpp.


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