CPP-AP 2.7.0
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_flag_primary , t_flag_secondary , t_value } |
The token type discriminator. More... | |
using | arg_ptr_opt_t = uptr_opt_t< detail::argument_base > |
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_opt_t | arg = std::nullopt |
The corresponding argument. | |
Structure representing a single command-line argument token.
Definition at line 20 of file argument_token.hpp.
Definition at line 21 of file argument_token.hpp.
|
strong |
The token type discriminator.
Enumerator | |
---|---|
t_flag_primary | Represents the primary (–) flag argument. |
t_flag_secondary | Represents the secondary (-) flag argument. |
t_value | Represents a value argument. |
Definition at line 24 of file argument_token.hpp.
|
inlinenoexcept |
Checks whether the type
member is a flag token type.
type
is either t_flag_primary
or t_flag_secondary
, false otherwise. Definition at line 44 of file argument_token.hpp.
|
inlinenoexcept |
Checks whether the token represents a valid flag.
A token is considered a valid flag token if:
t_flag_primary
or t_flag_secondary
)arg
member is set.type
is either t_flag_primary
or t_flag_secondary
, false otherwise. Definition at line 57 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_opt_t ap::detail::argument_token::arg = std::nullopt |
The corresponding argument.
Definition at line 63 of file argument_token.hpp.
token_type ap::detail::argument_token::type |
The token's type discrimiator value.
Definition at line 61 of file argument_token.hpp.
std::string ap::detail::argument_token::value |
The actual token's value.
Definition at line 62 of file argument_token.hpp.