12#include <userver/formats/parse/common.hpp>
13#include <userver/formats/parse/common_containers.hpp>
14#include <userver/formats/yaml/value.hpp>
16#include <userver/yaml_config/iterator.hpp>
18USERVER_NAMESPACE_BEGIN
78 YamlConfig() =
default;
154 template <
typename T>
160 template <
typename T,
typename First,
typename... Rest>
161 T
As(First&& default_arg, Rest&&... more_default_args)
const;
166 template <
typename T>
184 const_iterator
end()
const;
187 formats::
yaml::Value yaml_;
188 formats::
yaml::Value config_vars_;
195 "There is no `Parse(const formats::yaml_config::YamlConfig&, "
196 "formats::parse::To<T>)`"
197 "in namespace of `T` or `formats::parse`. "
198 "Probably you forgot to include the "
199 "<userver/formats/parse/common_containers.hpp> or you "
200 "have not provided a `Parse` function overload.");
202 return Parse(*
this, formats::
parse::
To<T>{});
218std::string
YamlConfig::As<std::string>()
const;
220template <
typename T,
typename First,
typename... Rest>
221T
YamlConfig::
As(First&& default_arg, Rest&&... more_default_args)
const {
225 return T(std::forward<First>(default_arg),
226 std::forward<Rest>(more_default_args)...);
241using formats::
common::Items;
247 formats::
parse::
To<std::chrono::seconds>);
252 formats::
parse::
To<std::chrono::milliseconds>);