21 #include <bsoncxx/document/view-fwd.hpp>
23 #include <bsoncxx/document/element.hpp>
24 #include <bsoncxx/stdx/string_view.hpp>
26 #include <bsoncxx/config/prelude.hpp>
111 const std::uint8_t*
data()
const;
145 const std::uint8_t* _data;
163 using iterator_category = std::forward_iterator_tag;
164 using difference_type = std::ptrdiff_t;
196 #include <bsoncxx/config/postlude.hpp>
A variant view type that accesses values in serialized BSON documents.
Definition: element.hpp:45
A const iterator over the contents of a document view.
Definition: view.hpp:155
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:35
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-fwd.hpp:19