2
3
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-14 02:27:40 -04:00

Fix line endings and tabs

This commit is contained in:
Branan Purvine-Riley
2011-04-11 16:27:55 -07:00
parent d4250e19b5
commit 908aaeb6f6
2738 changed files with 702562 additions and 702562 deletions

View File

@ -1,20 +1,20 @@
include_directories("../../CoreLib")
include_directories("../../NucleusLib")
include_directories("../../PubUtilLib")
set(plUUID_SOURCES
plUUID.cpp
)
if(WIN32)
set(plUUID_SOURCES ${plUUID_SOURCES} plUUID_Win32.cpp)
endif(WIN32)
set(plUUID_HEADERS
plUUID.h
)
add_library(plUUID STATIC ${plUUID_SOURCES} ${plUUID_HEADERS})
source_group("Source Files" FILES ${plUUID_SOURCES})
source_group("Header Files" FILES ${plUUID_HEADERS})
include_directories("../../CoreLib")
include_directories("../../NucleusLib")
include_directories("../../PubUtilLib")
set(plUUID_SOURCES
plUUID.cpp
)
if(WIN32)
set(plUUID_SOURCES ${plUUID_SOURCES} plUUID_Win32.cpp)
endif(WIN32)
set(plUUID_HEADERS
plUUID.h
)
add_library(plUUID STATIC ${plUUID_SOURCES} ${plUUID_HEADERS})
source_group("Source Files" FILES ${plUUID_SOURCES})
source_group("Header Files" FILES ${plUUID_HEADERS})

View File

@ -1,105 +1,105 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#include "plUUID.h"
#include "hsStream.h"
COMPILER_ASSERT(msizeof(Uuid, data) == msizeof(plUUID, fData));
plUUID::plUUID()
{
Clear();
}
plUUID::plUUID( const char * s )
{
FromString( s );
}
plUUID::plUUID( const plUUID & other )
{
CopyFrom( &other );
}
plUUID::plUUID( const Uuid & uuid )
{
MemCopy(fData, uuid.data, sizeof(fData));
}
void plUUID::Read( hsStream * s)
{
s->LogSubStreamPushDesc("plUUID");
s->Read( sizeof( fData ), (void*)fData );
}
void plUUID::Write( hsStream * s)
{
s->Write( sizeof( fData ), (const void*)fData );
}
plUUID::operator Uuid () const {
Uuid uuid;
MemCopy(uuid.data, fData, sizeof(uuid.data));
return uuid;
}
const char * plUUID::AsString() const {
static std::string str;
ToStdString(str);
return str.c_str();
}
void plUUID::CopyFrom( const plUUID * v ) {
if (!v)
Clear();
else
CopyFrom(*v);
}
void plUUID::CopyFrom( const plUUID & v ) {
MemCopy(fData, v.fData, sizeof(fData));
}
/*****************************************************************************
*
* plCreatableUuid
*
***/
//============================================================================
plCreatableUuid::plCreatableUuid () {
}
//============================================================================
plCreatableUuid::plCreatableUuid (const plCreatableUuid & other)
: plUUID(other)
{
}
//============================================================================
plCreatableUuid::plCreatableUuid (const plUUID & other)
: plUUID(other)
{
}
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#include "plUUID.h"
#include "hsStream.h"
COMPILER_ASSERT(msizeof(Uuid, data) == msizeof(plUUID, fData));
plUUID::plUUID()
{
Clear();
}
plUUID::plUUID( const char * s )
{
FromString( s );
}
plUUID::plUUID( const plUUID & other )
{
CopyFrom( &other );
}
plUUID::plUUID( const Uuid & uuid )
{
MemCopy(fData, uuid.data, sizeof(fData));
}
void plUUID::Read( hsStream * s)
{
s->LogSubStreamPushDesc("plUUID");
s->Read( sizeof( fData ), (void*)fData );
}
void plUUID::Write( hsStream * s)
{
s->Write( sizeof( fData ), (const void*)fData );
}
plUUID::operator Uuid () const {
Uuid uuid;
MemCopy(uuid.data, fData, sizeof(uuid.data));
return uuid;
}
const char * plUUID::AsString() const {
static std::string str;
ToStdString(str);
return str.c_str();
}
void plUUID::CopyFrom( const plUUID * v ) {
if (!v)
Clear();
else
CopyFrom(*v);
}
void plUUID::CopyFrom( const plUUID & v ) {
MemCopy(fData, v.fData, sizeof(fData));
}
/*****************************************************************************
*
* plCreatableUuid
*
***/
//============================================================================
plCreatableUuid::plCreatableUuid () {
}
//============================================================================
plCreatableUuid::plCreatableUuid (const plCreatableUuid & other)
: plUUID(other)
{
}
//============================================================================
plCreatableUuid::plCreatableUuid (const plUUID & other)
: plUUID(other)
{
}

View File

@ -1,88 +1,88 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef plUUID_h_inc
#define plUUID_h_inc
#include "hsTypes.h"
#include "hsStlUtils.h"
#include "pnUtils/pnUtils.h"
#include "pnFactory/plCreatable.h"
class hsStream;
class plUUID
{
// must be first field in class
public:
UInt8 fData[16];
struct Match
{
const plUUID * fGuid;
Match( const plUUID * guid ):fGuid( guid ){}
bool operator()( const plUUID * guid ) const { return guid->IsEqualTo( fGuid );}
};
plUUID();
plUUID( const char * s );
plUUID( const plUUID & other );
plUUID( const Uuid & uuid );
void Clear();
bool IsNull() const;
bool IsSet() const { return !IsNull(); }
void CopyFrom( const plUUID * v );
void CopyFrom( const plUUID & v );
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
void Read( hsStream * s );
void Write( hsStream * s );
operator std::string ( void ) const { return AsStdString();}
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 ); }
operator Uuid () const;
static plUUID Generate();
};
class plCreatableUuid : public plUUID, public plCreatable {
public:
CLASSNAME_REGISTER( plCreatableUuid );
GETINTERFACE_ANY( plCreatableUuid, plCreatable );
plCreatableUuid ();
plCreatableUuid (const plCreatableUuid & other);
plCreatableUuid (const plUUID & other);
void Read( hsStream * s, hsResMgr* ) { plUUID::Read(s); }
void Write( hsStream * s, hsResMgr* ) { plUUID::Write(s); }
};
#endif // plUUID_h_inc
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef plUUID_h_inc
#define plUUID_h_inc
#include "hsTypes.h"
#include "hsStlUtils.h"
#include "pnUtils/pnUtils.h"
#include "pnFactory/plCreatable.h"
class hsStream;
class plUUID
{
// must be first field in class
public:
UInt8 fData[16];
struct Match
{
const plUUID * fGuid;
Match( const plUUID * guid ):fGuid( guid ){}
bool operator()( const plUUID * guid ) const { return guid->IsEqualTo( fGuid );}
};
plUUID();
plUUID( const char * s );
plUUID( const plUUID & other );
plUUID( const Uuid & uuid );
void Clear();
bool IsNull() const;
bool IsSet() const { return !IsNull(); }
void CopyFrom( const plUUID * v );
void CopyFrom( const plUUID & v );
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
void Read( hsStream * s );
void Write( hsStream * s );
operator std::string ( void ) const { return AsStdString();}
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 ); }
operator Uuid () const;
static plUUID Generate();
};
class plCreatableUuid : public plUUID, public plCreatable {
public:
CLASSNAME_REGISTER( plCreatableUuid );
GETINTERFACE_ANY( plCreatableUuid, plCreatable );
plCreatableUuid ();
plCreatableUuid (const plCreatableUuid & other);
plCreatableUuid (const plUUID & other);
void Read( hsStream * s, hsResMgr* ) { plUUID::Read(s); }
void Write( hsStream * s, hsResMgr* ) { plUUID::Write(s); }
};
#endif // plUUID_h_inc

View File

@ -1,128 +1,128 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#include "plUUID.h"
#ifdef HS_BUILD_FOR_UNIX
#include <uuid/uuid.h>
struct plUUIDHelper
{
static inline void CopyToPlasma( plUUID * dst, const uuid_t & src )
{
hsAssert( sizeof(uuid_t)==sizeof(dst->fData), "sizeof(uuid_t)!=sizeof(plUUID)" );
memcpy( (void*)dst->fData, (const void *)src, sizeof( plUUID ) );
}
static inline void CopyToNative( uuid_t & dst, const plUUID * src )
{
hsAssert( sizeof(uuid_t)==sizeof(src->fData), "sizeof(uuid_t)!=sizeof(plUUID)" );
memcpy( (void*)dst, (const void *)src->fData, sizeof( plUUID ) );
}
};
void plUUID::Clear()
{
uuid_t g;
plUUIDHelper::CopyToNative( g, this );
uuid_clear( g );
plUUIDHelper::CopyToPlasma( this, g );
}
bool plUUID::IsNull() const
{
uuid_t g;
plUUIDHelper::CopyToNative( g, this );
return ( uuid_is_null( g )!=0 );
}
void plUUID::CopyFrom( const plUUID * v )
{
memcpy( (void*)fData, (const void*)v->fData, sizeof(fData) );
}
int plUUID::CompareTo( const plUUID * v ) const
{
uuid_t ga, gb;
plUUIDHelper::CopyToNative( ga, this );
plUUIDHelper::CopyToNative( gb, v );
int ans = uuid_compare( ga, gb );
return ans;
}
bool plUUID::IsEqualTo( const plUUID * v ) const
{
return ( CompareTo( v )==0 );
}
bool plUUID::FromString( const char * str )
{
Clear();
if ( !str )
return false;
uuid_t g;
uuid_parse( str, g );
plUUIDHelper::CopyToPlasma( this, g );
return true;
}
bool plUUID::ToString( std::string & out ) const
{
uuid_t g;
plUUIDHelper::CopyToNative( g, this );
char buf[40];
uuid_unparse( g, buf );
out = buf;
return true;
}
std::string plUUID::ToString() const
{
std::string str;
plUUID::ToString( str );
return str;
}
// static
plUUID plUUID::Generate()
{
uuid_t g;
uuid_generate( g );
plUUID result;
plUUIDHelper::CopyToPlasma( &result, g );
return result;
}
#else
// dummy function to prevent a linker warning complaining about no public symbols if the
// contents of the file get compiled out via pre-processor
void _preventLNK4221WarningStub()
{
}
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#include "plUUID.h"
#ifdef HS_BUILD_FOR_UNIX
#include <uuid/uuid.h>
struct plUUIDHelper
{
static inline void CopyToPlasma( plUUID * dst, const uuid_t & src )
{
hsAssert( sizeof(uuid_t)==sizeof(dst->fData), "sizeof(uuid_t)!=sizeof(plUUID)" );
memcpy( (void*)dst->fData, (const void *)src, sizeof( plUUID ) );
}
static inline void CopyToNative( uuid_t & dst, const plUUID * src )
{
hsAssert( sizeof(uuid_t)==sizeof(src->fData), "sizeof(uuid_t)!=sizeof(plUUID)" );
memcpy( (void*)dst, (const void *)src->fData, sizeof( plUUID ) );
}
};
void plUUID::Clear()
{
uuid_t g;
plUUIDHelper::CopyToNative( g, this );
uuid_clear( g );
plUUIDHelper::CopyToPlasma( this, g );
}
bool plUUID::IsNull() const
{
uuid_t g;
plUUIDHelper::CopyToNative( g, this );
return ( uuid_is_null( g )!=0 );
}
void plUUID::CopyFrom( const plUUID * v )
{
memcpy( (void*)fData, (const void*)v->fData, sizeof(fData) );
}
int plUUID::CompareTo( const plUUID * v ) const
{
uuid_t ga, gb;
plUUIDHelper::CopyToNative( ga, this );
plUUIDHelper::CopyToNative( gb, v );
int ans = uuid_compare( ga, gb );
return ans;
}
bool plUUID::IsEqualTo( const plUUID * v ) const
{
return ( CompareTo( v )==0 );
}
bool plUUID::FromString( const char * str )
{
Clear();
if ( !str )
return false;
uuid_t g;
uuid_parse( str, g );
plUUIDHelper::CopyToPlasma( this, g );
return true;
}
bool plUUID::ToString( std::string & out ) const
{
uuid_t g;
plUUIDHelper::CopyToNative( g, this );
char buf[40];
uuid_unparse( g, buf );
out = buf;
return true;
}
std::string plUUID::ToString() const
{
std::string str;
plUUID::ToString( str );
return str;
}
// static
plUUID plUUID::Generate()
{
uuid_t g;
uuid_generate( g );
plUUID result;
plUUIDHelper::CopyToPlasma( &result, g );
return result;
}
#else
// dummy function to prevent a linker warning complaining about no public symbols if the
// contents of the file get compiled out via pre-processor
void _preventLNK4221WarningStub()
{
}
#endif

