1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-18 11:19:10 +00:00

Replace Uuid with plUUID EVERYWHERE.

This commit is contained in:
Darryl Pogue
2012-12-29 02:05:23 -08:00
parent a0641ba66b
commit bcf6e97d23
78 changed files with 427 additions and 892 deletions

View File

@ -42,6 +42,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnUUID.h"
#include "hsStream.h"
const plUUID kNilUuid;
plUUID::plUUID()
{
Clear();
@ -57,11 +59,6 @@ plUUID::plUUID(const plUUID& other)
CopyFrom(&other);
}
plUUID::plUUID(const Uuid& uuid)
{
memcpy(fData, uuid.data, sizeof(fData));
}
void plUUID::Read(hsStream* s)
{
s->LogSubStreamPushDesc("plUUID");
@ -79,10 +76,3 @@ plString plUUID::AsString() const
ToString(str);
return str;
}
plUUID::operator Uuid () const
{
Uuid uuid;
memcpy(uuid.data, fData, sizeof(uuid.data));
return uuid;
}

View File

@ -43,10 +43,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define pnUUID_h_inc
#include "HeadSpin.h"
#include "pnUtils/pnUtUuid.h"
#include "plString.h"
class hsStream;
class plString;
extern const class plUUID kNilUuid;
class plUUID
{
@ -63,7 +64,6 @@ public:
plUUID();
plUUID(const plString& s);
plUUID(const plUUID& other);
plUUID(const Uuid& uuid);
void Clear();
bool IsNull() const;
@ -92,7 +92,6 @@ public:
return CompareTo(&other) == -1;
}
operator plString (void) const { return AsString(); }
operator Uuid () const;
static plUUID Generate();
};

View File

@ -64,7 +64,7 @@ struct plUUIDHelper
void plUUID::Clear()
{
uuid_t g;
plUUIDHelper::CopyToNative( g, this );
//plUUIDHelper::CopyToNative( g, this );
uuid_clear( g );
plUUIDHelper::CopyToPlasma( this, g );
}
@ -98,11 +98,16 @@ bool plUUID::IsEqualTo( const plUUID * v ) const
bool plUUID::FromString( const char * str )
{
Clear();
if ( !str )
if (!str) {
return false;
}
uuid_t g;
uuid_parse( str, g );
plUUIDHelper::CopyToPlasma( this, g );
if (uuid_parse(str, g) != 0) {
return false;
}
plUUIDHelper::CopyToPlasma(this, g);
return true;
}