Class Options¶
Defined in File options.h
Class Documentation¶
-
class
Options
¶ Container for options stored as key-value pairs.
Keys are unique strings. This is not thread-safe and locking is the responsibility of the caller.
Public Functions
-
Options
()¶
-
Options
(const YAML::Node &node)¶
-
YAML::Node
cloneToYamlNode
() const¶
-
void
merge
(const YAML::Node &node, bool overwrite = false)¶ Splice options from a YAML node.
By default, only options with keys that do not already exist in options_ are extracted from node. These options are cloned if overwrite is true.
- Parameters
node
: a YAML node to transfer the options fromoverwrite
: overwrite all options
-
template<typename
T
, typename ...Args
>
voidset
(const std::string &key, T value, Args&&... moreArgs)¶
-
bool
hasAndNotEmpty
(const char *const key) const¶ Check if a sequence or string option is defined and nonempty.
Aborts if the option does not store a sequence or string value. Returns false if an option with the given key does not exist.
- Return
true if the option is defined and is a nonempty sequence or string
- Parameters
key
: option name
-
bool
has
(const char *const key) const¶
-