Base structure representing a subcommand argument.
More...
#include <arg.h>
|
constexpr bool | operator== (const Arg &other) const |
|
constexpr bool | operator< (char name) const |
|
constexpr bool | operator< (std::string_view name) const |
|
constexpr bool | operator> (char name) const |
|
constexpr bool | operator> (std::string_view name) const |
|
constexpr bool | operator== (char name) const |
|
constexpr bool | operator== (std::string_view name) const |
|
|
static constexpr Arg | option_flag (char opt, std::string_view desc) |
| Constructs an argument of type OPTION_FLAG with a short name and description.
|
|
static constexpr Arg | option_flag (std::string_view long_name, std::string_view desc) |
| Constructs an argument of type OPTION_FLAG with a long name and description.
|
|
static constexpr Arg | option_flag (char opt, std::string_view long_name, std::string_view desc) |
| Constructs an argument of type OPTION_FLAG with both short and long names and a description.
|
|
static constexpr Arg | option_value (std::string_view long_name, std::string_view desc) |
| Constructs an argument of type OPTION_VALUE with a long name and description.
|
|
|
constexpr | Arg (Type arg_type, char sname, std::string_view lname, std::string_view desc) |
|
Base structure representing a subcommand argument.
◆ Type
Enumerator |
---|
OPTION_FLAG | |
OPTION_VALUE | |
◆ Arg()
koutil::argparser::Arg::Arg |
( |
Type | arg_type, |
|
|
char | sname, |
|
|
std::string_view | lname, |
|
|
std::string_view | desc ) |
|
inlineconstexprprivate |
◆ operator<() [1/2]
bool koutil::argparser::Arg::operator< |
( |
char | name | ) |
const |
|
inlineconstexpr |
◆ operator<() [2/2]
bool koutil::argparser::Arg::operator< |
( |
std::string_view | name | ) |
const |
|
inlineconstexpr |
◆ operator==() [1/3]
bool koutil::argparser::Arg::operator== |
( |
char | name | ) |
const |
|
inlineconstexpr |
◆ operator==() [2/3]
bool koutil::argparser::Arg::operator== |
( |
const Arg & | other | ) |
const |
|
inlineconstexpr |
◆ operator==() [3/3]
bool koutil::argparser::Arg::operator== |
( |
std::string_view | name | ) |
const |
|
inlineconstexpr |
◆ operator>() [1/2]
bool koutil::argparser::Arg::operator> |
( |
char | name | ) |
const |
|
inlineconstexpr |
◆ operator>() [2/2]
bool koutil::argparser::Arg::operator> |
( |
std::string_view | name | ) |
const |
|
inlineconstexpr |
◆ option_flag() [1/3]
static constexpr Arg koutil::argparser::Arg::option_flag |
( |
char | opt, |
|
|
std::string_view | desc ) |
|
inlinestaticconstexpr |
Constructs an argument of type OPTION_FLAG with a short name and description.
- Parameters
-
opt | The short name of the argument. |
desc | The description of the argument. |
- Returns
- A constructed argument.
◆ option_flag() [2/3]
static constexpr Arg koutil::argparser::Arg::option_flag |
( |
char | opt, |
|
|
std::string_view | long_name, |
|
|
std::string_view | desc ) |
|
inlinestaticconstexpr |
Constructs an argument of type OPTION_FLAG with both short and long names and a description.
- Parameters
-
opt | The short name of the argument. |
long_name | The long name of the argument. |
desc | The description of the argument. |
- Returns
- A constructed argument.
◆ option_flag() [3/3]
static constexpr Arg koutil::argparser::Arg::option_flag |
( |
std::string_view | long_name, |
|
|
std::string_view | desc ) |
|
inlinestaticconstexpr |
Constructs an argument of type OPTION_FLAG with a long name and description.
- Parameters
-
long_name | The long name of the argument. |
desc | The description of the argument. |
- Returns
- A constructed argument.
◆ option_value()
static constexpr Arg koutil::argparser::Arg::option_value |
( |
std::string_view | long_name, |
|
|
std::string_view | desc ) |
|
inlinestaticconstexpr |
Constructs an argument of type OPTION_VALUE with a long name and description.
- Parameters
-
long_name | The long name of the argument. |
desc | The description of the argument. |
- Returns
- A constructed argument.
◆ description
const std::string_view koutil::argparser::Arg::description |
◆ long_name
const std::string_view koutil::argparser::Arg::long_name |
◆ short_name
const char koutil::argparser::Arg::short_name |
◆ type
The documentation for this struct was generated from the following file:
- include/koutil/argparser/arg.h