ark::core::Guid

Defined in header “ark/core/guid.hh”.


A class that represents a GUID. This GUID is stored as a 16-byte array and is automatically parsed (or converted) into a human readable string form on demand.

Methods

  • Guid()
    Default constructor. Produces an empty (null) GUID.

  • Guid(const std::string_view & value)
    Initializes a GUID from the given string. It is assumed that the string is in the form of XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.

  • Guid(uint64_t first_half, uint64_t second_half)
    Initializes a GUID from two halves of a 128-bit integer.

  • Guid(const uint8_t * data)
    Initializes a GUID from the raw byte array. It is assumed that this array is 128-bits (16 bytes).

  • constexpr Guid(std::array< uint8_t, 16 > data)
    Initializes a GUID from the given array.

  • constexpr Guid(const Guid & other)
    Initializes a GUID from a copy of the given GUID.

  • constexpr Guid & operator=(const Guid & other)
    Copy operator. Defines to support constexpr initialization.

  • bool null()
    Returns true if this is an empty (null) GUID.

  • std::string str()
    Returns a string representation of the given GUID, in the form of XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.

  • const uint8_t * data()
    Returns the raw byte data of this GUID.

  • constexpr bool operator==(const Guid & other)
    Equality operator.

  • constexpr bool operator!=(const Guid & other)
    Non-equality operator.

  • constexpr auto operator(const Guid & other)
    Spaceship operator, for remaining comparisons.