24.02.1
|
Implementation of an option that accepts any number of values. More...
#include <ListOption.h>
Public Member Functions | |
ListOption (std::string name, std::initializer_list< T > &&default_values) | |
Construct the option with the given default values. More... | |
bool | parse (std::string value) override |
Parses the given string. More... | |
std::string | help () const override |
Help message for the option. More... | |
const std::vector< T > & | value () const |
Get the list of option values. More... | |
Option (std::string name) | |
Constructor. More... | |
Option (std::string name, bool is_required, bool is_set) | |
Constructor. More... | |
Public Member Functions inherited from Option | |
Option (std::string name) | |
Constructor. More... | |
Option (std::string name, bool is_required, bool is_set) | |
Constructor. More... | |
virtual | ~Option ()=default |
Default destructor. More... | |
std::string | name () const |
Name of the option. More... | |
void | set_required (bool is_required) |
Set whether the option is required. More... | |
void | set_help (std::string help) |
Set the help message for the option. More... | |
bool | is_required () const |
Is the option required? More... | |
bool | is_set () const |
Has a value been assigned to the option? More... | |
Implementation of an option that accepts any number of values.
Definition at line 40 of file ListOption.h.
|
inline |
Construct the option with the given default values.
[in] | name | Name of the option. |
[in] | default_values | Default values. |
Definition at line 66 of file ListOption.h.
References Option::name().
|
inlineoverridevirtual |
Help message for the option.
Implements Option.
Definition at line 105 of file ListOption.h.
References name.
|
inline |
|
inline |
Constructor.
[in] | name | Name of the option. |
[in] | is_required | Is the option required? |
[in] | is_set | Has a value been assigned to the option? |
|
overridevirtual |
Parses the given string.
[in] | value | String representation as passed on the command line. |
Implements Option.
Definition at line 72 of file ListOption.h.
|
inline |
Get the list of option values.
Definition at line 111 of file ListOption.h.