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 inline namespace v_noabi {
31 namespace bson_value {
54 #define BSONCXX_ENUM(name, val) value(b_##name v);
55 #include <bsoncxx/enums/type.hpp>
166 value(stdx::string_view code, bsoncxx::document::view_or_value scope);
176 value(stdx::string_view regex, stdx::string_view options);
255 operator bson_value::
view() const noexcept;
258 friend class
bsoncxx::document::element;
260 value(const std::uint8_t* raw,
261 std::uint32_t length,
262 std::uint32_t offset,
263 std::uint32_t keylen);
266 value(
void* internal_value);
268 friend
value make_owning_bson(
void* internal_value);
270 class BSONCXX_PRIVATE impl;
271 std::unique_ptr<impl> _impl;
281 BSONCXX_INLINE
bool operator==(const
value& lhs, const
value& rhs) {
282 return (lhs.view() == rhs.view());
285 BSONCXX_INLINE
bool operator!=(
const value& lhs,
const value& rhs) {
286 return !(lhs == rhs);
301 return (lhs.
view() == rhs);
304 BSONCXX_INLINE
bool operator==(
const view& lhs,
const value& rhs) {
308 BSONCXX_INLINE
bool operator!=(
const value& lhs,
const view& rhs) {
309 return !(lhs == rhs);
312 BSONCXX_INLINE
bool operator!=(
const view& lhs,
const value& rhs) {
313 return !(lhs == rhs);
326 #include <bsoncxx/config/postlude.hpp>
Represents an IEEE 754-2008 BSON Decimal128 value in a platform-independent way.
Definition: decimal128.hpp:29
Represents a MongoDB ObjectId.
Definition: oid.hpp:37
A variant owning type that represents any BSON type.
Definition: value.hpp:43
value(decimal128 v)
Constructs a BSON Decimal128 value.
value(bsoncxx::document::view v)
Constructs a BSON document value.
value(bsoncxx::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(stdx::string_view code, bsoncxx::document::view_or_value scope)
Constructs a BSON JavaScript code with scope 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.
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:300
value(oid v)
Constructs a BSON ObjectId 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(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:44
binary_sub_type
An enumeration of each BSON binary sub type.
Definition: types.hpp:70
type
An enumeration of each BSON type.
Definition: types.hpp:50
The top-level namespace for bsoncxx library entities.
Definition: element.hpp:24