84 explicit operator
v1::
oid() const noexcept {
94 return _oid.to_string();
113 return _oid.get_time_t();
122 return reinterpret_cast<char const*
>(_oid.bytes());
129 return _oid.compare(other._oid);
139 return lhs._oid < rhs._oid;
143 return lhs._oid > rhs._oid;
147 return lhs._oid <= rhs._oid;
151 return lhs._oid >= rhs._oid;
155 return lhs._oid == rhs._oid;
159 return lhs._oid != rhs._oid;
168BSONCXX_PRIVATE_INLINE_CXX17
constexpr std::size_t oid::k_oid_length;
#define BSONCXX_ABI_EXPORT_CDECL(...)
Equivalent to BSONCXX_ABI_EXPORT with BSONCXX_ABI_CDECL.
Definition export.hpp:52
The bsoncxx v_noabi macro guard postlude header.
The bsoncxx v_noabi macro guard prelude header.
oid()
Constructs an oid and initializes it to a newly generated ObjectId.
A BSON ObjectID.
Definition oid.hpp:43
static constexpr std::size_t k_oid_length
The number of bytes required to represent an ObjectID.
Definition oid.hpp:48
Represents a MongoDB BSON ObjectId.
Definition oid.hpp:41
std::string to_string() const
Converts this oid to a hexadecimal string.
Definition oid.hpp:93
friend bool operator>=(oid const &lhs, oid const &rhs)
Relational comparison operator.
Definition oid.hpp:150
int compare(oid const &other) const
Equivalent to bson_oid_compare.
Definition oid.hpp:128
static std::size_t size()
Returns the number of bytes in this ObjectId.
Definition oid.hpp:102
friend bool operator!=(oid const &lhs, oid const &rhs)
Relational comparison operator.
Definition oid.hpp:158
std::time_t get_time_t() const
Extracts the timestamp portion of the underlying ObjectId.
Definition oid.hpp:112
oid()
Constructs an oid and initializes it to a newly generated ObjectId.
friend bool operator<(oid const &lhs, oid const &rhs)
Relational comparison operator.
Definition oid.hpp:138
friend bool operator==(oid const &lhs, oid const &rhs)
Relational comparison operator.
Definition oid.hpp:154
friend bool operator<=(oid const &lhs, oid const &rhs)
Relational comparison operator.
Definition oid.hpp:146
char const * bytes() const
An accessor for the internal data buffer in the oid.
Definition oid.hpp:121
friend bool operator>(oid const &lhs, oid const &rhs)
Relational comparison operator.
Definition oid.hpp:142
Declares entities whose ABI stability is guaranteed for documented symbols.
Declares C++17 standard library polyfills.
Declares entities whose ABI stability is NOT guaranteed.
v1::element::view to_v1(v_noabi::array::element const &v)
Convert to the bsoncxx::v1 equivalent of v.
Definition element.hpp:132
v_noabi::array::value from_v1(v1::array::value const &v)
Convert from the bsoncxx::v1 equivalent of v.
Definition value.hpp:267
The top-level namespace within which all bsoncxx library entities are declared.
Provides bsoncxx::v1::oid.
Declares bsoncxx::v_noabi::oid.
Provides std::string_view-related polyfills for library API usage.