aboutsummaryrefslogtreecommitdiff
path: root/src/unstable/uuid.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2012-06-26 14:34:55 +0000
committerMike Buland <eichlan@xagasoft.com>2012-06-26 14:34:55 +0000
commit87fa2298eb73bf6213ec836937c236df25e2a4a7 (patch)
tree70cc1ea04267e4c8a1690c1c7a5ccbaf16a7c688 /src/unstable/uuid.h
parente231a34727bcba53ac093fc8f3e4062322fb7fc4 (diff)
downloadlibbu++-87fa2298eb73bf6213ec836937c236df25e2a4a7.tar.gz
libbu++-87fa2298eb73bf6213ec836937c236df25e2a4a7.tar.bz2
libbu++-87fa2298eb73bf6213ec836937c236df25e2a4a7.tar.xz
libbu++-87fa2298eb73bf6213ec836937c236df25e2a4a7.zip
Changed the Bu::Uuid generate interface. It's now one function that takes a
type parameter. I think it's much nicer overall, the old gen function is stil there for now, but marked deprecated.
Diffstat (limited to 'src/unstable/uuid.h')
-rw-r--r--src/unstable/uuid.h20
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
13namespace Bu 14namespace 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];