3#include "util/config/ValueView.hpp"
11namespace util::config {
39 std::string_view prefix,
40 std::size_t arrayIndex,
71 get(std::string_view key)
const
108 getArray(std::string_view key)
const;
117 [[nodiscard]] std::string
118 getFullKey(std::string_view key)
const;
127 startsWithKey(std::string_view key)
const;
130 std::optional<size_t> arrayIndex_;
131 std::reference_wrapper<ClioConfigDefinition const> clioConfig_;
View for array structure for config.
Definition ArrayView.hpp:23
All the config data will be stored and extracted from this class.
Definition ConfigDefinition.hpp:31
Provides a view into a subset of configuration data defined by a prefix.
Definition ObjectView.hpp:21
ObjectView getObject(std::string_view key) const
Retrieves an ObjectView in ClioConfigDefinition with key that starts with prefix_....
Definition ObjectView.cpp:49
ValueView getValueView(std::string_view key) const
Retrieves the value associated with the specified prefix._key in ClioConfigDefinition.
Definition ObjectView.cpp:39
ArrayView getArray(std::string_view key) const
Retrieves an ArrayView in ClioConfigDefinition with key that starts with prefix_.key....
Definition ObjectView.cpp:63
bool containsKey(std::string_view key) const
Checks if prefix_.key (fullkey) exists in ClioConfigDefinition.
Definition ObjectView.cpp:33
std::optional< T > maybeValue(std::string_view key) const
Returns the specified value of given string of type T if type and value exists.
Definition ObjectView.hpp:85
T get(std::string_view key) const
Returns the specified value of given string if value exists.
Definition ObjectView.hpp:71
ObjectView(std::string_view prefix, ClioConfigDefinition const &clioConfig)
Constructs an ObjectView for the specified prefix. The view must be of type object.
Definition ObjectView.cpp:18
Provides view into ConfigValues that represents values in Clio Config.
Definition ValueView.hpp:27
T getValueImpl() const
Retrieves the stored value as the specified type T.
Definition ValueView.hpp:146
std::optional< T > asOptional() const
Returns an optional value of the specified type T if valid.
Definition ValueView.hpp:177