21 #include <bsoncxx/document/element.hpp>
22 #include <bsoncxx/stdx/string_view.hpp>
24 #include <bsoncxx/config/prelude.hpp>
27 inline namespace v_noabi {
53 view(
const std::uint8_t* data, std::size_t length);
109 const std::uint8_t*
data()
const;
143 const std::uint8_t* _data;
161 using iterator_category = std::forward_iterator_tag;
162 using difference_type = std::ptrdiff_t;
194 #include <bsoncxx/config/postlude.hpp>
A variant view type that accesses values in serialized BSON documents.
Definition: element.hpp:76
A const iterator over the contents of a document view.
Definition: view.hpp:153
friend bool operator!=(const const_iterator &, const const_iterator &)
Compares two const_iterators for (in)-equality.
friend bool operator==(const const_iterator &, const const_iterator &)
Compares two const_iterators for (in)-equality.
A read-only, non-owning view of a BSON document.
Definition: view.hpp:33
bool empty() const
Checks if the underlying document is empty, i.e.
const_iterator cend() const
friend bool operator==(view, view)
Compare two document views for (in)-equality.
std::size_t length() const
Gets the length of the underlying buffer.
view()
Default constructs a view.
const_iterator begin() const
const_iterator cbegin() const
const_iterator end() const
friend bool operator!=(view, view)
Compare two document views for (in)-equality.
element operator[](stdx::string_view key) const
Finds the first element of the document with the provided key.
const_iterator find(stdx::string_view key) const
Finds the first element of the document with the provided key.
const std::uint8_t * data() const
Access the raw bytes of the underlying document.
view(const std::uint8_t *data, std::size_t length)
Constructs a view from a buffer.
The top-level namespace for bsoncxx library entities.
Definition: element.hpp:24