sP2P c++ STL *nix API  1.2
NAT traversal and peer-to-peer networking API providing all utilities needed to build peer-to-peer application straigth out of box
 All Classes Functions Variables Typedefs Enumerations Enumerator
sp2plib::Guid Class Reference

sp2p Guid - .net compatible Guid object More...

#include <Guid.h>

Public Member Functions

 Guid ()
 Initializes new instance of sp2p Guid object, (.net Guid compatible)
 
 Guid (const char *strValue)
 Initializes new instance of sp2p Guid object from human readable string
 
 Guid (unsigned char *arrbytes, int startIndex)
 Initializes new instance of sp2p Guid object from byte array
 
 ~Guid ()
 Destructor.
 
void Parse (const char *strValue)
 Parses the value from string value.
 
void ParseFromBytes (unsigned char *arrbytes, int startIndex=0)
 Parses sp2p Guid from bytes array
 
::std::string ToString ()
 COnvetrs guid to human readable string
 
unsigned char * ToByteArray ()
 Gets inner byte array of Guid object
 
void WriteToByteArray (unsigned char *bArray, int startIndex=0)
 Writes bytes to byte array.
 
bool Equals (const Guid &other)
 Tests if this const GUID & is considered equal to another.
 
Guidoperator= (const Guid &rhs)
 Assignment operator.
 
Guidoperator= (const sp2plib::UInt128 &rhs)
 Assignment operator.
 
bool operator== (const Guid &other) const
 Equality operator.
 
bool operator!= (const Guid &other) const
 Inequality operator.
 
bool operator> (const Guid &other) const
 Greater-than comparison operator.
 
bool operator<= (const Guid &other) const
 Less-than-or-equal comparison operator.
 
bool operator< (const Guid &other) const
 Less-than comparison operator.
 
bool operator>= (const Guid &other) const
 Greater-than-or-equal comparison operator.
 
void regenerate ()
 Re-creates guid value
 
void set0 ()
 Sets all guid bytes to 0.
 

Static Public Member Functions

static GuidEmpty ()
 Gets the empty guid
 
static Guid NewGuid ()
 Creates a new sp2p Guid
 
static Guid ParseGuid (const char *strValue)
 Parses sp2p Guid from human readable string
 

Detailed Description

sp2p Guid - .net compatible Guid object

Constructor & Destructor Documentation

sp2plib::Guid::Guid ( )

Initializes new instance of sp2p Guid object, (.net Guid compatible)

sp2plib::Guid::Guid ( const char *  strValue)

Initializes new instance of sp2p Guid object from human readable string

Parameters
strValueHuman readable Guid string representation
sp2plib::Guid::Guid ( unsigned char *  arrbytes,
int  startIndex 
)

Initializes new instance of sp2p Guid object from byte array

Parameters
arrbytesbyte array holding bytes
startIndexThe start index from which to start parsing
sp2plib::Guid::~Guid ( )

Destructor.

Member Function Documentation

static Guid& sp2plib::Guid::Empty ( )
static

Gets the empty guid

Returns
Empty guid {00000000-0000-0000-0000-000000000000}
bool sp2plib::Guid::Equals ( const Guid other)

Tests if this const GUID & is considered equal to another.

Parameters
otherThe other Guid & to compare to this object.
Returns
true if the objects are considered equal, false if they are not.
static Guid sp2plib::Guid::NewGuid ( )
static

Creates a new sp2p Guid

Returns
sp2p Guid
bool sp2plib::Guid::operator!= ( const Guid other) const

Inequality operator.

Parameters
otherThe other.
Returns
true if the parameters are not considered equivalent.
bool sp2plib::Guid::operator< ( const Guid other) const

Less-than comparison operator.

Parameters
otherThe other.
Returns
true if the first parameter is less than the second.
bool sp2plib::Guid::operator<= ( const Guid other) const

Less-than-or-equal comparison operator.

Parameters
otherThe other.
Returns
true if the first parameter is less than or equal to the second.
Guid& sp2plib::Guid::operator= ( const Guid rhs)

Assignment operator.

Parameters
rhsThe right hand side.
Returns
A shallow copy of this object.
Guid& sp2plib::Guid::operator= ( const sp2plib::UInt128 &  rhs)

Assignment operator.

Parameters
rhsThe right hand side.
Returns
A shallow copy of this object.
bool sp2plib::Guid::operator== ( const Guid other) const

Equality operator.

Parameters
otherThe other.
Returns
true if the parameters are considered equivalent.
bool sp2plib::Guid::operator> ( const Guid other) const

Greater-than comparison operator.

Parameters
otherThe other.
Returns
true if the first parameter is greater than to the second.
bool sp2plib::Guid::operator>= ( const Guid other) const

Greater-than-or-equal comparison operator.

Parameters
otherThe other.
Returns
true if the first parameter is greater than or equal to the second.
void sp2plib::Guid::Parse ( const char *  strValue)

Parses the value from string value.

Parameters
strValueHuman readable Guid string representation.
void sp2plib::Guid::ParseFromBytes ( unsigned char *  arrbytes,
int  startIndex = 0 
)

Parses sp2p Guid from bytes array

Parameters
arrbytesbyte array holding bytes.
startIndexThe start index from which to start parsing.
static Guid sp2plib::Guid::ParseGuid ( const char *  strValue)
static

Parses sp2p Guid from human readable string

Parameters
strValueHuman readable Guid string representation.
Returns
sp2p Guid
void sp2plib::Guid::regenerate ( )

Re-creates guid value

void sp2plib::Guid::set0 ( )

Sets all guid bytes to 0.

unsigned char* sp2plib::Guid::ToByteArray ( )

Gets inner byte array of Guid object

Returns
Byte array
::std::string sp2plib::Guid::ToString ( )

COnvetrs guid to human readable string

void sp2plib::Guid::WriteToByteArray ( unsigned char *  bArray,
int  startIndex = 0 
)

Writes bytes to byte array.

Parameters
bArrayArray to write bytes to
startIndexThe start index from which to start writing

The documentation for this class was generated from the following file: