Browse Source

Added boolean operators to plUUID.

Darryl Pogue 12 years ago
parent
commit
517d4f6788
  1. 43
      Sources/Plasma/NucleusLib/pnUUID/pnUUID.h

43
Sources/Plasma/NucleusLib/pnUUID/pnUUID.h

@ -55,30 +55,32 @@ public:
uint8_t fData[16]; uint8_t fData[16];
struct Match struct Match
{ {
const plUUID * fGuid; const plUUID* fGuid;
Match( const plUUID * guid ):fGuid( guid ){} Match(const plUUID* guid) : fGuid(guid) {}
bool operator()( const plUUID * guid ) const { return guid->IsEqualTo( fGuid );} bool operator()(const plUUID* guid) const { return guid->IsEqualTo(fGuid); }
}; };
plUUID(); plUUID();
plUUID( const char * s ); plUUID(const plString& s);
plUUID( const plString & s ); plUUID(const plUUID& other);
plUUID( const plUUID & other ); plUUID(const Uuid& uuid);
plUUID( const Uuid & uuid );
void Clear(); void Clear();
bool IsNull() const; bool IsNull() const;
bool IsSet() const { return !IsNull(); } bool IsSet() const { return !IsNull(); }
void CopyFrom( const plUUID * v ); void CopyFrom(const plUUID* v);
void CopyFrom( const plUUID & v ); void CopyFrom(const plUUID& v);
int CompareTo( const plUUID * v ) const; int CompareTo(const plUUID* v) const;
bool IsEqualTo( const plUUID * v ) const; bool IsEqualTo(const plUUID* v) const;
bool FromString( const char * str ); bool FromString(const char* str);
bool FromString( const plString & str ) { return FromString( str.c_str() ); } bool FromString(const plString& str) { return FromString(str.c_str()); }
bool ToString( plString & out ) const; bool ToString(plString& out) const;
plString AsString() const; plString AsString() const;
void Read( hsStream * s ); void Read(hsStream* s);
void Write( hsStream * s ); void Write(hsStream* s);
operator plString ( void ) const { return AsString();}
operator bool () const { return !IsNull(); }
inline bool operator ! () const { return IsNull(); }
bool operator==(const plUUID& other) const { bool operator==(const plUUID& other) const {
return IsEqualTo(&other); return IsEqualTo(&other);
@ -89,6 +91,7 @@ public:
bool operator<(const plUUID& other) const { bool operator<(const plUUID& other) const {
return CompareTo(&other) == -1; return CompareTo(&other) == -1;
} }
operator plString (void) const { return AsString(); }
operator Uuid () const; operator Uuid () const;
static plUUID Generate(); static plUUID Generate();

Loading…
Cancel
Save