Generic configuration option type. More...
Generic configuration option type.
This class template represents a single configuration option, which can be either a simple type such as bool or std::string or can be a list or dictionary.
If the option is constructed only from default value, it's is_declared
member is false, so we can deduce whether user provided the option or not.
For each option type, there has to be defined a YAML decoder and emitter.
T | The type of the configuration option |
#include <option.h>
Public Member Functions | |
option (std::string name_, option_inherit_mode im=option_inherit_mode::kOverride) | |
option (std::string name_, T initial_value, option_inherit_mode im=option_inherit_mode::kOverride) | |
option (option_with_alt_names_tag, std::string name_, std::vector< std::string > alternate_names_, option_inherit_mode im=option_inherit_mode::kOverride) | |
void | set (const T &v) |
Set the option value. | |
void | override (const option< T > &o) |
Override option value. | |
void | operator() (const T &v) |
T & | operator() () |
const T & | operator() () const |
operator bool () const | |
Public Attributes | |
std::string | name |
std::vector< std::string > | alternate_names |
T | value |
bool | is_declared {false} |
bool | has_value {false} |
option_inherit_mode | inheritance_mode |
|
inline |
|
inline |
|
inline |
Definition at line 86 of file option.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Set the option value.
v | Option value |
std::vector<std::string> clanguml::config::option< T >::alternate_names |
bool clanguml::config::option< T >::has_value {false} |
option_inherit_mode clanguml::config::option< T >::inheritance_mode |
bool clanguml::config::option< T >::is_declared {false} |
std::string clanguml::config::option< T >::name |
T clanguml::config::option< T >::value |