|
5.0.0
Freundlich's C++ toolkit
|
A flag parser.
A flag parser matches the next command-line parameter that is equal to its short name ("-f") or its long name ("--flag"). If there is such a command-line parameter, then the flag is on, otherwise it is off. The result of a flag is a record that has a single element with label Label and type Type. In case the flag is off, the result will be the flag's inactive value, otherwise it will be that flag's active value.
| Label | An fcppt::record::label. |
| Type | The type of the flag's value. |
Public Types | |
| using | active_value = fcppt::options::active_value<Type> |
| using | inactive_value = fcppt::options::inactive_value<Type> |
| using | element_type = fcppt::record::element<Label, Type> |
| using | result_type = fcppt::record::object<element_type> |
Public Member Functions | |
| flag (fcppt::options::optional_short_name &&short_name, fcppt::options::long_name &&long_name, active_value &&active, inactive_value &&inactive, fcppt::options::optional_help_text &&help_text) | |
| Constructs a flag parser. | |
| fcppt::options::parse_result< result_type > | parse (fcppt::options::state &&, fcppt::options::parse_context const &) const |
| fcppt::options::flag_name_set | flag_names () const |
| fcppt::options::option_name_set | option_names () const |
| fcppt::options::usage | usage () const |
| fcppt::options::optional_short_name const & | short_name () const |
| fcppt::options::long_name const & | long_name () const |
| fcppt::options::optional_help_text const & | help_text () const |
| using fcppt::options::flag< Label, Type >::active_value = fcppt::options::active_value<Type> |
| using fcppt::options::flag< Label, Type >::element_type = fcppt::record::element<Label, Type> |
| using fcppt::options::flag< Label, Type >::inactive_value = fcppt::options::inactive_value<Type> |
| using fcppt::options::flag< Label, Type >::result_type = fcppt::record::object<element_type> |
| fcppt::options::flag< Label, Type >::flag | ( | fcppt::options::optional_short_name && | short_name, |
| fcppt::options::long_name && | long_name, | ||
| active_value && | active, | ||
| inactive_value && | inactive, | ||
| fcppt::options::optional_help_text && | help_text ) |
Constructs a flag parser.
| short_name | An optional short name ("-f") this parser will match. |
| long_name | The long name ("--flag") this parser will match. |
| active | The value of the parser in case its flag is encountered. |
| inactive | The value of the parser in case its flag is not encountered. |
| help_text | Optional help text for this flag. |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |