207 T
ConvertTo(First&& default_arg, Rest&&... more_default_args)
const;
256 struct EmplaceEnabler {
257 explicit EmplaceEnabler() =
default;
260 class LazyDetachedPath;
266 const impl::VersionedValuePtr& root,
267 const impl::Value* root_ptr_for_path,
268 const impl::Value* value_ptr,
274 const impl::VersionedValuePtr& root,
275 impl::Value* root_ptr_for_path,
276 LazyDetachedPath&& lazy_detached_path
281 explicit Value(impl::VersionedValuePtr root)
noexcept;
283 bool IsUniqueReference()
const;
284 void EnsureNotMissing()
const;
285 const impl::Value& GetNative()
const;
286 impl::Value& GetNative();
287 void SetNative(impl::Value&);
288 int GetExtendedType()
const;
290 impl::VersionedValuePtr holder_{};
291 impl::Value* root_ptr_for_path_{
nullptr};
292 impl::Value* value_ptr_{
nullptr};
301 class LazyDetachedPath
final {
303 LazyDetachedPath()
noexcept;
304 LazyDetachedPath(impl::Value* parent_value_ptr,
int parent_depth, std::string_view key);
306 LazyDetachedPath(
const LazyDetachedPath&);
307 LazyDetachedPath(LazyDetachedPath&&)
noexcept;
308 LazyDetachedPath& operator=(
const LazyDetachedPath&);
309 LazyDetachedPath& operator=(LazyDetachedPath&&)
noexcept;
311 std::string Get(
const impl::Value* root)
const;
312 LazyDetachedPath Chain(std::string_view key)
const;
315 impl::Value* parent_value_ptr_{
nullptr};
316 int parent_depth_{0};
317 std::string virtual_path_{};
320 LazyDetachedPath lazy_detached_path_;
323 friend class Iterator;
324 friend class ValueBuilder;
325 friend class StringBuilder;
327 friend class impl::InlineObjectBuilder;
328 friend class impl::InlineArrayBuilder;
329 friend class impl::MutableValueWrapper;
330 friend class parser::JsonValueParser;
331 friend class impl::StringBuffer;
334 friend std::int64_t Parse(
const Value& value,
parse::
To<std::int64_t>);
335 friend std::uint64_t Parse(
const Value& value,
parse::
To<std::uint64_t>);
336 friend double Parse(
const Value& value,
parse::
To<
double>);
337 friend std::string Parse(
const Value& value,
parse::
To<std::string>);
353 "There is no `Parse(const Value&, formats::parse::To<T>)` "
354 "in namespace of `T` or `formats::parse`. "
355 "Probably you forgot to include the "
356 "<userver/formats/parse/common_containers.hpp> or you "
357 "have not provided a `Parse` function overload."
365std::int64_t Parse(
const Value& value,
parse::
To<std::int64_t>);
367std::uint64_t Parse(
const Value& value,
parse::
To<std::uint64_t>);
371std::string Parse(
const Value& value,
parse::
To<std::string>);
388template <
typename T,
typename First,
typename... Rest>
389auto Value::
As(First&& default_arg, Rest&&... more_default_args)
const {
393 return decltype(As<T>())(std::forward<First>(default_arg), std::forward<Rest>(more_default_args)...);
412 "There is no `Convert(const Value&, formats::parse::To<T>)` or"
413 "`Parse(const Value&, formats::parse::To<T>)`"
414 "in namespace of `T` or `formats::parse`. "
415 "Probably you have not provided a `Convert` function overload."
420template <
typename T,
typename First,
typename... Rest>
424 return T(std::forward<First>(default_arg), std::forward<Rest>(more_default_args)...);
426 return ConvertTo<T>();