|
constexpr | program_arg () noexcept=default |
| Default constructor.
|
|
auto | is_valid () const noexcept -> bool |
| Indicates if the arguments is valid.
|
|
| operator bool () const noexcept |
| Indicates if the arguments is valid. More...
|
|
auto | position () const noexcept |
| Returns the index of this argument.
|
|
auto | is_first () const noexcept -> bool |
| Indicates if this is the first command-line argument.
|
|
auto | is_last () const noexcept -> bool |
| Indicates if this is the last command-line argument.
|
|
auto | get () const noexcept -> value_type |
| Returns the value of this argument if valid, an empty string view otherwise.
|
|
auto | block () const noexcept -> memory::const_block |
| Returns the value of this argument as a const memory block.
|
|
auto | get_string () const -> std::string |
| Returns the value of this argument as a standard string.
|
|
| operator value_type () const noexcept |
| Implicit cast to value_type. More...
|
|
auto | starts_with (string_view str) const noexcept |
| Indicates if this argument value starts with the specified string. More...
|
|
auto | ends_with (string_view str) const noexcept |
| Indicates if this argument value ends with the specified string. More...
|
|
auto | is_tag (string_view tag) const noexcept |
| Indicates if this argument value is equal to the specified string.
|
|
auto | is_tag (string_view short_tag, string_view long_tag) const noexcept |
| Indicates if this argument value is one of the two specified strings.
|
|
auto | is_tag_param (const basic_program_parameter ¶m) const |
| Indicates if this argument value is equal to the one declared in param.
|
|
auto | is_help_arg () const noexcept |
| Indicates if this argument is a "show help" argument (like "--help").
|
|
auto | next () const noexcept -> program_arg |
| Returns the argument following this one. More...
|
|
auto | prev () const noexcept -> program_arg |
| Returns the argument preceding this one. More...
|
|
template<typename T , identifier_t V> |
auto | parse (T &dest, selector< V > sel, std::ostream &parse_log) const -> bool |
| Tries to parse this argument's value into dest . More...
|
|
template<typename T > |
auto | parse (T &dest, std::ostream &parse_log) const |
| Tries to parse this argument's value into dest . More...
|
|
template<typename T , identifier_t V> |
auto | parse_next (T &dest, selector< V > sel, std::ostream &parse_log) const |
| Tries to parse the following argument's value into dest . More...
|
|
template<typename T > |
auto | parse_next (T &dest, std::ostream &parse_log) const |
| Tries to parse the following argument's value into dest . More...
|
|
template<typename T > |
auto | consume_next (T &dest, std::ostream &errorlog) -> bool |
| Tries to parse the following argument's value into dest . More...
|
|
template<typename T > |
auto | parse_param (program_parameter< T > ¶m, std::ostream &errorlog) -> bool |
| Tries to parse the specified parameter starting from this argument. More...
|
|
template<typename T , typename R > |
auto | consume_next (T &dest, span< const string_view > symbols, span< const R > translations, std::ostream &errorlog) -> bool |
| Tries to parse values into starting from the following argument. More...
|
|
auto | operator== (const value_type &v) const noexcept |
| Indicates if this argument's value is equal to the specified string.
|
|
auto | operator!= (const value_type &v) const noexcept |
| Indicates if this argument's value is different than the specified string.
|
|
Class representing a single main function (command-line) argument.
- See also
- program_args
- Note
- Do not construct directly. Use program_arguments.