42 using unique_ptr_type = std::unique_ptr<uint8_t[], deleter_type>;
95 template <typename T, detail::requires_not_t<
int, std::is_same<T,
array::
view>> = 0>
100 value& operator=(T
const& t) {
184 BSONCXX_PRIVATE_WARNINGS_PUSH();
185 BSONCXX_PRIVATE_WARNINGS_DISABLE(GCC(
"-Wmaybe-uninitialized"));
186 return document::view{
static_cast<uint8_t*
>(_data.get()), _length};
187 BSONCXX_PRIVATE_WARNINGS_POP();
206 template <
typename T>
209 from_bson(temp, this->
view());
222 template <
typename T>
224 from_bson(t, this->
view());
245 unique_ptr_type _data;
246 std::size_t _length{0};
261 return !(lhs == rhs);
274using ::bsoncxx::v_noabi::document::operator==;
275using ::bsoncxx::v_noabi::document::operator!=;
Provides bsoncxx::v_noabi::array::view.
#define BSONCXX_ABI_CDECL
Expands to __cdecl when built with MSVC on Windows.
Definition export.hpp:49
#define BSONCXX_ABI_EXPORT_CDECL(...)
Equivalent to BSONCXX_ABI_EXPORT with BSONCXX_ABI_CDECL.
Definition export.hpp:52
The bsoncxx v_noabi macro guard postlude header.
The bsoncxx v_noabi macro guard prelude header.
value(std::uint8_t *data, std::size_t length, deleter_type dtor)
Constructs a value from a buffer. This constructor transfers ownership of the buffer to the resulting...
A polyfill for std::string_view.
Definition string_view.hpp:411
A variant view type that accesses values in serialized BSON documents.
Definition element.hpp:46
std::uint8_t const * data() const
Access the raw bytes of the underlying document.
value(std::uint8_t *data, std::size_t length, deleter_type dtor)
Constructs a value from a buffer. This constructor transfers ownership of the buffer to the resulting...
T get()
Constructs an object of type T from this document object. This method uses argument-dependent lookup ...
Definition value.hpp:207
element operator[](stdx::string_view key) const
Finds the first element of the document with the provided key. If there is no such element,...
std::size_t length() const
Gets the length of the underlying buffer.
document::view::const_iterator begin() const
bool operator==(value const &lhs, value const &rhs)
Compares two document values for (in)-equality.
Definition value.hpp:255
document::view::const_iterator find(stdx::string_view key) const
Finds the first element of the document with the provided key. If there is no such element,...
document::view::const_iterator cbegin() const
bool empty() const
Checks if the underlying document is empty, i.e. it is equivalent to the trivial document '{}...
unique_ptr_type release()
Transfer ownership of the underlying buffer to the caller.
void get(T &t)
Constructs an object of type T from this document object. This method uses argument-dependent lookup ...
Definition value.hpp:223
document::view view() const noexcept
Get a view over the document owned by this value.
Definition value.hpp:182
document::view::const_iterator end() const
document::view::const_iterator cend() const
bool operator!=(value const &lhs, value const &rhs)
Compares two document values for (in)-equality.
Definition value.hpp:260
void reset(document::view view)
Replace the formerly-owned buffer with the new view. This will make a copy of the passed-in view.
A const iterator over the contents of a document view.
Definition view.hpp:153
A read-only, non-owning view of a BSON document.
Definition view.hpp:35
Declares bsoncxx::v_noabi::document::value.
Provides bsoncxx::v_noabi::document::view.
Declares entities representing a BSON array.
Declares entities representing a BSON document.
Declares entities whose ABI stability is NOT guaranteed.
The top-level namespace within which all bsoncxx library entities are declared.