21 #include <bsoncxx/document/element-fwd.hpp>
22 #include <bsoncxx/types/bson_value/value-fwd.hpp>
24 #include <bsoncxx/array/view_or_value.hpp>
25 #include <bsoncxx/document/view_or_value.hpp>
26 #include <bsoncxx/stdx/make_unique.hpp>
27 #include <bsoncxx/types/bson_value/view.hpp>
29 #include <bsoncxx/config/prelude.hpp>
34 namespace bson_value {
57 #define BSONCXX_ENUM(name, val) value(b_##name v);
58 #include <bsoncxx/enums/type.hpp>
179 value(stdx::string_view regex, stdx::string_view options);
259 operator bson_value::
view() const noexcept;
262 friend ::
bsoncxx::v_noabi::document::element;
264 value(const std::uint8_t* raw,
265 std::uint32_t length,
266 std::uint32_t offset,
267 std::uint32_t keylen);
270 value(
void* internal_value);
272 friend
value make_owning_bson(
void* internal_value);
274 class BSONCXX_PRIVATE impl;
275 std::unique_ptr<impl> _impl;
285 BSONCXX_INLINE
bool operator==(const
value& lhs, const
value& rhs) {
286 return (lhs.view() == rhs.view());
289 BSONCXX_INLINE
bool operator!=(
const value& lhs,
const value& rhs) {
290 return !(lhs == rhs);
305 return (lhs.
view() == rhs);
312 BSONCXX_INLINE
bool operator!=(
const value& lhs,
const view& rhs) {
313 return !(lhs == rhs);
316 BSONCXX_INLINE
bool operator!=(
const view& lhs,
const value& rhs) {
317 return !(lhs == rhs);
331 namespace bson_value {
333 using ::bsoncxx::v_noabi::types::bson_value::operator==;
334 using ::bsoncxx::v_noabi::types::bson_value::operator!=;
340 #include <bsoncxx/config/postlude.hpp>
A read-only, non-owning view of a BSON document.
Definition: view.hpp:36
Represents an IEEE 754-2008 BSON Decimal128 value in a platform-independent way.
Definition: decimal128.hpp:32
A read-only, non-owning view of a BSON document.
Definition: view.hpp:35
Represents a MongoDB ObjectId.
Definition: oid.hpp:40
A variant owning type that represents any BSON type.
Definition: value.hpp:46
value(decimal128 v)
Constructs a BSON Decimal128 value.
value(bsoncxx::v_noabi::array::view v)
Constructs a BSON array value.
value(stdx::string_view collection, oid value)
Constructs a BSON DBPointer value.
bson_value::view view() const noexcept
Get a view over the bson_value owned by this object.
value(std::vector< unsigned char > v, const binary_sub_type sub_type={})
Constructs a BSON binary data value.
value(int64_t v)
Constructs a BSON 64-bit signed integer value.
value(double v)
Constructs a BSON double value.
value(std::string v)
Constructs a BSON UTF-8 string 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 v)
Constructs a BSON UTF-8 string value.
bool operator==(const value &lhs, const value &rhs)
Compares values for (in)-equality.
Definition: value.hpp:285
value(const type id, uint64_t a, uint64_t b)
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:304
value(oid v)
Constructs a BSON ObjectId value.
value(bsoncxx::v_noabi::document::view v)
Constructs a BSON document value.
value(stdx::string_view regex, stdx::string_view options)
Constructs a BSON regex value with options.
value(std::chrono::milliseconds v)
Constructs a BSON date value.
value(bool v)
Constructs a BSON boolean value.
value(const type id, stdx::string_view v)
Constructs one of the following BSON values (each specified by the parenthesized type):
value(const type id)
Constructs one of the following BSON values (each specified by the parenthesized type):
value(stdx::string_view code, bsoncxx::v_noabi::document::view_or_value scope)
Constructs a BSON JavaScript code with scope value.
value(const char *v)
Constructs a BSON UTF-8 string value.
value(int32_t v)
Constructs a BSON 32-bit signed integer value.
value(std::nullptr_t)
Constructs a BSON null value.
A view-only variant that can contain any BSON type.
Definition: view.hpp:41
binary_sub_type
An enumeration of each BSON binary sub type.
Definition: types.hpp:68
type
An enumeration of each BSON type.
Definition: types.hpp:48
The top-level namespace for bsoncxx library entities.
Definition: element-fwd.hpp:19