/* * Copyright (c) 2020, Liav A. * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #ifdef KERNEL # include #else # include #endif namespace AK { class UUID { public: enum class Endianness { Mixed, Little }; UUID() = default; UUID(Array uuid_buffer); UUID(StringView, Endianness endianness = Endianness::Little); ~UUID() = default; bool operator==(const UUID&) const = default; #ifdef KERNEL ErrorOr> to_string() const; #else ErrorOr to_string() const; #endif bool is_zero() const; private: void convert_string_view_to_little_endian_uuid(StringView); void convert_string_view_to_mixed_endian_uuid(StringView); Array m_uuid_buffer {}; }; } #if USING_AK_GLOBALLY using AK::UUID; #endif