3#include "util/config/ConfigValue.hpp"
4#include "util/config/Error.hpp"
5#include "util/config/Types.hpp"
13namespace util::config {
40 static std::string_view
41 prefix(std::string_view key);
50 [[nodiscard]] std::optional<Error>
51 addValue(Value value, std::optional<std::string_view> key = std::nullopt);
61 [[nodiscard]] std::optional<Error>
62 addNull(std::optional<std::string_view> key = std::nullopt);
79 at(std::size_t idx)
const;
95 [[nodiscard]] std::vector<ConfigValue>::const_iterator
103 [[nodiscard]] std::vector<ConfigValue>::const_iterator
108 std::vector<ConfigValue> elements_;
119operator<<(std::ostream& stream,
Array arr)
Array definition to store multiple values provided by the user from Json/Yaml.
Definition Array.hpp:22
ConfigValue const & at(std::size_t idx) const
Returns the ConfigValue at the specified index.
Definition Array.cpp:61
ConfigValue const & getArrayPattern() const
Returns the ConfigValue that defines the type/constraint every ConfigValue must follow in Array.
Definition Array.cpp:68
std::optional< Error > addNull(std::optional< std::string_view > key=std::nullopt)
Add null value to the array.
Definition Array.cpp:41
std::optional< Error > addValue(Value value, std::optional< std::string_view > key=std::nullopt)
Add ConfigValues to Array class.
Definition Array.cpp:30
std::vector< ConfigValue >::const_iterator end() const
Returns an iterator to the end of the ConfigValue vector.
Definition Array.cpp:80
size_t size() const
Returns the number of values stored in the Array.
Definition Array.cpp:55
Array(ConfigValue arg)
Constructs an Array with provided Arg.
Definition Array.cpp:16
std::vector< ConfigValue >::const_iterator begin() const
Returns an iterator to the beginning of the ConfigValue vector.
Definition Array.cpp:74
static std::string_view prefix(std::string_view key)
Extract array prefix from a key, For example for a key foo.[].bar the method will return foo....
Definition Array.cpp:21
Represents the config values for Json/Yaml config.
Definition ConfigValue.hpp:28