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
17namespace formats::
bson::impl {
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,
44 std::chrono::system_clock::time_point);
45 BsonBuilder& Append(std::string_view key,
const Oid&);
46 BsonBuilder& Append(std::string_view key,
const Binary&);
47 BsonBuilder& Append(std::string_view key,
const Decimal128&);
48 BsonBuilder& Append(std::string_view key,
MinKey);
49 BsonBuilder& Append(std::string_view key,
MaxKey);
50 BsonBuilder& Append(std::string_view key,
const Timestamp&);
52 BsonBuilder& Append(std::string_view key,
const Value&);
54 BsonBuilder& Append(std::string_view key,
const bson_t*);
56 const bson_t* Get()
const;
62 void AppendInto(bson_t*, std::string_view key,
const ValueImpl&);
64 static constexpr std::size_t kSize = compiler::SelectSize()
67 static constexpr std::size_t kAlignment =
alignof(
void*);
68 utils::FastPimpl<MutableBson, kSize, kAlignment, utils::kStrictMatch> bson_;