|
CPP-AP 3.0.1
Command-line argument parser for C++20
|
Structure representing a single command-line argument token. More...
#include <argument_token.hpp>
Public Types | |
| enum class | token_type : std::uint8_t { t_value , t_flag_primary , t_flag_secondary , t_flag_compound } |
| The token type discriminator. More... | |
| using | arg_ptr_t = std::shared_ptr< detail::argument_base > |
| Argument pointer type alias. | |
| using | arg_ptr_vec_t = std::vector< arg_ptr_t > |
Public Member Functions | |
| bool | operator== (const argument_token &other) const noexcept |
| Equality operator for comparing argument_token instances. | |
| bool | is_flag_token () const noexcept |
Checks whether the type member is a flag token type. | |
| bool | is_valid_flag_token () const noexcept |
| Checks whether the token represents a valid flag. | |
Public Attributes | |
| token_type | type |
| The token's type discrimiator value. | |
| std::string | value |
| The actual token's value. | |
| arg_ptr_vec_t | args = {} |
| The corresponding argument. | |
Structure representing a single command-line argument token.
Definition at line 18 of file argument_token.hpp.
| using ap::detail::argument_token::arg_ptr_t = std::shared_ptr<detail::argument_base> |
Argument pointer type alias.
Definition at line 19 of file argument_token.hpp.
| using ap::detail::argument_token::arg_ptr_vec_t = std::vector<arg_ptr_t> |
Definition at line 20 of file argument_token.hpp.
|
strong |
The token type discriminator.
Definition at line 23 of file argument_token.hpp.
|
inlinenoexcept |
Checks whether the type member is a flag token type.
Definition at line 48 of file argument_token.hpp.
|
inlinenoexcept |
Checks whether the token represents a valid flag.
A token is considered a valid flag token if:
arg member is set.type is either t_flag_primary or t_flag_secondary, false otherwise. Definition at line 70 of file argument_token.hpp.
|
inlinenoexcept |
Equality operator for comparing argument_token instances.
| other | An argument_token instance to compare with. |
Definition at line 36 of file argument_token.hpp.
| arg_ptr_vec_t ap::detail::argument_token::args = {} |
The corresponding argument.
Definition at line 76 of file argument_token.hpp.
| token_type ap::detail::argument_token::type |
The token's type discrimiator value.
Definition at line 74 of file argument_token.hpp.
| std::string ap::detail::argument_token::value |
The actual token's value.
Definition at line 75 of file argument_token.hpp.