10#include <userver/compiler/select.hpp>
11#include <userver/formats/bson/types.hpp>
12#include <userver/formats/bson/value.hpp>
13#include <userver/utils/fast_pimpl.hpp>
15USERVER_NAMESPACE_BEGIN
24 explicit BsonBuilder(
const ValueImpl&);
27 BsonBuilder(
const BsonBuilder&);
28 BsonBuilder(BsonBuilder&&)
noexcept;
29 BsonBuilder& operator=(
const BsonBuilder&);
30 BsonBuilder& operator=(BsonBuilder&&)
noexcept;
32 BsonBuilder& Append(std::string_view key, std::nullptr_t);
33 BsonBuilder& Append(std::string_view key,
bool);
34 BsonBuilder& Append(std::string_view key,
int);
35 BsonBuilder& Append(std::string_view key,
unsigned int);
36 BsonBuilder& Append(std::string_view key,
long);
37 BsonBuilder& Append(std::string_view key,
unsigned long);
38 BsonBuilder& Append(std::string_view key,
long long);
39 BsonBuilder& Append(std::string_view key,
unsigned long long);
40 BsonBuilder& Append(std::string_view key,
double);
41 BsonBuilder& Append(std::string_view key,
const char*);
42 BsonBuilder& Append(std::string_view key, std::string_view);
43 BsonBuilder& Append(std::string_view key, std::chrono::system_clock::time_point);
44 BsonBuilder& Append(std::string_view key,
const Oid&);
45 BsonBuilder& Append(std::string_view key,
const Binary&);
46 BsonBuilder& Append(std::string_view key,
const Decimal128&);
47 BsonBuilder& Append(std::string_view key,
MinKey);
48 BsonBuilder& Append(std::string_view key,
MaxKey);
49 BsonBuilder& Append(std::string_view key,
const Timestamp&);
51 BsonBuilder& Append(std::string_view key,
const Value&);
53 BsonBuilder& Append(std::string_view key,
const bson_t*);
55 const bson_t* Get()
const;
61 void AppendInto(bson_t*, std::string_view key,
const ValueImpl&);
63 static constexpr std::size_t kSize = compiler::SelectSize()
66 static constexpr std::size_t kAlignment =
alignof(
void*);
67 utils::FastPimpl<MutableBson, kSize, kAlignment, utils::kStrictMatch> bson_;