32#include <system_error>
51 std::array<std::uint8_t, k_oid_length> _bytes;
98 static std::
size_t size() {
106 return _bytes.data();
198 struct for_overwrite_tag {};
200 oid(for_overwrite_tag) : _bytes{} {}
209struct std::is_error_code_enum<
bsoncxx::v1::oid::errc> : true_type {};
Provides macros to control the set of symbols exported in the ABI.
#define BSONCXX_ABI_EXPORT_CDECL(...)
Equivalent to BSONCXX_ABI_EXPORT with BSONCXX_ABI_CDECL.
Definition export.hpp:52
The bsoncxx v1 macro guard postlude header.
The bsoncxx v1 macro guard prelude header.
friend bool operator>=(oid const &lhs, oid const &rhs)
Equivalent to lhs.compare(rhs) >= 0.
Definition oid.hpp:162
oid()
Initialize with a unique ObjectID.
static std::size_t size()
Return k_oid_length.
Definition oid.hpp:98
friend bool operator!=(oid const &lhs, oid const &rhs)
Equivalent to lhs.compare(rhs) != 0.
Definition oid.hpp:134
friend bool operator<(oid const &lhs, oid const &rhs)
Equivalent to lhs.compare(rhs) < 0.
Definition oid.hpp:141
friend bool operator==(oid const &lhs, oid const &rhs)
Equivalent to lhs.compare(rhs) == 0.
Definition oid.hpp:127
static constexpr std::size_t k_oid_length
The number of bytes required to represent an ObjectID.
Definition oid.hpp:48
friend bool operator<=(oid const &lhs, oid const &rhs)
Equivalent to lhs.compare(rhs) <= 0.
Definition oid.hpp:148
std::uint8_t const * bytes() const
Return a pointer to the byte representation.
Definition oid.hpp:105
friend std::error_code make_error_code(errc v)
Support implicit conversion to std::error_code.
Definition oid.hpp:191
std::time_t get_time_t() const
Return the timestamp component.
static std::error_category const & error_category()
The error category for bsoncxx::v1::oid::errc.
errc
Errors codes may be returned by bsoncxx::v1::oid.
Definition oid.hpp:171
@ invalid_length
Byte length must equal bsoncxx::v1::oid::k_oid_length.
Definition oid.hpp:174
@ invalid_string
String is not a valid ObjectID representation.
Definition oid.hpp:176
@ empty_string
String must not be empty.
Definition oid.hpp:175
@ zero
Zero.
Definition oid.hpp:172
@ null_bytes_ptr
Bytes pointer must not be null.
Definition oid.hpp:173
friend bool operator>(oid const &lhs, oid const &rhs)
Equivalent to lhs.compare(rhs) > 0.
Definition oid.hpp:155
int compare(oid const &other) const
Equivalent to bson_oid_compare.
std::string to_string() const
Return the hexadecimal representation.
Declares C++17 standard library polyfills.
Declares entities whose ABI stability is guaranteed for documented symbols.
The top-level namespace within which all bsoncxx library entities are declared.
Declares bsoncxx::v1::oid.
Provides std::string_view-related polyfills for library API usage.