forked from mcneel/rpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LBP_UUID.h
60 lines (46 loc) · 1.78 KB
/
LBP_UUID.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#pragma once
#include "LBPString.h"
class CLBP_UUID : public UUID
{
public:
CLBP_UUID(); // Initialised to nil uuid.
CLBP_UUID(const UUID& uuid);
CLBP_UUID(const char* sz);
CLBP_UUID(const WCHAR* wsz);
CLBP_UUID(const CLBPString& s);
~CLBP_UUID() { } // No virtual functions are allowed in this class.
public: // UUID operations.
void Create(void);
bool IsNil(void) const;
DWORD Hash(void) const;
int Compare(const char* sz) const;
int Compare(const WCHAR* wsz) const;
int Compare(const UUID& uuid) const;
CLBP_UUID& operator = (const char* sz);
CLBP_UUID& operator = (const WCHAR* wsz);
CLBP_UUID& operator = (const CLBPString& s);
CLBP_UUID& operator = (const UUID& uuid);
bool operator == (const char* sz) const;
bool operator == (const WCHAR* wsz) const;
bool operator == (const UUID& uuid) const;
bool operator != (const char* sz) const;
bool operator != (const WCHAR* wsz) const;
bool operator != (const UUID& uuid) const;
friend bool operator == (const char * sz, const UUID& uuid);
friend bool operator == (const WCHAR * wsz, const UUID& uuid);
friend bool operator != (const char * sz, const UUID& uuid);
friend bool operator != (const WCHAR * wsz, const UUID& uuid);
public: // String operations.
static const int ciNumChars = 36;
CLBPString String(int numChars=ciNumChars) const;
CLBPString RegistryFormat(int numChars=ciNumChars) const;
operator CLBPString(void) const { return String(); }
// Input any string. The UUID produced from the string will always be the same. Note - ASCII strings only.
bool CreateMashFromString(const char* sz);
// Returns true if string is a valid UUID.
static bool IsValidUuid(const WCHAR* wsz);
protected:
void SetAsString(const char* sz);
void SetAsString(const WCHAR* wsz);
void SetAsString(const CLBPString& s);
};