diff options
author | Mike Buland <eichlan@xagasoft.com> | 2011-07-27 17:20:12 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2011-07-27 17:20:12 +0000 |
commit | d061fe55de758aafdec3b1ef378d83e0bee94242 (patch) | |
tree | 1e71ea327b77a1bb264b303db99f9d6499bf4649 /src/uuid.cpp | |
parent | 663c6d9c9113a92fc3c79b51ea986ff30189868d (diff) | |
download | libbu++-d061fe55de758aafdec3b1ef378d83e0bee94242.tar.gz libbu++-d061fe55de758aafdec3b1ef378d83e0bee94242.tar.bz2 libbu++-d061fe55de758aafdec3b1ef378d83e0bee94242.tar.xz libbu++-d061fe55de758aafdec3b1ef378d83e0bee94242.zip |
More features for uuids, including hashing and comparison.
Diffstat (limited to 'src/uuid.cpp')
-rw-r--r-- | src/uuid.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/uuid.cpp b/src/uuid.cpp index bcaf377..088450b 100644 --- a/src/uuid.cpp +++ b/src/uuid.cpp | |||
@@ -100,3 +100,18 @@ void Bu::Uuid::set( const Bu::String &sSrc ) | |||
100 | } | 100 | } |
101 | } | 101 | } |
102 | 102 | ||
103 | bool Bu::Uuid::operator==( const Uuid &rhs ) const | ||
104 | { | ||
105 | return memcmp( data, rhs.data, 16 ) == 0; | ||
106 | } | ||
107 | |||
108 | template<> uint32_t Bu::__calcHashCode<Bu::Uuid>( const Bu::Uuid &k ) | ||
109 | { | ||
110 | return __calcHashCode<String>( k.toRawString() ); | ||
111 | } | ||
112 | |||
113 | template<> bool Bu::__cmpHashKeys<Bu::Uuid>( const Bu::Uuid &a, const Bu::Uuid &b ) | ||
114 | { | ||
115 | return a == b; | ||
116 | } | ||
117 | |||