MongoDB C++ Driver
mongocxx-3.6.2
|
20 #include <bsoncxx/document/view.hpp>
22 #include <bsoncxx/config/prelude.hpp>
25 BSONCXX_INLINE_NAMESPACE_BEGIN
35 using deleter_type = void (*)(std::uint8_t*);
36 using unique_ptr_type = std::unique_ptr<uint8_t[], deleter_type>;
50 value(std::uint8_t* data, std::size_t length, deleter_type dtor);
61 value(unique_ptr_type ptr, std::size_t length);
82 BSONCXX_INLINE document::
view view() const noexcept;
89 BSONCXX_INLINE operator document::
view() const noexcept;
100 unique_ptr_type release();
109 unique_ptr_type _data;
110 std::
size_t _length{0};
114 return document::view{
static_cast<uint8_t*
>(_data.get()), _length};
132 BSONCXX_INLINE
bool operator!=(
const value& lhs,
const value& rhs) {
133 return !(lhs == rhs);
141 BSONCXX_INLINE_NAMESPACE_END
144 #include <bsoncxx/config/postlude.hpp>
Top level namespace for MongoDB C++ BSON functionality.
Definition: element.hpp:24
value(unique_ptr_type ptr, std::size_t length)
Constructs a value from a std::unique_ptr to a buffer.
value(std::uint8_t *data, std::size_t length, deleter_type dtor)
Constructs a value from a buffer.
A read-only BSON document that owns its underlying buffer.
Definition: value.hpp:33
document::view view() const noexcept
Get a view over the document owned by this value.
Definition: value.hpp:113
bool operator==(const value &lhs, const value &rhs)
Compares two document values for (in)-equality.
Definition: value.hpp:128
value(document::view view)
Constructs a value from a view of a document.
A read-only, non-owning view of a BSON document.
Definition: view.hpp:33