struct std.Guid

Overview

This struct describes a globally unique identifier(GUID). More…

struct Guid {
    // fields

    uint32_t m_data1;
    uint16_t m_data2;
    uint16_t m_data3;
    uint8_t m_data4[8];

    // construction

    construct();
    construct(string_t string);

    // methods

    bool isEqual(std.Guid const* op) const;
    string_t getString(std.GuidStringFlags flags = 0);
    bool errorcode parse(string_t string);
};

Detailed Documentation

This struct describes a globally unique identifier(GUID).

GUIDs are 128-bit values often used as permanent labels which uniquely identify some sort of information. Creation of GUIDs does not require any significant central coordination.

In practice any two generated GUIDs could be assumed to be distinct – even though neither of GUID generation algorithms could strictly guarantee uniqueness of generated identifiers. The probability of collision is too low and can be neglected in most practical applications.

In Jancy standard library GUIDs are used to identify the type of an error (NTSTATUS, WinError, errno, string-error etc).

This struct directly maps to struct UUID as defined in WinAPI.

For more details about globally unique identifiers refer to: https://en.wikipedia.org/wiki/Globally_unique_identifier

Fields

uint32_t m_data1

Specifies the first 8 hexadecimal digits of the GUID.

uint16_t m_data2

Specifies the first group of 4 hexadecimal digits of the GUID.

uint16_t m_data3

Specifies the second group of 4 hexadecimal digits of the GUID.

uint8_t m_data4[8]

Array of eight elements. The first two elements contain the third group of 4 hexadecimal digits of the GUID. The remaining six elements contain the final 12 hexadecimal digits of the GUID.