#include <bsoncxx/v_noabi/bsoncxx/array/element.hpp>
A variant view type that accesses values in serialized BSON arrays.
Element functions as a variant type, where the kind of the element can be interrogated by calling type() and a specific value can be extracted through get_X() accessors.
Public Member Functions | |
| v_noabi::types::b_minkey | get_minkey () const |
| Return the BSON type value of this element. | |
| v_noabi::types::bson_value::value | get_owning_value () const |
| Getter for a types::bson_value::value variant wrapper of the value portion of the element. The returned object will make a copy of the buffer from this object. | |
| v_noabi::types::bson_value::view | get_value () const |
| Getter for a types::bson_value::view variant wrapper of the value portion of the element. | |
| v1::stdx::string_view | key () const |
| Getter for the element's key. | |
| std::uint32_t | keylen () const |
| Getter for the element's key length. | |
| std::uint32_t | length () const |
| Getter for length of the raw bson bytes the element points to. | |
| std::uint32_t | offset () const |
| Getter for the offset into the raw bson bytes the element points to. | |
| operator bool () const | |
| Conversion operator to bool which is true for valid elements and false for invalid elements. | |
| v_noabi::array::element | operator[] (std::uint32_t i) const |
| If this element is an array, indexes into this BSON array. If the index is out-of-bounds, an invalid array::element will be returned. As BSON represents arrays as documents, the runtime of operator[] is linear in the length of the array. | |
| element | operator[] (v1::stdx::string_view key) const |
| If this element is a document, finds the first element of the document with the provided key. If there is no such element, an invalid document::element will be returned. The runtime of operator[] is linear in the length of the document. | |
| std::uint8_t const * | raw () const |
| Getter for the raw bson bytes the element points to. | |
| v_noabi::type | type () const |
| Getter for the type of the element. | |
| v_noabi::types::bson_value::value | type_value () const |
| Equivalent to get_owning_value() const. | |
| v_noabi::types::bson_value::view | type_view () const |
| Equivalent to get_value() const. | |
Friends | |
| bool | operator== (element const &lhs, v_noabi::types::bson_value::view const &rhs) |
| Convenience methods to compare for equality against a bson_value. | |
Related Symbols | |
(Note that these are not member symbols.) | |
| bool | operator== (element const &lhs, v_noabi::types::bson_value::view const &rhs) |
| Convenience methods to compare for equality against a bson_value. | |
| bool | operator== (v_noabi::types::bson_value::view const &lhs, element const &rhs) |
| Convenience methods to compare for equality against a bson_value. | |
| bool | operator!= (element const &lhs, v_noabi::types::bson_value::view const &rhs) |
| Convenience methods to compare for equality against a bson_value. | |
| bool | operator!= (v_noabi::types::bson_value::view const &lhs, element const &rhs) |
| Convenience methods to compare for equality against a bson_value. | |
| Related Symbols inherited from bsoncxx::v_noabi::document::element | |
| bool | operator== (element const &lhs, v_noabi::types::bson_value::view const &rhs) |
| Convenience methods to compare for equality against a bson_value. | |
| bool | operator== (v_noabi::types::bson_value::view const &lhs, element const &rhs) |
| Convenience methods to compare for equality against a bson_value. | |
| bool | operator!= (element const &lhs, v_noabi::types::bson_value::view const &rhs) |
| Convenience methods to compare for equality against a bson_value. | |
| bool | operator!= (v_noabi::types::bson_value::view const &lhs, element const &rhs) |
| Convenience methods to compare for equality against a bson_value. | |
Return the BSON type value of this element.
| bsoncxx::v_noabi::exception | if this element is not the requested type. |
Getter for a types::bson_value::value variant wrapper of the value portion of the element. The returned object will make a copy of the buffer from this object.
Getter for a types::bson_value::view variant wrapper of the value portion of the element.
Getter for the element's key.
| bsoncxx::v_noabi::exception | if this element is invalid. |
|
inline |
Getter for the element's key length.
|
inline |
Getter for length of the raw bson bytes the element points to.
|
inline |
Getter for the offset into the raw bson bytes the element points to.
|
inlineexplicit |
Conversion operator to bool which is true for valid elements and false for invalid elements.
| v_noabi::array::element bsoncxx::v_noabi::document::element::operator[] | ( | std::uint32_t | i | ) | const |
If this element is an array, indexes into this BSON array. If the index is out-of-bounds, an invalid array::element will be returned. As BSON represents arrays as documents, the runtime of operator[] is linear in the length of the array.
If this element is not an array, an invalid array::element will be returned.
| i | The index of the element. |
| element bsoncxx::v_noabi::document::element::operator[] | ( | v1::stdx::string_view | key | ) | const |
If this element is a document, finds the first element of the document with the provided key. If there is no such element, an invalid document::element will be returned. The runtime of operator[] is linear in the length of the document.
If this element is not a document, an invalid document::element will be returned.
| key | The key to search for. |
|
inline |
Getter for the raw bson bytes the element points to.
Getter for the type of the element.
| bsoncxx::v_noabi::exception | if this element is invalid. |
Equivalent to get_owning_value() const.
To support incremental migration to bsoncxx::v1::element::view::type_value() const.
Equivalent to get_value() const.
To support incremental migration to bsoncxx::v1::element::view::type_view() const.
|
Convenience methods to compare for equality against a bson_value.
Compares equal if this element contains a matching bson_value. Otherwise, compares unequal.
|
Convenience methods to compare for equality against a bson_value.
Compares equal if this element contains a matching bson_value. Otherwise, compares unequal.
|
Convenience methods to compare for equality against a bson_value.
Compares equal if this element contains a matching bson_value. Otherwise, compares unequal.
|
friend |
Convenience methods to compare for equality against a bson_value.
Compares equal if this element contains a matching bson_value. Otherwise, compares unequal.
|
Convenience methods to compare for equality against a bson_value.
Compares equal if this element contains a matching bson_value. Otherwise, compares unequal.