CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
System::Guid Class Reference

Represents a Globally Unique IDentifier This type should be allocated on stack and passed to functions by value or by reference. Never use System::SmartPtr class to manage objects of this type. More...

#include <guid.h>

Public Member Functions

 Guid ()
 Constructs an object that represents a GUID consisting of all zeroes. More...
 
 Guid (const ArrayPtr< uint8_t > &b)
 Constructs an object that represents a GUID specified as an array of unsigned 8-bit integer values. More...
 
 Guid (const System::Details::ArrayView< uint8_t > &b)
 Constructs an object that represents a GUID specified as an array view of unsigned 8-bit integer values. More...
 
 Guid (const String &g)
 Constructs an object that represents a GUID specified as a string. More...
 
 Guid (int32_t a, int16_t b, int16_t c, const ArrayPtr< uint8_t > &d)
 Constructs an instance of Guid class from the specified GUID components. More...
 
 Guid (int32_t a, int16_t b, int16_t c, const System::Details::ArrayView< uint8_t > &d)
 Constructs an instance of Guid class from the specified GUID components. More...
 
 Guid (int32_t a, int16_t b, int16_t c, uint8_t d, uint8_t e, uint8_t f, uint8_t g, uint8_t h, uint8_t i, uint8_t j, uint8_t k)
 Constructs an instance of Guid class from the specified unsigned integers and bytes. More...
 
 Guid (uint32_t a, uint16_t b, uint16_t c, uint8_t d, uint8_t e, uint8_t f, uint8_t g, uint8_t h, uint8_t i, uint8_t j, uint8_t k)
 Constructs an instance of Guid class from the specified unsigned integers and bytes. More...
 
 ~Guid ()
 Destructor. More...
 
 Guid (const Guid &guid)
 Constructs an object that represents the same GUID as the specified object. More...
 
Guidoperator= (const Guid &guid)
 Assigns to the current object the GUID value represented by the specified Guid object. More...
 
int CompareTo (const Guid &g) const
 Performs arithmetic comparison of the GUIDs represented by the current and specified objects. More...
 
bool Equals (const Guid &g) const
 Determines if the GUIDs represented by the current and specified objects are equal. More...
 
ArrayPtr< uint8_t > ToByteArray () const
 Converts the GUID represented by the current object into array of bytes. More...
 
String ToString () const
 Converts the GUID represented by the current object to its string representation. More...
 
String ToString (const String &format) const
 Converts the GUID represented by the current object to its string representation using the specified string format. More...
 
String ToString (const String &format, const SharedPtr< Globalization::CultureInfo > &culture) const
 Converts the GUID represented by the current object to its string representation using the specified string format and Culture. More...
 
bool operator!= (const Guid &b) const
 Determines if the GUIDs represented by the current and specified objects are not equal. More...
 
bool operator== (const Guid &b) const
 Determines if the GUIDs represented by the current and specified objects are equal. More...
 
int GetHashCode () const
 Returns a hash code for the current object. More...
 

Static Public Member Functions

static Guid NewGuid ()
 Generates a new GUID and returns a Guid object that represents it. More...
 
static Guid Parse (const String &input)
 Converts the specified string representation of a GUID into equivalent Guid object. More...
 
static bool TryParse (const String &input, Guid &g)
 Tries to convert the specified string into Guid object. More...
 

Static Public Attributes

static Guid Empty
 Represents a GUID that has a value of 0. More...
 

Detailed Description

Represents a Globally Unique IDentifier This type should be allocated on stack and passed to functions by value or by reference. Never use System::SmartPtr class to manage objects of this type.

Constructor & Destructor Documentation

◆ Guid() [1/9]

System::Guid::Guid ( )

Constructs an object that represents a GUID consisting of all zeroes.

◆ Guid() [2/9]

System::Guid::Guid ( const ArrayPtr< uint8_t > &  b)

Constructs an object that represents a GUID specified as an array of unsigned 8-bit integer values.

Parameters
bA byte-array containing separate bytes of the GUID

◆ Guid() [3/9]

System::Guid::Guid ( const System::Details::ArrayView< uint8_t > &  b)

Constructs an object that represents a GUID specified as an array view of unsigned 8-bit integer values.

Parameters
bA byte-array containing separate bytes of the GUID

◆ Guid() [4/9]

System::Guid::Guid ( const String g)

Constructs an object that represents a GUID specified as a string.

Parameters
gThe string representation of a GUID to be represented by the object being constructed

◆ Guid() [5/9]

System::Guid::Guid ( int32_t  a,
int16_t  b,
int16_t  c,
const ArrayPtr< uint8_t > &  d 
)

Constructs an instance of Guid class from the specified GUID components.

Parameters
aBits 0-31 of the GUID
bBits 32-47 of the GUID
cBits 48-63 of the GUID
dA byte array containing bits 64-127 of the GUID

◆ Guid() [6/9]

System::Guid::Guid ( int32_t  a,
int16_t  b,
int16_t  c,
const System::Details::ArrayView< uint8_t > &  d 
)

Constructs an instance of Guid class from the specified GUID components.

