Uuid#

Fully qualified name: carb::extras::Uuid

Defined in carb/extras/Uuid.h

class Uuid#

UUIDv4 Unique Identifier (RFC 4122)

Public Types

using value_type = std::array<uint8_t, 16>#

UUID raw bytes.

Public Functions

inline Uuid() noexcept#

Initialize empty UUID, 00000000-0000-0000-0000-000000000000.

inline Uuid(const std::string &uuidStr) noexcept#

Convert a string to a Uuid using UUID format.

Accepts the following formats: 00000000-0000-0000-0000-000000000000 {00000000-0000-0000-0000-000000000000} urn:uuid:00000000-0000-0000-0000-000000000000

Parameters:

uuidStr – string to try and convert to Uuid from

inline bool isEmpty() const noexcept#

Check if Uuid is empty.

Returns:

true if Uuid is empty; otherwise, false

inline const value_type &data() const noexcept#

Access the binary data of the UUID.

Returns:

array of UUID data

inline bool operator==(const Uuid &rhs) const noexcept#

Compare two UUIDs for equality.

Parameters:

rhs – right hand side of ==

Returns:

true if uuids are equal; otherwise false

inline bool operator!=(const Uuid &rhs) const noexcept#

Compare two UUIDs for inequality.

Parameters:

rhs – right hand side of !=

Returns:

true if uuids are not equal; otherwise false

Public Static Functions

static inline Uuid createV4() noexcept#

Create UUIDv4 DCE compatible universally unique identifier.