22#include "util/config/ValueView.hpp"
30namespace util::config {
58 std::string_view prefix,
59 std::size_t arrayIndex,
90 get(std::string_view key)
const
102 template <
typename T>
127 getArray(std::string_view key)
const;
136 [[nodiscard]] std::string
137 getFullKey(std::string_view key)
const;
146 startsWithKey(std::string_view key)
const;
149 std::optional<size_t> arrayIndex_;
150 std::reference_wrapper<ClioConfigDefinition const> clioConfig_;
View for array structure for config.
Definition ArrayView.hpp:42
All the config data will be stored and extracted from this class.
Definition ConfigDefinition.hpp:50
Provides a view into a subset of configuration data defined by a prefix.
Definition ObjectView.hpp:40
ObjectView getObject(std::string_view key) const
Retrieves an ObjectView in ClioConfigDefinition with key that starts with prefix_....
Definition ObjectView.cpp:68
ValueView getValueView(std::string_view key) const
Retrieves the value associated with the specified prefix._key in ClioConfigDefinition.
Definition ObjectView.cpp:58
ArrayView getArray(std::string_view key) const
Retrieves an ArrayView in ClioConfigDefinition with key that starts with prefix_.key....
Definition ObjectView.cpp:82
bool containsKey(std::string_view key) const
Checks if prefix_.key (fullkey) exists in ClioConfigDefinition.
Definition ObjectView.cpp:52
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:104
T get(std::string_view key) const
Returns the specified value of given string if value exists.
Definition ObjectView.hpp:90
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:37
Provides view into ConfigValues that represents values in Clio Config.
Definition ValueView.hpp:46
T getValueImpl() const
Retrieves the stored value as the specified type T.
Definition ValueView.hpp:165
std::optional< T > asOptional() const
Returns an optional value of the specified type T if valid.
Definition ValueView.hpp:196