C++ API Library Reference  4.3.2-74-ge1d4cca
Public Types | Public Functions | Public Static Functions | List of all members
Guid Class Reference

The Guid class provides methods to create globally unique identifiers, and perform operations on them. It is used, for example, to work with session IDs.

Public Types

enum  GuidFormat {
  FormatN = 0, FormatD = 1, FormatB = 2,
  FormatP = 3
}
 

Public Functions

HashCode GetHashCode () const
 
bool operator!= (Guid const &other) const
 
bool operator< (Guid const &other) const
 
bool operator<= (Guid const &other) const
 
Guidoperator= (Guid const &other)
 
bool operator== (Guid const &other) const
 
bool operator> (Guid const &other) const
 
bool operator>= (Guid const &other) const
 
ByteArray ToByteArray () const
 
String ToString () const
 
String ToString (GuidFormat format) const
 
Constructors and Destructors
 Guid ()
 
 Guid (Guid const &other)
 
 Guid (String const &string)
 
 Guid (Byte const (&bytes)[16])
 
 Guid (ByteArray bytes)
 
 Guid (Byte b0, Byte b1, Byte b2, Byte b3, Byte b4, Byte b5, Byte b6, Byte b7, Byte b8, Byte b9, Byte b10, Byte b11, Byte b12, Byte b13, Byte b14, Byte b15)
 
 ~Guid ()
 

Public Static Functions

static Guid const & Empty ()
 
static Guid NewGuid ()
 
static bool TryParse (String const &string, Guid &value)
 

Member Enumeration Documentation

enum GuidFormat

A list of supported formats for the GUID.

Enumerator
FormatN 

32 digits: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

FormatD 

32 digits separated by hyphens: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

FormatB 

32 digits separated by hyphens, enclosed in brackets: {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}

FormatP 

32 digits separated by hyphens, enclosed in parentheses: (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

Usage Description

static Guid const& Empty ( )
static

Returns an empty instance of GUID.

HashCode GetHashCode ( ) const

Places the GUID into a hash table.

static Guid NewGuid ( )
static

Generates a new GUID.

bool operator!= ( Guid const &  other) const

Checks if the current instance is equal or not to the specified other GUID; returns true if they are not equal, otherwise returns false.

bool operator< ( Guid const &  other) const

Checks if the current instance is less than the specified other GUID; returns true if it is, otherwise returns false.

bool operator<= ( Guid const &  other) const

Checks if the current instance is less than or equal to the specified other GUID; returns true if it is, otherwise returns false.

Guid& operator= ( Guid const &  other)

Assigns to the current instance the value of the specified other GUID.

bool operator== ( Guid const &  other) const

Checks if the current instance is equal to the specified other GUID; returns true if they are equal, otherwise returns false.

bool operator> ( Guid const &  other) const

Checks if the current instance is greater than the specified other GUID; returns true if it is, otherwise returns false.

bool operator>= ( Guid const &  other) const

Checks if the current instance is greater than or equal to the specified other GUID; returns true if it is, otherwise returns false.

ByteArray ToByteArray ( ) const

Converts the GUID to a byte array.

String ToString ( ) const
inline

Converts the GUID to a string; will return a string in FormatD (32 digits separated by hyphens).

String ToString ( GuidFormat  format) const

Converts the GUID to a string in the specified format.

static bool TryParse ( String const &  string,
Guid value 
)
static

Attempts to parse the specified GUID.