CPP-AP 2.2.6
Command-line argument parser for C++20
|
The positional argument class. More...
#include <positional.hpp>
Public Types | |
using | value_type = T |
The argument's value type. | |
Public Member Functions | |
positional (const detail::argument_name &name) | |
Constructor for positional argument with the name identifier. | |
bool | operator== (const positional &other) const noexcept |
Equality operator for positional argument. | |
positional & | help (std::string_view help_msg) noexcept |
Set the help message for the positional argument. | |
template<detail::c_range_of< value_type, detail::type_validator::convertible > CR> requires (std::equality_comparable<value_type>) | |
positional & | choices (const CR &choices) noexcept |
Set the choices for the positional argument. | |
positional & | choices (std::initializer_list< value_type > choices) noexcept |
Set the choices for the positional argument. | |
template<action::detail::c_value_action_specifier AS, std::invocable< value_type & > F> | |
positional & | action (F &&action) noexcept |
Set the action for the positional argument. | |
Friends | |
class | ::ap::argument_parser |
Friend class declaration for access by argument_parser. | |
Additional Inherited Members | |
![]() | |
argument_base (const argument_name &name) | |
const ap::detail::argument_name & | name () const noexcept |
const std::optional< std::string > & | help () const noexcept |
![]() | |
const ap::detail::argument_name | _name |
std::optional< std::string > | _help_msg |
The positional argument class.
T | The argument's value type. |
Definition at line 29 of file positional.hpp.
using ap::argument::positional< T >::value_type = T |
The argument's value type.
Definition at line 31 of file positional.hpp.
|
inline |
Constructor for positional argument with the name
identifier.
name | The name identifier of the positional argument. |
Definition at line 39 of file positional.hpp.
|
inlinenoexcept |
Set the action for the positional argument.
AS | The value action specifier type (valued_action or void_action). |
F | The type of the action function. |
action | The action function to set. |
Definition at line 99 of file positional.hpp.
|
inlinenoexcept |
Set the choices for the positional argument.
CR | The choices range type. |
choices | The range of valid choices for the argument. |
value_type
must be equality comparable. CR
must be a range such that its value type is convertible to value_type
. Definition at line 71 of file positional.hpp.
|
inlinenoexcept |
Set the choices for the positional argument.
choices | The list of valid choices for the argument. |
value_type
must be equality comparable. Definition at line 85 of file positional.hpp.
|
inlinenoexcept |
Set the help message for the positional argument.
help_msg | The help message to set. |
Definition at line 57 of file positional.hpp.
|
inlinenoexcept |
Equality operator for positional argument.
other | Another positional argument for comparison. |
Definition at line 48 of file positional.hpp.
|
friend |
Friend class declaration for access by argument_parser.
Definition at line 106 of file positional.hpp.