20#include <bsoncxx/document/view.hpp>
22#include <bsoncxx/config/prelude.hpp>
25BSONCXX_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();
103 unique_ptr_type _data;
108 return document::view{
static_cast<uint8_t*
>(_data.get()), _length};
116BSONCXX_INLINE_NAMESPACE_END
119#include <bsoncxx/config/postlude.hpp>
A read-only BSON document that owns its underlying buffer.
Definition value.hpp:33
value(std::uint8_t *data, std::size_t length, deleter_type dtor)
Constructs a value from a buffer.
value(unique_ptr_type ptr, std::size_t length)
Constructs a value from a std::unique_ptr to a buffer.
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