21 #include <bsoncxx/document/element.hpp>
22 #include <bsoncxx/stdx/string_view.hpp>
24 #include <bsoncxx/config/prelude.hpp>
27 BSONCXX_INLINE_NAMESPACE_BEGIN
35 class BSONCXX_API iterator;
36 class BSONCXX_API const_iterator;
53 view(
const std::uint8_t* data, std::size_t length);
58 const_iterator cbegin()
const;
63 const_iterator cend()
const;
68 iterator begin()
const;
90 iterator find(stdx::string_view key)
const;
102 element operator[](stdx::string_view key)
const;
109 const std::uint8_t* data()
const;
119 std::size_t length()
const;
136 friend BSONCXX_API
bool BSONCXX_CALL operator==(view, view);
137 friend BSONCXX_API
bool BSONCXX_CALL operator!=(view, view);
143 const std::uint8_t* _data;
153 class BSONCXX_API
view::
iterator :
public std::iterator<std::forward_iterator_tag, element> {
158 reference operator*();
159 pointer operator->();
171 friend BSONCXX_API
bool BSONCXX_CALL operator==(
const iterator&,
const iterator&);
172 friend BSONCXX_API
bool BSONCXX_CALL operator!=(
const iterator&,
const iterator&);
188 :
public std::iterator<std::forward_iterator_tag, element, std::ptrdiff_t, const element*,
194 reference operator*();
195 pointer operator->();
218 BSONCXX_INLINE_NAMESPACE_END
221 #include <bsoncxx/config/postlude.hpp>
A read-only, non-owning view of a BSON document.
Definition: view.hpp:33
A const iterator over the contents of a document view.
Definition: view.hpp:187
A mutable iterator over the contents of a document view.
Definition: view.hpp:153
A variant view type that accesses values in serialized BSON documents.
Definition: element.hpp:70
Definition: element.hpp:24