From e231a34727bcba53ac093fc8f3e4062322fb7fc4 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 25 Jun 2012 20:03:39 +0000 Subject: Bu::Uuid has some more features for niceness. It's easier to set them from strings and you can archive them. --- src/unstable/uuid.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/unstable/uuid.h') diff --git a/src/unstable/uuid.h b/src/unstable/uuid.h index db4c85b..73b34bc 100644 --- a/src/unstable/uuid.h +++ b/src/unstable/uuid.h @@ -14,6 +14,8 @@ namespace Bu { class Uuid { + friend Bu::ArchiveBase &operator>>( Bu::ArchiveBase &ar, Uuid &u ); + friend Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const Uuid &u ); public: Uuid(); Uuid( const Uuid &src ); @@ -34,11 +36,12 @@ namespace Bu static Uuid genV5(); void clear(); + void set( const Bu::String &sSrc ); bool operator==( const Uuid &rhs ) const; + Uuid &operator=( const Bu::String &rhs ) { set( rhs ); return *this; } private: - void set( const Bu::String &sSrc ); unsigned char data[16]; }; @@ -51,6 +54,9 @@ namespace Bu template<> uint32_t __calcHashCode( const Uuid &k ); template<> bool __cmpHashKeys( const Uuid &a, const Uuid &b ); + + Bu::ArchiveBase &operator>>( Bu::ArchiveBase &ar, Uuid &u ); + Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const Uuid &u ); }; #endif -- cgit v1.2.3