39#include <system_error>
58 alignas(BSONCXX_PRIVATE_MAX_ALIGN_T) std::array<unsigned char, 32> _storage;
116#pragma push_macro("X")
118#define X(_name, _value) explicit BSONCXX_ABI_EXPORT_CDECL() value(v1::types::b_##_name v);
134#pragma pop_macro("X")
195 explicit value(std::vector<std::uint8_t>
const& v)
202 :
value{v.data(), v.size(), subtype} {}
235 explicit value(std::uint8_t
const* data, std::size_t size)
261#pragma push_macro("X")
263#define X(_name, _value) \
264 v1::types::b_##_name get_##_name() const { \
265 return this->view().get_##_name(); \
279#pragma pop_macro("X")
292 return !(lhs == rhs);
330struct std::is_error_code_enum<
bsoncxx::v1::types::value::errc> : true_type {};
Provides macros to control the set of symbols exported in the ABI.
#define BSONCXX_ABI_EXPORT_CDECL(...)
Equivalent to BSONCXX_ABI_EXPORT with BSONCXX_ABI_CDECL.
Definition export.hpp:52
The bsoncxx v1 macro guard postlude header.
The bsoncxx v1 macro guard prelude header.
A non-owning, read-only BSON array.
Definition view.hpp:49
A BSON Decimal128.
Definition decimal128.hpp:39
A non-owning, read-only BSON document.
Definition view.hpp:54
A BSON ObjectID.
Definition oid.hpp:43
A polyfill for std::string_view.
Definition string_view.hpp:412
value(std::vector< std::uint8_t > const &v, v1::types::binary_subtype subtype)
Initialize with v as a bsoncxx::v1::types::b_binary with subtype.
Definition value.hpp:201
value(std::int64_t v)
Initialize as a bsoncxx::v1::types::b_int64.
Definition value.hpp:154
v1::types::id type_id() const
Return the type of the underlying BSON type value.
value(v1::oid v)
Initialize as a bsoncxx::v1::types::b_oid.
Definition value.hpp:169
value(std::nullptr_t)
Initialize as a bsoncxx::v1::types::b_null.
Definition value.hpp:139
errc
Errors codes which may be returned by bsoncxx::v1::types::value.
Definition value.hpp:300
@ invalid_type
Requested BSON type is not supported.
Definition value.hpp:302
@ invalid_length_u32
Length is too long (exceeds UINT32_MAX).
Definition value.hpp:303
@ zero
Zero.
Definition value.hpp:301
friend bool operator==(value const &lhs, value const &rhs)
Equivalent to lhs.view() == rhs.view().
Definition value.hpp:284
value(v1::decimal128 v)
Initialize as a bsoncxx::v1::types::b_decimal128.
Definition value.hpp:174
value(bool v)
Initialize as a bsoncxx::v1::types::b_bool.
Definition value.hpp:164
value(char const *v)
Initialize as a bsoncxx::v1::types::b_string.
Definition value.hpp:224
value(v1::stdx::string_view c, v1::oid v)
Initialize as a bsoncxx::v1::types::b_dbpointer.
Definition value.hpp:207
value(v1::stdx::string_view regex, v1::stdx::string_view options)
Initialize as a bsoncxx::v1::types::b_regex.
Definition value.hpp:218
value(v1::document::view v)
Initialize as a bsoncxx::v1::types::b_document.
Definition value.hpp:184
v1::types::view view() const
Return a view of the underlying BSON type value.
value(double v)
Initialize as a bsoncxx::v1::types::b_double.
Definition value.hpp:159
value(std::int32_t v)
Initialize as a bsoncxx::v1::types::b_int32.
Definition value.hpp:149
value(v1::stdx::string_view code, v1::document::view scope)
Initialize as a bsoncxx::v1::types::b_codewscope.
Definition value.hpp:212
friend std::error_code make_error_code(errc v)
Support implicit conversion to std::error_code.
Definition value.hpp:318
value(value &&other) noexcept
Move construction.
value(v1::stdx::string_view v)
Initialize as a bsoncxx::v1::types::b_string.
Definition value.hpp:144
value(std::uint8_t const *data, std::size_t size)
Initialize as a bsoncxx::v1::types::b_binary with bsoncxx::v1::types::binary_subtype::k_binary.
Definition value.hpp:235
value(std::string const &v)
Initialize as a bsoncxx::v1::types::b_string.
Definition value.hpp:229
value(std::chrono::milliseconds v)
Initialize as a bsoncxx::v1::types::b_date.
Definition value.hpp:179
static std::error_category const & error_category()
The error category for bsoncxx::v1::types::value::errc.
friend bool operator!=(value const &lhs, value const &rhs)
Equivalent to !(lhs == rhs).
Definition value.hpp:291
~value()
Destroy this object.
value(std::vector< std::uint8_t > const &v)
Initialize as a bsoncxx::v1::types::b_binary with bsoncxx::v1::types::binary_subtype::k_binary.
Definition value.hpp:195
value(v1::array::view v)
Initialize as a bsoncxx::v1::types::b_array.
Definition value.hpp:189
Declares C++17 standard library polyfills.
Declares entities representing a BSON type value.
binary_subtype
Enumeration identifying a BSON binary subtype.
Definition id.hpp:77
@ k_binary
Binary data.
Definition id.hpp:45
Declares entities whose ABI stability is guaranteed for documented symbols.
The top-level namespace within which all bsoncxx library entities are declared.
BSON type value "Array".
Definition view.hpp:201
BSON type value "Boolean".
Definition view.hpp:392
BSON type value "JavaScript Code With Scope".
Definition view.hpp:724
BSON type value "UTC Datetime".
Definition view.hpp:440
BSON type value "DBPointer".
Definition view.hpp:578
BSON type value "Decimal128".
Definition view.hpp:912
BSON type value "Embedded Document".
Definition view.hpp:149
BSON type value "64-bit Binary Floating Point".
Definition view.hpp:50
BSON type value "32-bit Integer".
Definition view.hpp:770
BSON type value "64-bit Integer".
Definition view.hpp:864
BSON type value "Null Value".
Definition view.hpp:499
BSON type value "ObjectID".
Definition view.hpp:344
BSON type value "Regular Expression".
Definition view.hpp:525
BSON type value "UTF-8 String".
Definition view.hpp:101
Declares bsoncxx::v1::array::view.
Declares bsoncxx::v1::decimal128.
Declares bsoncxx::v1::document::view.
Declares bsoncxx::v1::oid.
Provides std::string_view-related polyfills for library API usage.
Declares enumerations identifying the type of a BSON element.
#define BSONCXX_V1_TYPES_XMACRO(X)
X-macro over the name and value of BSON types.
Definition id-fwd.hpp:44
Declares bsoncxx::v1::types::value.
Provides non-owning, read-only entities representing a BSON type value.