MongoDB C++ Driver mongocxx-4.0.0
Loading...
Searching...
No Matches
element.hpp
Go to the documentation of this file.
1// Copyright 2009-present MongoDB, Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#pragma once
16
17#include <cstddef>
18#include <cstdint>
19
23
25
27
28namespace bsoncxx {
29namespace v_noabi {
30namespace array {
31
39class element : private document::element {
40 public:
42
43 using document::element::operator bool;
44
46
68
70
71 using document::element::operator[];
72
78
79 private:
80 friend ::bsoncxx::v_noabi::array::view;
81
82 explicit element(const std::uint8_t* raw,
83 std::uint32_t length,
84 std::uint32_t offset,
85 std::uint32_t keylen);
86
87 explicit element(const stdx::string_view key);
88};
89
96
99
102
105
108
111
112} // namespace array
113} // namespace v_noabi
114} // namespace bsoncxx
115
116namespace bsoncxx {
117namespace array {
118
119using ::bsoncxx::v_noabi::array::operator==;
120using ::bsoncxx::v_noabi::array::operator!=;
121
122} // namespace array
123} // namespace bsoncxx
124
126
131
132#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)
133
134namespace bsoncxx {
135namespace array {
136
139
142
145
148
149} // namespace array
150} // namespace bsoncxx
151
152#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)
Declares bsoncxx::v_noabi::array::element.
Declares bsoncxx::v_noabi::array::view.
The bsoncxx macro guard postlude header.
The bsoncxx macro guard prelude header.
A variant view type that accesses values in serialized BSON arrays.
Definition element.hpp:39
bool operator!=(const types::bson_value::view &v, const element &elem)
Convenience methods to compare for equality against a bson_value.
bool operator==(const types::bson_value::view &v, const element &elem)
Convenience methods to compare for equality against a bson_value.
bool operator==(const element &elem, const types::bson_value::view &v)
Convenience methods to compare for equality against a bson_value.
bool operator!=(const element &elem, const types::bson_value::view &v)
Convenience methods to compare for equality against a bson_value.
A variant view type that accesses values in serialized BSON documents.
Definition element.hpp:46
std::uint32_t keylen() const
Getter for the element's key length.
types::b_codewscope get_codewscope() const
Getter for elements of the b_codewscope type.
types::b_code get_code() const
Getter for elements of the b_code type.
types::b_null get_null() const
Getter for elements of the b_null type.
types::b_binary get_binary() const
Getter for elements of the b_binary type.
types::b_regex get_regex() const
Getter for elements of the b_regex type.
stdx::string_view key() const
Getter for the element's key.
types::b_symbol get_symbol() const
Getter for elements of the b_symbol type.
types::b_array get_array() const
Getter for elements of the b_array type.
types::b_document get_document() const
Getter for elements of the b_document type.
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.
types::b_undefined get_undefined() const
Getter for elements of the b_undefined type.
bsoncxx::v_noabi::type type() const
Getter for the type of the element.
types::b_bool get_bool() const
Getter for elements of the b_bool type.
types::b_dbpointer get_dbpointer() const
Getter for elements of the b_dbpointer type.
types::b_oid get_oid() const
Getter for elements of the b_oid type.
types::bson_value::view get_value() const
Getter for a types::bson_value::view variant wrapper of the value portion of the element.
const std::uint8_t * raw() const
Getter for the raw bson bytes the element points to.
types::b_double get_double() const
Getter for elements of the b_double type.
types::b_date get_date() const
Getter for elements of the b_date type.
types::b_int32 get_int32() const
Getter for elements of the b_int32 type.
types::b_timestamp get_timestamp() const
Getter for elements of the b_timestamp type.
types::b_int64 get_int64() const
Getter for elements of the b_int64 type.
types::b_minkey get_minkey() const
Getter for elements of the b_minkey type.
types::b_maxkey get_maxkey() const
Getter for elements of the b_maxkey type.
types::b_string get_string() const
Getter for elements of the b_string type.
types::b_decimal128 get_decimal128() const
Getter for elements of the b_decimal128 type.
A polyfill for std::string_view.
Definition string_view.hpp:436
A view-only variant that can contain any BSON type.
Definition view.hpp:54
Provides bsoncxx::v_noabi::document::element.
#define BSONCXX_ABI_EXPORT_CDECL(...)
Equivalent to BSONCXX_ABI_EXPORT with BSONCXX_ABI_CDECL.
Definition fwd.hpp:177
bool operator==(const v_noabi::array::element &elem, const v_noabi::types::bson_value::view &v)
bsoncxx::v_noabi::array::operator==(const v_noabi::array::element& elem, const v_noabi::types::bson_v...
bool operator!=(const v_noabi::array::element &elem, const v_noabi::types::bson_value::view &v)
bsoncxx::v_noabi::array::operator!=(const v_noabi::array::element& elem, const v_noabi::types::bson_v...
The top-level namespace within which all bsoncxx library entities are declared.
Declares bsoncxx::v_noabi::types::bson_value::view.