View File

@ -1,86 +1,86 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#include "plUUID.h"
#ifdef HS_BUILD_FOR_WIN32
#include "hsUtils.h"
#include "hsWindows.h"
#include <rpc.h>
void plUUID::Clear()
{
UuidCreateNil( (GUID *)this );
}
int plUUID::CompareTo( const plUUID * v ) const
{
RPC_STATUS s;
return UuidCompare( (GUID *)this, (GUID *)v, &s );
}
bool plUUID::IsEqualTo( const plUUID * v ) const
{
return ( CompareTo( v )==0 );
}
bool plUUID::IsNull() const
{
RPC_STATUS s;
return 1 == UuidIsNil( (GUID *)this, &s );
}
bool plUUID::FromString( const char * str )
{
Clear();
if ( !str )
return false;
return RPC_S_OK == UuidFromString( (unsigned char *)str, (GUID *)this );
}
bool plUUID::ToStdString( std::string & out ) const
{
out = "";
unsigned char * ubuf;
RPC_STATUS s;
s = UuidToString( (GUID *) this, &ubuf );
bool success = ( s==RPC_S_OK );
if ( success )
out = (char*)ubuf;
RpcStringFree( &ubuf );
return success;
}
// static
plUUID plUUID::Generate()
{
hsAssert(sizeof(plUUID) >= sizeof(GUID), "plUUID size");
plUUID result;
UuidCreate( (GUID *)&result );
return result;
}
#endif
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#include "plUUID.h"
#ifdef HS_BUILD_FOR_WIN32
#include "hsUtils.h"
#include "hsWindows.h"
#include <rpc.h>
void plUUID::Clear()
{
UuidCreateNil( (GUID *)this );
}
int plUUID::CompareTo( const plUUID * v ) const
{
RPC_STATUS s;
return UuidCompare( (GUID *)this, (GUID *)v, &s );
}
bool plUUID::IsEqualTo( const plUUID * v ) const
{
return ( CompareTo( v )==0 );
}
bool plUUID::IsNull() const
{
RPC_STATUS s;
return 1 == UuidIsNil( (GUID *)this, &s );
}
bool plUUID::FromString( const char * str )
{
Clear();
if ( !str )
return false;
return RPC_S_OK == UuidFromString( (unsigned char *)str, (GUID *)this );
}
bool plUUID::ToStdString( std::string & out ) const
{
out = "";
unsigned char * ubuf;
RPC_STATUS s;
s = UuidToString( (GUID *) this, &ubuf );
bool success = ( s==RPC_S_OK );
if ( success )
out = (char*)ubuf;
RpcStringFree( &ubuf );
return success;
}
// static
plUUID plUUID::Generate()
{
hsAssert(sizeof(plUUID) >= sizeof(GUID), "plUUID size");
plUUID result;
UuidCreate( (GUID *)&result );
return result;
}
#endif