mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 11:19:10 +00:00
Convert plUUID and its cascade of dependencies to plString
This commit is contained in:
@ -47,6 +47,11 @@ plUUID::plUUID()
|
||||
Clear();
|
||||
}
|
||||
|
||||
plUUID::plUUID( const plString & s )
|
||||
{
|
||||
FromString( s );
|
||||
}
|
||||
|
||||
plUUID::plUUID( const char * s )
|
||||
{
|
||||
FromString( s );
|
||||
@ -68,8 +73,8 @@ void plUUID::Write( hsStream * s)
|
||||
s->Write( sizeof( fData ), (const void*)fData );
|
||||
}
|
||||
|
||||
const char * plUUID::AsString() const {
|
||||
static std::string str;
|
||||
ToStdString(str);
|
||||
return str.c_str();
|
||||
plString plUUID::AsString() const {
|
||||
plString str;
|
||||
ToString(str);
|
||||
return str;
|
||||
}
|
||||
|
@ -64,6 +64,7 @@ public:
|
||||
|
||||
plUUID();
|
||||
plUUID( const char * s );
|
||||
plUUID( const plString & s );
|
||||
plUUID( const plUUID & other );
|
||||
#ifdef HS_BUILD_FOR_WIN32
|
||||
plUUID( const Uuid & uuid );
|
||||
@ -76,12 +77,12 @@ public:
|
||||
int CompareTo( const plUUID * v ) const;
|
||||
bool IsEqualTo( const plUUID * v ) const;
|
||||
bool FromString( const char * str );
|
||||
bool ToStdString( std::string & out ) const;
|
||||
inline std::string AsStdString() const { return AsString(); }
|
||||
const char * AsString() const; // returns static buffer
|
||||
bool FromString( const plString & str );
|
||||
bool ToString( plString & out ) const;
|
||||
plString AsString() const;
|
||||
void Read( hsStream * s );
|
||||
void Write( hsStream * s );
|
||||
operator std::string ( void ) const { return AsStdString();}
|
||||
operator plString ( void ) const { return AsString();}
|
||||
bool operator==( const plUUID & other ) const { return IsEqualTo( &other ); }
|
||||
bool operator!=( const plUUID & other ) const { return !IsEqualTo( &other ); }
|
||||
int operator <( const plUUID & other ) const { return CompareTo( &other ); }
|
||||
|
@ -101,15 +101,20 @@ bool plUUID::FromString( const char * str )
|
||||
return RPC_S_OK == UuidFromString( (unsigned char *)str, (GUID *)this );
|
||||
}
|
||||
|
||||
bool plUUID::ToStdString( std::string & out ) const
|
||||
bool plUUID::FromString( const plString & str )
|
||||
{
|
||||
out = "";
|
||||
return FromString( str.c_str() );
|
||||
}
|
||||
|
||||
bool plUUID::ToString( plString & out ) const
|
||||
{
|
||||
out = _TEMP_CONVERT_FROM_LITERAL("");
|
||||
unsigned char * ubuf;
|
||||
RPC_STATUS s;
|
||||
s = UuidToString( (GUID *) this, &ubuf );
|
||||
bool success = ( s==RPC_S_OK );
|
||||
if ( success )
|
||||
out = (char*)ubuf;
|
||||
out = plString::FromIso8859_1( (char*)ubuf );
|
||||
RpcStringFree( &ubuf );
|
||||
return success;
|
||||
}
|
||||
|
Reference in New Issue
Block a user