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);
100 unique_ptr_type release();
103 unique_ptr_type _data;
108 return document::view{
static_cast<uint8_t*
>(_data.get()), _length};
116 BSONCXX_INLINE_NAMESPACE_END
119 #include <bsoncxx/config/postlude.hpp>
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:107
A read-only, non-owning view of a BSON document.
Definition: view.hpp:33
Definition: element.hpp:24