The Nebula Device 3: Win32::Win32Guid Class Reference

The Nebula Device 3

Win32::Win32Guid Class Reference

#include <win32guid.h>


Detailed Description

Win32 implementation of the Util::Guid class. GUIDs can be compared and provide a hash code, so they can be used as keys in most collections.

(C) 2006 Radon Labs GmbH

Public Member Functions

void * operator new (size_t size)
 overloaded operator new
void operator delete (void *p)
 overloaded operator delete
 Win32Guid ()
 constructor
 Win32Guid (const Win32Guid &rhs)
 copy constructor
 Win32Guid (const unsigned char *ptr, SizeT size)
 construct from raw binary data as returned by AsBinary()
void operator= (const Win32Guid &rhs)
 assignement operator
void operator= (const Util::String &rhs)
 assignment operator from string
bool operator== (const Win32Guid &rhs) const
 equality operator
bool operator!= (const Win32Guid &rhs) const
 inequlality operator
bool operator< (const Win32Guid &rhs) const
 less-then operator
bool operator<= (const Win32Guid &rhs) const
 less-or-equal operator
bool operator> (const Win32Guid &rhs) const
 greater-then operator
bool operator>= (const Win32Guid &rhs) const
 greater-or-equal operator
bool IsValid () const
 return true if the contained guid is valid (not NIL)
void Generate ()
 generate a new guid
Util::String AsString () const
 get as string
SizeT AsBinary (const unsigned char *&outPtr) const
 get pointer to binary data
IndexT HashCode () const
 get a hash code (compatible with Util::HashTable)

Static Public Member Functions

static void Setup ()
 static setup method, called by Util::Setup
static Win32Guid FromString (const Util::String &str)
 construct from string representation
static Win32Guid FromBinary (const unsigned char *ptr, SizeT numBytes)
 construct from binary representation

Member Function Documentation

Win32Guid Win32::Win32Guid::FromBinary ( const unsigned char *  ptr,
SizeT  numBytes 
) [static]

construct from binary representation

Constructs the guid from binary data, as returned by the AsBinary().

SizeT Win32::Win32Guid::AsBinary ( const unsigned char *&  outPtr  )  const

get pointer to binary data

This method allows read access to the raw binary data of the uuid. It returns the number of bytes in the buffer, and a pointer to the data.

IndexT Win32::Win32Guid::HashCode (  )  const

get a hash code (compatible with Util::HashTable)

This method returns a hash code for the uuid, compatible with Util::HashTable.