Parameters
aBits 0-31 of the GUID
bBits 32-47 of the GUID
cBits 48-63 of the GUID
dA byte array view containing bits 64-127 of the GUID

◆ Guid() [7/9]

System::Guid::Guid ( int32_t  a,
int16_t  b,
int16_t  c,
uint8_t  d,
uint8_t  e,
uint8_t  f,
uint8_t  g,
uint8_t  h,
uint8_t  i,
uint8_t  j,
uint8_t  k 
)

Constructs an instance of Guid class from the specified unsigned integers and bytes.

Parameters
aBits 0-31 of the GUID
bBits 32-47 of the GUID
cBits 48-63 of the GUID
dBits 64-71 of the GUID
eBits 72-79 of the GUID
fBits 80-87 of the GUID
gBits 88-95 of the GUID
hBits 96-103 of the GUID
iBits 104-111 of the GUID
jBits 112-119 of the GUID
kBits 120-127 of the GUID

◆ Guid() [8/9]

System::Guid::Guid ( uint32_t  a,
uint16_t  b,
uint16_t  c,
uint8_t  d,
uint8_t  e,
uint8_t  f,
uint8_t  g,
uint8_t  h,
uint8_t  i,
uint8_t  j,
uint8_t  k 
)

Constructs an instance of Guid class from the specified unsigned integers and bytes.

Parameters
aBits 0-31 of the GUID
bBits 32-47 of the GUID
cBits 48-63 of the GUID
dBits 64-71 of the GUID
eBits 72-79 of the GUID
fBits 80-87 of the GUID
gBits 88-95 of the GUID
hBits 96-103 of the GUID
iBits 104-111 of the GUID
jBits 112-119 of the GUID
kBits 120-127 of the GUID

◆ ~Guid()

System::Guid::~Guid ( )

Destructor.

◆ Guid() [9/9]

System::Guid::Guid ( const Guid guid)

Constructs an object that represents the same GUID as the specified object.

Parameters
guidThe Guid object to copy the GUID value from

Member Function Documentation

◆ CompareTo()

int System::Guid::CompareTo ( const Guid g) const

Performs arithmetic comparison of the GUIDs represented by the current and specified objects.

Parameters
gThe comparand
Returns
-1 if the GUID represented by the current object is less than the GUID represented by g; 0 if the GUIDs are equal; 1 if the GUID represented by the current object is greater than the GUID represented by g

◆ Equals()

bool System::Guid::Equals ( const Guid g) const

Determines if the GUIDs represented by the current and specified objects are equal.

Parameters
gThe comparand
Returns
True if the GUIDs represented by the current and the specified objects are equal, otherwise - false

◆ GetHashCode()

int System::Guid::GetHashCode ( ) const

Returns a hash code for the current object.

◆ NewGuid()

static Guid System::Guid::NewGuid ( )
static

Generates a new GUID and returns a Guid object that represents it.

◆ operator!=()

bool System::Guid::operator!= ( const Guid b) const

Determines if the GUIDs represented by the current and specified objects are not equal.

Parameters
bThe comparand
Returns
True if the GUIDs represented by the current and the specified objects are not equal, otherwise - false

◆ operator=()

Guid & System::Guid::operator= ( const Guid guid)

Assigns to the current object the GUID value represented by the specified Guid object.

Parameters
guidThe Guid object to copy the GUID value from
Returns
A reference to the self

◆ operator==()

bool System::Guid::operator== ( const Guid b) const

Determines if the GUIDs represented by the current and specified objects are equal.

Parameters
bThe comparand
Returns
True if the GUIDs represented by the current and the specified objects are equal, otherwise - false

◆ Parse()

static Guid System::Guid::Parse ( const String input)
static

Converts the specified string representation of a GUID into equivalent Guid object.

Parameters
inputThe string containing the string representation of GUID
Returns
A Guid object representing a GUID equivalent to that represented by input

◆ ToByteArray()

ArrayPtr< uint8_t > System::Guid::ToByteArray ( ) const

Converts the GUID represented by the current object into array of bytes.

Returns
A byte array containing bytes constituting the GUID represented by the current object

◆ ToString() [1/3]

String System::Guid::ToString ( ) const

Converts the GUID represented by the current object to its string representation.

◆ ToString() [2/3]

String System::Guid::ToString ( const String format) const

Converts the GUID represented by the current object to its string representation using the specified string format.

Parameters
formatThe format to use
Returns
The string representation of the GUID value represented by the current object

◆ ToString() [3/3]

String System::Guid::ToString ( const String format,
const SharedPtr< Globalization::CultureInfo > &  culture 
) const

Converts the GUID represented by the current object to its string representation using the specified string format and Culture.

Parameters
formatThe format to use
cultureCulture to use
Returns
The string representation of the GUID value represented by the current object

◆ TryParse()

static bool System::Guid::TryParse ( const String input,
Guid g 
)
static

Tries to convert the specified string into Guid object.

Parameters
inputThe string to convert
gOutput Guid object, if successful.
Returns
True, if input string represents valid Guid, otherwise false.

Member Data Documentation

◆ Empty

Guid System::Guid::Empty
static

Represents a GUID that has a value of 0.