20 #include <bsoncxx/array/view.hpp>
21 #include <bsoncxx/document/value.hpp>
23 #include <bsoncxx/config/prelude.hpp>
26 inline namespace v_noabi {
36 using deleter_type = void (*)(std::uint8_t*);
37 using unique_ptr_type = std::unique_ptr<uint8_t[], deleter_type>;
51 value(std::uint8_t* data, std::size_t length, deleter_type dtor);
62 value(unique_ptr_type ptr, std::size_t length);
83 BSONCXX_INLINE array::
view view() const noexcept;
90 BSONCXX_INLINE operator array::
view() const noexcept;
101 unique_ptr_type release();
104 unique_ptr_type _data;
105 std::
size_t _length{0};
109 return array::view{
static_cast<uint8_t*
>(_data.get()), _length};
120 #include <bsoncxx/config/postlude.hpp>
A read-only BSON array that owns its underlying buffer.
Definition: value.hpp:34
value(array::view view)
Constructs a value from a view of an array.
array::view view() const noexcept
Get a view over the document owned by this value.
Definition: value.hpp:108
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, non-owning view of a BSON document.
Definition: view.hpp:39
The top-level namespace for bsoncxx library entities.
Definition: element.hpp:24