32class ValueBuilder
final {
35 using native_iter = YAML::iterator;
36 using value_type = formats::
yaml::ValueBuilder;
37 using reference = formats::
yaml::ValueBuilder&;
38 using pointer = formats::
yaml::ValueBuilder*;
49 ValueBuilder(
const ValueBuilder& other);
51 ValueBuilder(ValueBuilder&& other);
52 ValueBuilder& operator=(
const ValueBuilder& other);
54 ValueBuilder& operator=(ValueBuilder&& other);
56 ValueBuilder(
const formats::
yaml::Value& other);
57 ValueBuilder(formats::
yaml::Value&& other);
61 ValueBuilder(std::nullptr_t)
65 ValueBuilder(
const char* str);
66 ValueBuilder(
char* str);
67 ValueBuilder(
const std::string& str);
68 ValueBuilder(std::string_view str);
70 ValueBuilder(
unsigned int t);
72 ValueBuilder(
unsigned long t);
73 ValueBuilder(
long long t);
74 ValueBuilder(
unsigned long long t);
75 ValueBuilder(
float t);
76 ValueBuilder(
double t);
86 : ValueBuilder(DoSerialize(t))
91 ValueBuilder
operator[](
const std::string& key);
98 template <
typename Tag,
utils::StrongTypedefOps Ops>
99 requires(
utils::IsStrongTypedefLoggable(Ops))
100 ValueBuilder
operator[](
const utils::StrongTypedef<Tag, std::string, Ops>& key) {
101 return (*
this)[key.GetUnderlying()];
168 class EmplaceEnabler {};
172 ValueBuilder(EmplaceEnabler,
const YAML::Node& value,
const formats::
yaml::
Path& path,
const std::string& key);
174 ValueBuilder(EmplaceEnabler,
const YAML::Node& value,
const formats::
yaml::
Path& path, size_t index);
178 static ValueBuilder MakeNonRoot(
const YAML::Node& val,
const formats::
yaml::
Path& path,
const std::string& key);
179 static ValueBuilder MakeNonRoot(
const YAML::Node& val,
const formats::
yaml::
Path& path, size_t index);
181 void Copy(
const ValueBuilder& from);
182 void Move(ValueBuilder&& from);
183 void NodeDataAssign(
const formats::
yaml::Value& from);
185 template <
typename T>
186 USERVER_IMPL_NODEBUG_INLINE_FUNC
static Value DoSerialize(
const T& t) {
188 formats::
common::impl::HasSerialize<Value, T>,
189 "There is no `Serialize(const T&, formats::serialize::To<yaml::Value>)` "
190 "in namespace of `T` or `formats::serialize`. "
192 "Probably you forgot to include the <userver/formats/serialize/common_containers.hpp> or you "
193 "have not provided a `Serialize` function overload."
196 return Serialize(t, formats::
serialize::To<Value>());
199 formats::
yaml::Value value_;