21 #include <bsoncxx/array/view_or_value.hpp>
22 #include <bsoncxx/document/view_or_value.hpp>
23 #include <bsoncxx/stdx/make_unique.hpp>
24 #include <bsoncxx/types/bson_value/view.hpp>
26 #include <bsoncxx/config/prelude.hpp>
29 BSONCXX_INLINE_NAMESPACE_BEGIN
32 namespace bson_value {
55 #define BSONCXX_ENUM(name, val) value(b_##name v);
56 #include <bsoncxx/enums/type.hpp>
177 value(stdx::string_view regex, stdx::string_view options);
256 operator bson_value::
view() const noexcept;
259 friend class
bsoncxx::document::element;
261 value(const std::uint8_t* raw,
262 std::uint32_t length,
263 std::uint32_t offset,
264 std::uint32_t keylen);
267 value(
void* internal_value);
269 friend
value make_owning_bson(
void* internal_value);
271 class BSONCXX_PRIVATE impl;
272 std::unique_ptr<impl> _impl;
282 BSONCXX_INLINE
bool operator==(const
value& lhs, const
value& rhs) {
283 return (lhs.view() == rhs.view());
286 BSONCXX_INLINE
bool operator!=(
const value& lhs,
const value& rhs) {
287 return !(lhs == rhs);
302 return (lhs.
view() == rhs);
305 BSONCXX_INLINE
bool operator==(
const view& lhs,
const value& rhs) {
309 BSONCXX_INLINE
bool operator!=(
const value& lhs,
const view& rhs) {
310 return !(lhs == rhs);
313 BSONCXX_INLINE
bool operator!=(
const view& lhs,
const value& rhs) {
314 return !(lhs == rhs);
324 BSONCXX_INLINE_NAMESPACE_END
327 #include <bsoncxx/config/postlude.hpp>
A read-only, non-owning view of a BSON document.
Definition: view.hpp:40
Represents an IEEE 754-2008 BSON Decimal128 value in a platform-independent way.
Definition: decimal128.hpp:30
A read-only, non-owning view of a BSON document.
Definition: view.hpp:33
Represents a MongoDB ObjectId.
Definition: oid.hpp:38
A variant owning type that represents any BSON type.
Definition: value.hpp:44
value(const char *v)
Constructs a BSON UTF-8 string value.
value(decimal128 v)
Constructs a BSON Decimal128 value.
value(const type id)
Constructs one of the following BSON values (each specified by the parenthesized type):
value(const type id, uint64_t a, uint64_t b)
Constructs one of the following BSON values (each specified by the parenthesized type):
value(stdx::string_view code, bsoncxx::document::view_or_value scope)
Constructs a BSON JavaScript code with scope value.
value(std::nullptr_t)
Constructs a BSON null value.
value(int64_t v)
Constructs a BSON 64-bit signed integer value.
value(bsoncxx::array::view v)
Constructs a BSON array value.
value(const uint8_t *data, size_t size, const binary_sub_type sub_type={})
Constructs a BSON binary data value.
value(stdx::string_view collection, oid value)
Constructs a BSON DBPointer value.
value(std::vector< unsigned char > v, const binary_sub_type sub_type={})
Constructs a BSON binary data value.
value(bool v)
Constructs a BSON boolean value.
value(int32_t v)
Constructs a BSON 32-bit signed integer value.
value(double v)
Constructs a BSON double value.
value(bsoncxx::document::view v)
Constructs a BSON document value.
value(const type id, stdx::string_view v)
Constructs one of the following BSON values (each specified by the parenthesized type):
bool operator==(const value &lhs, const view &rhs)
Compares a value with a view for (in)-equality.
Definition: value.hpp:301
bson_value::view view() const noexcept
Get a view over the bson_value owned by this object.
value(stdx::string_view regex, stdx::string_view options)
Constructs a BSON regex value with options.
value(stdx::string_view v)
Constructs a BSON UTF-8 string value.
value(std::string v)
Constructs a BSON UTF-8 string value.
value(std::chrono::milliseconds v)
Constructs a BSON date value.
value(oid v)
Constructs a BSON ObjectId value.
A view-only variant that can contain any BSON type.
Definition: view.hpp:44
Top level namespace for MongoDB C++ BSON functionality.
Definition: element.hpp:24
type
An enumeration of each BSON type.
Definition: types.hpp:46
binary_sub_type
An enumeration of each BSON binary sub type.
Definition: types.hpp:66