60 Value(
const Value&) =
default;
61 Value(
Value&&)
noexcept =
default;
63 Value& operator=(
Value&&) &
noexcept =
default;
66 Value& operator=(T&&) && {
69 "You're assigning to a temporary formats::bson::Value! Use "
70 "formats::bson::ValueBuilder for data modifications."
77 explicit Value(impl::ValueImplPtr);
105 const_iterator
end()
const;
113 const_reverse_iterator
rend()
const;
129 bool operator==(
const Value&)
const;
130 bool operator!=(
const Value&)
const;
138 bool IsArray()
const;
139 bool IsDocument()
const;
142 bool IsInt32()
const;
143 bool IsInt64()
const;
144 bool IsDouble()
const;
145 bool IsString()
const;
146 bool IsDateTime()
const;
148 bool IsBinary()
const;
149 bool IsDecimal128()
const;
150 bool IsMinKey()
const;
151 bool IsMaxKey()
const;
152 bool IsTimestamp()
const;
154 bool IsObject()
const {
return IsDocument(); }
169 template <
typename T>
173 "There is no `Parse(const Value&, formats::parse::To<T>)` in namespace "
174 "of `T` or `formats::parse`. "
175 "Probably you have not provided a `Parse` function overload."
183 template <
typename T,
typename First,
typename... Rest>
184 auto As(First&& default_arg, Rest&&... more_default_args)
const {
188 return decltype(As<T>())(std::forward<First>(default_arg), std::forward<Rest>(more_default_args)...);
184 auto As(First&& default_arg, Rest&&... more_default_args)
const {
…}
196 template <
typename T>
198 return (
IsMissing() || IsNull()) ?
decltype(As<T>())() : As<T>();
203 template <
typename T>
212 "There is no `Convert(const Value&, formats::parse::To<T>)` or"
213 "`Parse(const Value&, formats::parse::To<T>)`"
214 "in namespace of `T` or `formats::parse`. "
215 "Probably you have not provided a `Convert` function overload."
222 template <
typename T,
typename First,
typename... Rest>
223 T
ConvertTo(First&& default_arg, Rest&&... more_default_args)
const {
226 return T(std::forward<First>(default_arg), std::forward<Rest>(more_default_args)...);
228 return ConvertTo<T>();
223 T
ConvertTo(First&& default_arg, Rest&&... more_default_args)
const {
…}
257 Document GetInternalArrayDocument()
const;
261 const impl::BsonHolder& GetBson()
const;
265 friend class impl::BsonBuilder;
268 friend int64_t Parse(
const Value& value,
parse::
To<int64_t>);
269 friend uint64_t Parse(
const Value& value,
parse::
To<uint64_t>);
270 friend double Parse(
const Value& value,
parse::
To<
double>);
271 friend std::string Parse(
const Value& value,
parse::
To<std::string>);
272 friend std::chrono::system_clock::time_point
273 Parse(
const Value& value,
parse::
To<std::chrono::system_clock::time_point>);
280 impl::ValueImplPtr impl_;