Configuration option value. More...
#include <config.hpp>
Public Member Functions | |
| OptionValue ()=default | |
| Default constructor. More... | |
| OptionValue (std::string value_as_string) | |
| Constructs OptionValue from a string representation. More... | |
| std::any const & | get_value () const |
| Retrieves the stored value. More... | |
| std::string const & | get_value_as_string () const |
| Retrieves the string representation of the value. More... | |
| void | set_value (std::any value) |
| Sets the value if it has not been set already. More... | |
Configuration option value.
The OptionValue class encapsulates a value (of any type using std::any) and a string representation of the value.
Definition at line 40 of file config.hpp.
|
default |
Default constructor.
Constructs an empty OptionValue.
|
inline |
Constructs OptionValue from a string representation.
| value_as_string | A string representation of the value. |
Definition at line 54 of file config.hpp.
|
inline |
Retrieves the stored value.
Definition at line 62 of file config.hpp.
|
inline |
Retrieves the string representation of the value.
Is the empty string, if not string representation exist.
Definition at line 73 of file config.hpp.
|
inline |
Sets the value if it has not been set already.
| value | The new value to store. |
| std::invalid_argument | if the value is already set. |
Definition at line 84 of file config.hpp.