120 std::uint8_t
const*
data()
const {
131 return _view.length();
141 return _view.empty();
158 return lhs._view == rhs._view;
162 return !(lhs == rhs);
182 using iterator_category = std::forward_iterator_tag;
183 using difference_type = std::ptrdiff_t;
185 const_iterator() =
default;
189 reference operator*() {
193 pointer operator->() {
199 const_iterator operator++(
int) {
200 const_iterator before(*
this);
211 friend bool operator==(const_iterator
const& lhs, const_iterator
const& rhs) {
212 return lhs._element.
raw() == rhs._element.
raw() && lhs._element.
offset() == rhs._element.
offset();
215 friend bool operator!=(const_iterator
const& lhs, const_iterator
const& rhs) {
216 return !(lhs == rhs);
226 return *(this->
find(i));
Provides bsoncxx::v_noabi::array::element.
#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.
A const iterator over the contents of an array view.
Definition view.hpp:174
view()=default
Default constructs a view.
A non-owning, read-only BSON array.
Definition view.hpp:49
A variant view type that accesses values in serialized BSON arrays.
Definition element.hpp:46
std::uint8_t const * raw() const
Getter for the raw bson bytes the element points to.
Definition element.hpp:90
std::uint32_t offset() const
Getter for the offset into the raw bson bytes the element points to.
Definition element.hpp:108
A const iterator over the contents of an array view.
Definition view.hpp:174
friend bool operator!=(const_iterator const &lhs, const_iterator const &rhs)
Compare two const_iterators for (in)-equality.
Definition view.hpp:215
friend bool operator==(const_iterator const &lhs, const_iterator const &rhs)
Compare two const_iterators for (in)-equality.
Definition view.hpp:211
element value_type
std::iterator_traits
Definition view.hpp:179
A read-only, non-owning view of a BSON document.
Definition view.hpp:41
bool empty() const
Return true when this->length() == 5.
Definition view.hpp:140
view()=default
Default constructs a view.
std::size_t length() const
Gets the length of the underlying buffer in bytes.
Definition view.hpp:130
const_iterator begin() const
Definition view.hpp:233
const_iterator find(std::uint32_t i) const
Indexes into this BSON array. If the index is out-of-bounds, a past-the-end iterator will be returned...
view(std::uint8_t const *data, std::size_t length)
Constructs a view from a buffer. The caller is responsible for ensuring that the lifetime of the resu...
Definition view.hpp:62
view(v1::array::view const &v)
Construct with the bsoncxx::v1 equivalent.
Definition view.hpp:59
const_iterator cend() const
Definition view.hpp:229
const_iterator iterator
Equivalent to const_iterator.
Definition view.hpp:51
friend bool operator!=(view lhs, view rhs)
Compare two views for (in)-equality.
Definition view.hpp:161
friend bool operator==(view lhs, view rhs)
Compare two views for (in)-equality.
Definition view.hpp:157
v_noabi::array::element operator[](std::uint32_t i) const
Indexes into this BSON array. If the index is out-of-bounds, the invalid array::element will be retur...
Definition view.hpp:225
const_iterator cbegin() const
std::size_t size() const
Gets the length of the underlying buffer in bytes.
Definition view.hpp:125
std::uint8_t const * data() const
Access the raw bytes of the underlying array.
Definition view.hpp:120
const_iterator end() const
Definition view.hpp:237
A read-only, non-owning view of a BSON document.
Definition view.hpp:40
Declares entities representing a BSON array.
Declares entities whose ABI stability is NOT guaranteed.
v1::element::view to_v1(v_noabi::array::element const &v)
Convert to the bsoncxx::v1 equivalent of v.
Definition element.hpp:132
v_noabi::array::value from_v1(v1::array::value const &v)
Convert from the bsoncxx::v1 equivalent of v.
Definition value.hpp:267
The top-level namespace within which all bsoncxx library entities are declared.
Provides bsoncxx::v1::array::view.
Declares bsoncxx::v_noabi::array::view.
Provides bsoncxx::v_noabi::document::view.
Declares bsoncxx::v_noabi::types::bson_value::view.