#include <bsoncxx/v_noabi/bsoncxx/array/view.hpp>
A read-only, non-owning view of a BSON document.
Classes | |
| class | const_iterator |
| A const iterator over the contents of an array view. More... | |
Public Types | |
| using | iterator = const_iterator |
| Equivalent to const_iterator. | |
Public Member Functions | |
| view ()=default | |
| Default constructs a view. | |
| 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 resulting view is a subset of the buffer's. | |
| view (v1::array::view const &v) | |
| Construct with the bsoncxx::v1 equivalent. | |
| const_iterator | begin () const |
| const_iterator | cbegin () const |
| const_iterator | cend () const |
| std::uint8_t const * | data () const |
| Access the raw bytes of the underlying array. | |
| bool | empty () const |
| Return true when this->length() == 5. | |
| const_iterator | end () const |
| 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. As BSON represents arrays as documents, the runtime of find() is linear in the length of the array. | |
| std::size_t | length () const |
| Gets the length of the underlying buffer in bytes. | |
| operator v1::array::view () const | |
| Convert to the bsoncxx::v1 equivalent. | |
| operator v_noabi::document::view () const | |
| Conversion operator unwrapping a document::view. | |
| 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 returned. As BSON represents arrays as documents, the runtime of operator[] is linear in the length of the array. | |
| std::size_t | size () const |
| Gets the length of the underlying buffer in bytes. | |
Related Symbols | |
(Note that these are not member symbols.) | |
| bool | operator== (view lhs, view rhs) |
| Compare two views for (in)-equality. | |
| bool | operator!= (view lhs, view rhs) |
| Compare two views for (in)-equality. | |
Equivalent to const_iterator.
|
default |
|
inline |
Construct with the bsoncxx::v1 equivalent.
|
inline |
Constructs a view from a buffer. The caller is responsible for ensuring that the lifetime of the resulting view is a subset of the buffer's.
| data | A pointer to valid BSON data. |
| length | The size of the BSON data in bytes. |
|
inline |
| const_iterator bsoncxx::v_noabi::array::view::cbegin | ( | ) | const |
|
inline |
|
inline |
Access the raw bytes of the underlying array.
|
inline |
Return true when this->length() == 5.
|
inline |
| const_iterator bsoncxx::v_noabi::array::view::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. As BSON represents arrays as documents, the runtime of find() is linear in the length of the array.
| i | The index of the element. |
|
inline |
Gets the length of the underlying buffer in bytes.
|
inlineexplicit |
Convert to the bsoncxx::v1 equivalent.
|
inline |
Conversion operator unwrapping a document::view.
|
inline |
Indexes into this BSON array. If the index is out-of-bounds, the invalid array::element will be returned. As BSON represents arrays as documents, the runtime of operator[] is linear in the length of the array.
| i | The index of the element. |
|
inline |
Gets the length of the underlying buffer in bytes.