17#include "AException.h"
18#include <AUI/Traits/serializable.h>
19#include <AUI/Traits/memory.h>
26class API_AUI_CORE AUuid {
28 std::array<uint8_t, 16> mData;
30 static uint8_t fromHex(
char c);
36 explicit AUuid(
const std::array<uint8_t, 16>& data) : mData(data) {}
40 const std::array<uint8_t, 16>& data()
const noexcept {
45 std::array<uint8_t, 16>& data()
noexcept {
82 bool operator<(
const AUuid& o)
const {
83 const auto* self =
reinterpret_cast<const unsigned*
>(mData.data());
84 const auto* other =
reinterpret_cast<const unsigned*
>(o.mData.data());
86 for (
unsigned i = 0; i <
sizeof(mData) /
sizeof(unsigned); ++i) {
87 if (self[i] != other[i]) {
88 return self[i] < other[i];
94 bool operator==(
const AUuid& other)
const {
95 return mData == other.mData;
98 bool operator!=(
const AUuid& other)
const {
99 return mData != other.mData;
104inline std::ostream& operator<<(std::ostream& o,
const AUuid& u) {
114 using AException::AException;
Represents a Unicode character string.
Definition AString.h:37
Implements universally unique identifier (UUID)
Definition AUuid.h:26
static AUuid fromString(const AString &string)
Definition AUuid.cpp:103
AString toRawString() const
Definition AUuid.cpp:79
AString toString() const
Definition AUuid.cpp:55
Definition serializable.h:26
Definition serializable.h:58