32BSONCXX_PUSH_WARNINGS();
33BSONCXX_DISABLE_WARNING(GNU(
"-Wfloat-equal"));
43enum class type : std::uint8_t {
119 operator double()
const {
130 return lhs.value == rhs.value;
145 template <
typename T, detail::requires_not_t<
int, detail::is_alike<b_
string, T>> = 0>
164 return lhs.value == rhs.value;
203 return lhs.value == rhs.value;
228 return lhs.value == rhs.value;
239 const uint8_t* bytes;
248 return lhs.sub_type == rhs.sub_type && lhs.size == rhs.size &&
249 (!lhs.size || (std::memcmp(lhs.bytes, rhs.bytes, lhs.size) == 0));
285 return lhs.value == rhs.value;
299 operator bool()
const {
310 return lhs.value == rhs.value;
333 explicit b_date(
const std::chrono::system_clock::time_point& tp)
334 : value(
std::chrono::duration_cast<
std::chrono::milliseconds>(tp.time_since_epoch())) {}
336 std::chrono::milliseconds value;
341 operator int64_t()
const {
342 return value.count();
349 return value.count();
355 operator std::chrono::system_clock::time_point()
const {
356 return std::chrono::system_clock::time_point(
357 std::chrono::duration_cast<std::chrono::system_clock::duration>(
value));
367 return lhs.value == rhs.value;
401 template <
typename T,
403 detail::requires_not_t<int, detail::is_alike<b_regex, T>> = 0>
404 explicit b_regex(T&& regex, U&& options = U{})
405 : regex(
std::forward<T>(regex)), options(
std::forward<U>(options)) {}
417 return lhs.regex == rhs.regex && lhs.options == rhs.options;
438 return lhs.collection == rhs.collection && lhs.value == rhs.value;
453 template <
typename T, detail::requires_not_t<
int, detail::is_alike<b_code, T>> = 0>
472 return lhs.code == rhs.code;
489 template <
typename T, detail::requires_not_t<
int, detail::is_alike<b_symbol, T>> = 0>
508 return lhs.symbol == rhs.symbol;
526 template <
typename T,
528 detail::requires_not_t<int, detail::is_alike<b_codewscope, T>> = 0>
530 : code(
std::forward<T>(code)), scope(
std::forward<U>(scope)) {}
542 return lhs.code == rhs.code && lhs.scope == rhs.scope;
556 operator int32_t()
const {
567 return lhs.value == rhs.value;
586 return lhs.increment == rhs.increment && lhs.timestamp == rhs.timestamp;
600 operator int64_t()
const {
611 return lhs.value == rhs.value;
628 template <
typename T, detail::requires_not_t<
int, detail::is_alike<b_decimal128, T>> = 0>
638 return lhs.value == rhs.value;
679 return !(lhs == rhs);
688 return !(lhs == rhs);
697 return !(lhs == rhs);
706 return !(lhs == rhs);
715 return !(lhs == rhs);
724 return !(lhs == rhs);
733 return !(lhs == rhs);
742 return !(lhs == rhs);
751 return !(lhs == rhs);
760 return !(lhs == rhs);
769 return !(lhs == rhs);
778 return !(lhs == rhs);
787 return !(lhs == rhs);
796 return !(lhs == rhs);
805 return !(lhs == rhs);
814 return !(lhs == rhs);
823 return !(lhs == rhs);
832 return !(lhs == rhs);
841 return !(lhs == rhs);
850 return !(lhs == rhs);
859 return !(lhs == rhs);
866BSONCXX_POP_WARNINGS();
870using ::bsoncxx::v_noabi::to_string;
877using ::bsoncxx::v_noabi::types::b_utf8;
879using ::bsoncxx::v_noabi::types::operator==;
880using ::bsoncxx::v_noabi::types::operator!=;
892#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)
Provides bsoncxx::v_noabi::array::view.
The bsoncxx macro guard postlude header.
The bsoncxx macro guard prelude header.
A read-only, non-owning view of a BSON document.
Definition view.hpp:36
Represents an IEEE 754-2008 BSON Decimal128 value in a platform-independent way.
Definition decimal128.hpp:32
A read-only, non-owning view of a BSON document.
Definition view.hpp:35
Represents a MongoDB ObjectId. As this BSON type is used within the MongoDB server as a primary key f...
Definition oid.hpp:41
A polyfill for std::string_view.
Definition string_view.hpp:503
Provides bsoncxx::v_noabi::decimal128.
Provides bsoncxx::v_noabi::document::view.
#define BSONCXX_DEPRECATED
Declares the associated entity as deprecated.
Definition fwd.hpp:261
#define BSONCXX_ABI_EXPORT
Exports the associated entity as part of the ABI.
Definition fwd.hpp:201
#define BSONCXX_ABI_EXPORT_CDECL(...)
Equivalent to BSONCXX_ABI_EXPORT with BSONCXX_ABI_CDECL.
Definition fwd.hpp:225
bool operator!=(const v_noabi::types::b_double &lhs, const v_noabi::types::b_double &rhs)
bsoncxx::v_noabi::types::operator!=(const v_noabi::types::b_double& lhs, const v_noabi::types::b_doub...
bool operator==(const v_noabi::types::b_double &lhs, const v_noabi::types::b_double &rhs)
bsoncxx::v_noabi::types::operator==(const v_noabi::types::b_double& lhs, const v_noabi::types::b_doub...
BSONCXX_DEPRECATED typedef b_string b_utf8
Equivalent to b_string.
Definition types.hpp:172
BSONCXX_DEPRECATED typedef types::bson_value::view value
Equivalent to bsoncxx::v_noabi::types::bson_value::view.
Definition value.hpp:30
binary_sub_type
An enumeration of each BSON binary sub type.
Definition types.hpp:73
@ k_binary_deprecated
Binary (Old).
@ k_column
Compressed BSON column.
@ k_uuid_deprecated
UUID (Old).
@ k_encrypted
Encrypted BSON value.
std::string to_string(type rhs)
Returns a stringification of the given type.
type
An enumeration of each BSON type.
Definition types.hpp:43
@ k_decimal128
128-bit decimal floating point.
@ k_double
64-bit binary floating point.
@ k_codewscope
JavaScript code with scope.
@ k_utf8
Equivalent to k_string.
@ k_regex
Regular expression.
@ k_undefined
Undefined value.
@ k_document
Embedded document.
The top-level namespace within which all bsoncxx library entities are declared.
std::string to_string(v_noabi::type rhs)
bsoncxx::v_noabi::to_string(v_noabi::type rhs)
The top-level namespace reserved for the C++ standard library.
Provides bsoncxx::v_noabi::oid.
Provides std::string_view-related polyfills for library API usage.
bsoncxx::v_noabi::types::b_utf8
Definition types.hpp:906
A BSON array value.
Definition types.hpp:209
bool operator==(const b_array &lhs, const b_array &rhs)
free function comparator for b_array
Definition types.hpp:227
bool operator!=(const b_array &lhs, const b_array &rhs)
free function comparator for b_array
Definition types.hpp:705
A BSON binary data value.
Definition types.hpp:234
bool operator==(const b_binary &lhs, const b_binary &rhs)
free function comparator for b_binary
Definition types.hpp:247
bool operator!=(const b_binary &lhs, const b_binary &rhs)
free function comparator for b_binary
Definition types.hpp:714
A BSON boolean value.
Definition types.hpp:291
bool operator!=(const b_bool &lhs, const b_bool &rhs)
free function comparator for b_bool
Definition types.hpp:741
bool operator==(const b_bool &lhs, const b_bool &rhs)
free function comparator for b_bool
Definition types.hpp:309
A BSON JavaScript code value.
Definition types.hpp:444
bool operator==(const b_code &lhs, const b_code &rhs)
free function comparator for b_code
Definition types.hpp:471
bool operator!=(const b_code &lhs, const b_code &rhs)
free function comparator for b_code
Definition types.hpp:786
b_code(T &&t)
Constructor for b_code.
Definition types.hpp:454
A BSON JavaScript code with scope value.
Definition types.hpp:514
bool operator!=(const b_codewscope &lhs, const b_codewscope &rhs)
free function comparator for b_codewscope
Definition types.hpp:804
bool operator==(const b_codewscope &lhs, const b_codewscope &rhs)
free function comparator for b_codewscope
Definition types.hpp:541
b_codewscope(T &&code, U &&scope)
Constructor for b_codewscope.
Definition types.hpp:529
A BSON date value.
Definition types.hpp:316
bool operator==(const b_date &lhs, const b_date &rhs)
free function comparator for b_date
Definition types.hpp:366
b_date(const std::chrono::system_clock::time_point &tp)
Constructor for b_date.
Definition types.hpp:333
int64_t to_int64() const
Manually convert this b_date to an int64_t.
Definition types.hpp:348
bool operator!=(const b_date &lhs, const b_date &rhs)
free function comparator for b_date
Definition types.hpp:750
b_date(std::chrono::milliseconds value)
Constructor for b_date.
Definition types.hpp:325
A BSON DBPointer (aka DBRef) value.
Definition types.hpp:425
bool operator==(const b_dbpointer &lhs, const b_dbpointer &rhs)
free function comparator for b_dbpointer
Definition types.hpp:437
bool operator!=(const b_dbpointer &lhs, const b_dbpointer &rhs)
free function comparator for b_dbpointer
Definition types.hpp:777
A BSON Decimal128 value.
Definition types.hpp:617
bool operator!=(const b_decimal128 &lhs, const b_decimal128 &rhs)
free function comparator for b_decimal128
Definition types.hpp:840
bool operator==(const b_decimal128 &lhs, const b_decimal128 &rhs)
free function comparator for b_decimal128
Definition types.hpp:637
b_decimal128(T &&t)
Constructor for b_decimal128.
Definition types.hpp:629
A BSON document value.
Definition types.hpp:177
bool operator!=(const b_document &lhs, const b_document &rhs)
free function comparator for b_document
Definition types.hpp:696
document::view view()
Returns an unwrapped document::view.
Definition types.hpp:192
bool operator==(const b_document &lhs, const b_document &rhs)
free function comparator for b_document
Definition types.hpp:202
A BSON double value.
Definition types.hpp:111
bool operator==(const b_double &lhs, const b_double &rhs)
free function comparator for b_double
Definition types.hpp:129
bool operator!=(const b_double &lhs, const b_double &rhs)
free function comparator for b_double
Definition types.hpp:678
A BSON signed 32-bit integer value.
Definition types.hpp:548
bool operator==(const b_int32 &lhs, const b_int32 &rhs)
free function comparator for b_int32
Definition types.hpp:566
bool operator!=(const b_int32 &lhs, const b_int32 &rhs)
free function comparator for b_int32
Definition types.hpp:813
A BSON 64-bit signed integer value.
Definition types.hpp:592
bool operator==(const b_int64 &lhs, const b_int64 &rhs)
free function comparator for b_int64
Definition types.hpp:610
bool operator!=(const b_int64 &lhs, const b_int64 &rhs)
free function comparator for b_int64
Definition types.hpp:831
A BSON max-key value.
Definition types.hpp:660
bool operator!=(const b_maxkey &lhs, const b_maxkey &rhs)
free function comparator for b_maxkey
Definition types.hpp:858
bool operator==(const b_maxkey &, const b_maxkey &)
free function comparator for b_maxkey
Definition types.hpp:669
A BSON min-key value.
Definition types.hpp:644
bool operator!=(const b_minkey &lhs, const b_minkey &rhs)
free function comparator for b_minkey
Definition types.hpp:849
bool operator==(const b_minkey &, const b_minkey &)
free function comparator for b_minkey
Definition types.hpp:653
A BSON null value.
Definition types.hpp:373
bool operator!=(const b_null &lhs, const b_null &rhs)
free function comparator for b_null
Definition types.hpp:759
bool operator==(const b_null &, const b_null &)
free function comparator for b_null
Definition types.hpp:382
A BSON ObjectId value.
Definition types.hpp:273
bool operator==(const b_oid &lhs, const b_oid &rhs)
free function comparator for b_oid
Definition types.hpp:284
bool operator!=(const b_oid &lhs, const b_oid &rhs)
free function comparator for b_oid
Definition types.hpp:732
A BSON regex value.
Definition types.hpp:389
bool operator!=(const b_regex &lhs, const b_regex &rhs)
free function comparator for b_regex
Definition types.hpp:768
bool operator==(const b_regex &lhs, const b_regex &rhs)
free function comparator for b_regex
Definition types.hpp:416
b_regex(T &®ex, U &&options=U{})
Constructor for b_regex.
Definition types.hpp:404
A BSON UTF-8 encoded string value.
Definition types.hpp:136
b_string(T &&t)
Constructor for b_string.
Definition types.hpp:146
bool operator!=(const b_string &lhs, const b_string &rhs)
free function comparator for b_string
Definition types.hpp:687
bool operator==(const b_string &lhs, const b_string &rhs)
free function comparator for b_string
Definition types.hpp:163
A BSON Symbol value.
Definition types.hpp:480
b_symbol(T &&t)
Constructor for b_symbol.
Definition types.hpp:490
bool operator==(const b_symbol &lhs, const b_symbol &rhs)
free function comparator for b_symbol
Definition types.hpp:507
bool operator!=(const b_symbol &lhs, const b_symbol &rhs)
free function comparator for b_symbol
Definition types.hpp:795
A BSON replication timestamp value.
Definition types.hpp:573
bool operator!=(const b_timestamp &lhs, const b_timestamp &rhs)
free function comparator for b_timestamp
Definition types.hpp:822
bool operator==(const b_timestamp &lhs, const b_timestamp &rhs)
free function comparator for b_timestamp
Definition types.hpp:585
A BSON undefined value.
Definition types.hpp:257
bool operator!=(const b_undefined &lhs, const b_undefined &rhs)
free function comparator for b_undefined
Definition types.hpp:723
bool operator==(const b_undefined &, const b_undefined &)
free function comparator for b_undefined
Definition types.hpp:266
Provides <type_traits>-related polyfills for internal use.
Declares entities used to represent BSON types.