Structure holding the argument's name.
More...
#include <argument_name.hpp>
|
const std::optional< std::string > | primary |
| The primary name of the argument.
|
|
const std::optional< std::string > | secondary |
| The optional (short) name of the argument.
|
|
const std::optional< char > | flag_char |
| The flag character (used for optional argument names).
|
|
|
std::ostream & | operator<< (std::ostream &os, const argument_name &arg_name) noexcept |
| Stream insertion operator for argument names.
|
|
Structure holding the argument's name.
Definition at line 20 of file argument_name.hpp.
◆ match_type
Specifies the type of argument name match.
Enumerator |
---|
m_any | Matches either the primary or the secondary name.
|
m_primary | Matches only the primary name.
|
m_secondary | Matches only the secondary name.
|
Definition at line 22 of file argument_name.hpp.
◆ argument_name() [1/4]
ap::detail::argument_name::argument_name |
( |
| ) |
|
|
delete |
◆ argument_name() [2/4]
ap::detail::argument_name::argument_name |
( |
const argument_name & |
| ) |
|
|
default |
◆ argument_name() [3/4]
◆ argument_name() [4/4]
ap::detail::argument_name::argument_name |
( |
std::optional< std::string > |
primary, |
|
|
std::optional< std::string > |
secondary = std::nullopt , |
|
|
std::optional< char > |
flag_char = std::nullopt |
|
) |
| |
|
inline |
Primary and secondary name constructor.
- Parameters
-
primary | The primary name of the argument. |
secondary | The secondary (short) name of the argument. |
flag_char | The flag character (used for optional argument names). |
Definition at line 43 of file argument_name.hpp.
◆ ~argument_name()
ap::detail::argument_name::~argument_name |
( |
| ) |
|
|
default |
◆ match() [1/2]
Matches the given argument name to the argument_name instance.
- Parameters
-
arg_name | The argument_name instance to match. |
m_type | UNUSED - necessary to match the signature of the string_view overload of the match function. |
- Returns
- True if arg_name's primary or secondary value matches the argument_name instance.
Definition at line 94 of file argument_name.hpp.
◆ match() [2/2]
bool ap::detail::argument_name::match |
( |
std::string_view |
arg_name, |
|
|
const match_type |
m_type = m_any |
|
) |
| const |
|
inlinenoexcept |
Matches the given string to the argument_name instance.
- Parameters
-
arg_name | The name string to match. |
m_type | The match type used to find the argument. |
- Returns
true
if the given name matches the primary/secondary name (depending on the match type).
Definition at line 74 of file argument_name.hpp.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ operator==()
bool ap::detail::argument_name::operator== |
( |
const argument_name & |
other | ) |
const |
|
inlinenoexcept |
Equality comparison operator.
- Parameters
-
- Returns
- Equality of argument names.
Definition at line 64 of file argument_name.hpp.
◆ str()
std::string ap::detail::argument_name::str |
( |
| ) |
const |
|
inlinenoexcept |
Get a string representation of the argument_name.
- Parameters
-
flag_char | The character used for the argument flag prefix. |
Definition at line 110 of file argument_name.hpp.
◆ operator<<
std::ostream & operator<< |
( |
std::ostream & |
os, |
|
|
const argument_name & |
arg_name |
|
) |
| |
|
friend |
Stream insertion operator for argument names.
- Parameters
-
os | The output stream. |
arg_name | The argument name to be inserted into the stream. |
- Returns
- The modified output stream.
Definition at line 129 of file argument_name.hpp.
◆ flag_char
const std::optional<char> ap::detail::argument_name::flag_char |
The flag character (used for optional argument names).
Definition at line 136 of file argument_name.hpp.
◆ primary
const std::optional<std::string> ap::detail::argument_name::primary |
◆ secondary
const std::optional<std::string> ap::detail::argument_name::secondary |
The documentation for this struct was generated from the following file: