23.11
|
Implementation of an option that can be either true or false. More...
#include <ToggleOption.h>
Public Member Functions | |
ToggleOption (std::string name, bool default_value) | |
Construct the option with the given default value. More... | |
bool | parse (std::string value) override |
Parses the given string. More... | |
std::string | help () const override |
Help message for the option. More... | |
SimpleOption (std::string name, T default_value) | |
Construct the option with the given default value. More... | |
![]() | |
SimpleOption (std::string name, bool default_value) | |
Construct the option with the given default value. More... | |
bool | parse (std::string value) override |
Parses the given string. More... | |
bool | parse (std::string value) |
Parses the given string. More... | |
std::string | help () const override |
Help message for the option. More... | |
const bool & | value () const |
Get the option value. More... | |
Option (std::string name) | |
Constructor. More... | |
Option (std::string name, bool is_required, bool is_set) | |
Constructor. More... | |
![]() | |
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 can be either true or false.
Definition at line 35 of file ToggleOption.h.
|
inline |
Construct the option with the given default value.
[in] | name | Name of the option. |
[in] | default_value | Default value. |
Definition at line 51 of file ToggleOption.h.
References Option::name().
|
inlineoverridevirtual |
Help message for the option.
Implements Option.
Definition at line 72 of file ToggleOption.h.
References Option::name().
|
inlineoverridevirtual |
Parses the given string.
[in] | value | String representation as passed on the command line. |
Implements Option.
Definition at line 56 of file ToggleOption.h.
References SimpleOption< bool >::value().
|
inline |
Construct the option with the given default value.
[in] | name | Name of the option. |
[in] | default_value | Default value. |
Definition at line 75 of file SimpleOption.h.