32#include <system_error>
49 std::array<std::uint8_t, k_oid_length> _bytes;
96 static std::
size_t size() {
104 return _bytes.data();
190 struct for_overwrite_tag {};
192 oid(for_overwrite_tag) : _bytes{} {}
201struct 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:160
oid()
Initialize with a unique ObjectID.
static std::size_t size()
Return k_oid_length.
Definition oid.hpp:96
friend bool operator!=(oid const &lhs, oid const &rhs)
Equivalent to lhs.compare(rhs) != 0.
Definition oid.hpp:132
friend bool operator<(oid const &lhs, oid const &rhs)
Equivalent to lhs.compare(rhs) < 0.
Definition oid.hpp:139
friend bool operator==(oid const &lhs, oid const &rhs)
Equivalent to lhs.compare(rhs) == 0.
Definition oid.hpp:125
static constexpr std::size_t k_oid_length
The number of bytes required to represent an ObjectID.
Definition oid.hpp:46
friend bool operator<=(oid const &lhs, oid const &rhs)
Equivalent to lhs.compare(rhs) <= 0.
Definition oid.hpp:146
std::uint8_t const * bytes() const
Return a pointer to the byte representation.
Definition oid.hpp:103
friend std::error_code make_error_code(errc v)
Support implicit conversion to std::error_code.
Definition oid.hpp:183
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:167
@ invalid_length
Byte length must equal bsoncxx::v1::oid::k_oid_length.
Definition oid.hpp:170
@ invalid_string
String is not a valid ObjectID representation.
Definition oid.hpp:172
@ empty_string
String must not be empty.
Definition oid.hpp:171
@ zero
Zero.
Definition oid.hpp:168
@ null_bytes_ptr
Bytes pointer must not be null.
Definition oid.hpp:169
friend bool operator>(oid const &lhs, oid const &rhs)
Equivalent to lhs.compare(rhs) > 0.
Definition oid.hpp:153
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.