Structure holding the argument's name.
More...
#include <argument_name.hpp>
|
const std::string | primary |
| The primary name of the argument.
|
|
const std::optional< std::string > | secondary |
| The optional (short) name of the argument.
|
|
|
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 17 of file argument_name.hpp.
◆ argument_name() [1/2]
ap::detail::argument_name::argument_name |
( |
std::string_view |
primary | ) |
|
|
inline |
Primary name constructor.
- Parameters
-
primary | The primary name of the argument. |
Definition at line 30 of file argument_name.hpp.
◆ argument_name() [2/2]
ap::detail::argument_name::argument_name |
( |
std::string_view |
primary, |
|
|
std::string_view |
secondary |
|
) |
| |
|
inline |
Primary and secondary name constructor.
- Parameters
-
primary | The primary name of the argument. |
secondary | The secondary (short) name of the argument. |
Definition at line 37 of file argument_name.hpp.
◆ match() [1/2]
bool ap::detail::argument_name::match |
( |
const argument_name & |
arg_name | ) |
const |
|
inlinenoexcept |
◆ match() [2/2]
bool ap::detail::argument_name::match |
( |
std::string_view |
arg_name | ) |
const |
|
inlinenoexcept |
Matches the given string to the argument_name instance.
- Parameters
-
arg_name | The name string to match. |
- Returns
- True if name is equal to either the primary or the secondary name of the argument_name instance.
Definition at line 63 of file argument_name.hpp.
◆ 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 48 of file argument_name.hpp.
◆ str()
std::string ap::detail::argument_name::str |
( |
const std::optional< char > |
flag_char = std::nullopt | ) |
const |
|
inlinenoexcept |
Get a string representation of the argument_name.
- Parameters
-
flag_char | The character used for the argument flag prefix. |
Definition at line 87 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 102 of file argument_name.hpp.
◆ primary
const 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: