diff options
Diffstat (limited to 'src/unstable/uuid.h')
-rw-r--r-- | src/unstable/uuid.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/unstable/uuid.h b/src/unstable/uuid.h index 73b34bc..de20d4c 100644 --- a/src/unstable/uuid.h +++ b/src/unstable/uuid.h | |||
@@ -8,6 +8,7 @@ | |||
8 | #ifndef BU_UUID_H | 8 | #ifndef BU_UUID_H |
9 | #define BU_UUID_H | 9 | #define BU_UUID_H |
10 | 10 | ||
11 | #include "bu/util.h" | ||
11 | #include "bu/string.h" | 12 | #include "bu/string.h" |
12 | 13 | ||
13 | namespace Bu | 14 | namespace Bu |
@@ -26,20 +27,27 @@ namespace Bu | |||
26 | Bu::String toString() const; | 27 | Bu::String toString() const; |
27 | Bu::String toUrn() const; | 28 | Bu::String toUrn() const; |
28 | 29 | ||
30 | enum Type | ||
31 | { | ||
32 | System, | ||
33 | Version1, | ||
34 | Version2, | ||
35 | Version3, | ||
36 | Version4, | ||
37 | Version5, | ||
38 | }; | ||
39 | |||
29 | int getVersion(); | 40 | int getVersion(); |
30 | 41 | ||
31 | static Uuid gen(); | 42 | static Uuid generate( Type eType = System ); |
32 | static Uuid genV1(); | 43 | DEPRECATED static Uuid gen() { return generate(); } |
33 | static Uuid genV2(); | ||
34 | static Uuid genV3(); | ||
35 | static Uuid genV4(); | ||
36 | static Uuid genV5(); | ||
37 | 44 | ||
38 | void clear(); | 45 | void clear(); |
39 | void set( const Bu::String &sSrc ); | 46 | void set( const Bu::String &sSrc ); |
40 | 47 | ||
41 | bool operator==( const Uuid &rhs ) const; | 48 | bool operator==( const Uuid &rhs ) const; |
42 | Uuid &operator=( const Bu::String &rhs ) { set( rhs ); return *this; } | 49 | Uuid &operator=( const Bu::String &rhs ) { set( rhs ); return *this; } |
50 | Uuid &operator=( const Uuid &rhs ); | ||
43 | 51 | ||
44 | private: | 52 | private: |
45 | unsigned char data[16]; | 53 | unsigned char data[16]; |