diff --git a/Sources/Plasma/Apps/plClient/plClient.h b/Sources/Plasma/Apps/plClient/plClient.h index 92cf6014..474e135d 100644 --- a/Sources/Plasma/Apps/plClient/plClient.h +++ b/Sources/Plasma/Apps/plClient/plClient.h @@ -48,10 +48,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com //#define NEW_CAMERA_CODE #include "HeadSpin.h" +#include + #include "hsBitVector.h" #include "hsTemplates.h" -#include "hsStlUtils.h" #include "pnKeyedObject/hsKeyedObject.h" #include "pnKeyedObject/plUoid.h" #include "plScene/plRenderRequest.h" diff --git a/Sources/Plasma/CoreLib/CMakeLists.txt b/Sources/Plasma/CoreLib/CMakeLists.txt index 9d91b8b3..56e622a8 100644 --- a/Sources/Plasma/CoreLib/CMakeLists.txt +++ b/Sources/Plasma/CoreLib/CMakeLists.txt @@ -27,7 +27,6 @@ set(CoreLib_SOURCES hsRefCnt.cpp hsSafeRefCnt.cpp hsSTLStream.cpp - hsStlUtils.cpp hsStream.cpp hsStringTokenizer.cpp hsTemplates.cpp @@ -69,9 +68,7 @@ set(CoreLib_HEADERS hsQuat.h hsRefCnt.h hsSafeRefCnt.h - hsStlSortUtils.h hsSTLStream.h - hsStlUtils.h hsStream.h hsStringTokenizer.h hsTemplates.h diff --git a/Sources/Plasma/CoreLib/HeadSpin.cpp b/Sources/Plasma/CoreLib/HeadSpin.cpp index 5d09dfdc..b103a326 100644 --- a/Sources/Plasma/CoreLib/HeadSpin.cpp +++ b/Sources/Plasma/CoreLib/HeadSpin.cpp @@ -41,13 +41,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "HeadSpin.h" #include "hsWindows.h" +#include #ifdef _MSC_VER # include #endif -#include "hsStlUtils.h" #include "hsTemplates.h" +#include "plString.h" /////////////////////////////////////////////////////////////////////////// @@ -214,6 +215,7 @@ void hsStatusMessageF(const char * fmt, ...) #endif +// TODO: Deprecate these in favor of plString char * hsFormatStr(const char * fmt, ...) { va_list args; @@ -225,8 +227,7 @@ char * hsFormatStr(const char * fmt, ...) char * hsFormatStrV(const char * fmt, va_list args) { - std::string buf; - xtl::formatv(buf,fmt,args); + plString buf = plString::IFormat(fmt, args); return hsStrcpy(buf.c_str()); } @@ -460,6 +461,8 @@ char *hsWStringToString( const wchar_t *str ) // char** DisplaySystemVersion() { + // TODO: I so want to std::vector this, but that requires + // including more headers in HeadSpin.h :( #if HS_BUILD_FOR_WIN32 #ifndef VER_SUITE_PERSONAL #define VER_SUITE_PERSONAL 0x200 @@ -499,6 +502,15 @@ char** DisplaySystemVersion() if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1 ) versionStrs.Append(hsStrcpy ("Microsoft Windows XP ")); + if ( osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0 ) + versionStrs.Append(hsStrcpy ("Microsoft Windows Vista ")); + + if ( osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 1 ) + versionStrs.Append(hsStrcpy ("Microsoft Windows 7 ")); + + if ( osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 2 ) + versionStrs.Append(hsStrcpy ("Microsoft Windows 8 ")); + // Test for product type. if( bOsVersionInfoEx ) @@ -545,7 +557,7 @@ char** DisplaySystemVersion() if ( osvi.dwMajorVersion <= 4 ) { - versionStrs.Append(hsStrcpy (xtl::format("version %d.%d %s (Build %d)\n", + versionStrs.Append(hsStrcpy (plString::Format("version %d.%d %s (Build %d)\n", osvi.dwMajorVersion, osvi.dwMinorVersion, osvi.szCSDVersion, @@ -553,7 +565,7 @@ char** DisplaySystemVersion() } else { - versionStrs.Append(hsStrcpy (xtl::format("%s (Build %d)\n", + versionStrs.Append(hsStrcpy (plString::Format("%s (Build %d)\n", osvi.szCSDVersion, osvi.dwBuildNumber & 0xFFFF).c_str())); } diff --git a/Sources/Plasma/CoreLib/hsSTLStream.h b/Sources/Plasma/CoreLib/hsSTLStream.h index b4144679..84add5da 100644 --- a/Sources/Plasma/CoreLib/hsSTLStream.h +++ b/Sources/Plasma/CoreLib/hsSTLStream.h @@ -44,7 +44,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define _hsSTLStream_h_inc_ #include "hsStream.h" -#include "hsStlUtils.h" // // In-memory only diff --git a/Sources/Plasma/CoreLib/hsStlSortUtils.h b/Sources/Plasma/CoreLib/hsStlSortUtils.h deleted file mode 100644 index 4c5d0bca..00000000 --- a/Sources/Plasma/CoreLib/hsStlSortUtils.h +++ /dev/null @@ -1,65 +0,0 @@ -/*==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 . - -Additional permissions under GNU GPL version 3 section 7 - -If you modify this Program, or any covered work, by linking or -combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK, -NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent -JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK -(or a modified version of those libraries), -containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA, -PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG -JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the -licensors of this Program grant you additional -permission to convey the resulting work. Corresponding Source for a -non-source form of such a combination shall include the source code for -the parts of OpenSSL and IJG JPEG Library used as well as that of the covered -work. - -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 hsStlSortUtils_inc -#define hsStlSortUtils_inc - -// These get used a lot in char * STL maps, so lets just have them in one place - -class stringSorter -{ -public: - bool operator() (const char *s1, const char *s2) const - { - return (strcmp(s1,s2) < 0); - } -}; - -class stringISorter -{ -public: - bool operator() (const char *s1, const char *s2) const - { - return (stricmp(s1,s2) < 0); - } -}; - -#endif // hsStlSortUtils_inc diff --git a/Sources/Plasma/CoreLib/hsStlUtils.cpp b/Sources/Plasma/CoreLib/hsStlUtils.cpp deleted file mode 100644 index f93e0962..00000000 --- a/Sources/Plasma/CoreLib/hsStlUtils.cpp +++ /dev/null @@ -1,447 +0,0 @@ -/*==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 . - -Additional permissions under GNU GPL version 3 section 7 - -If you modify this Program, or any covered work, by linking or -combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK, -NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent -JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK -(or a modified version of those libraries), -containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA, -PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG -JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the -licensors of this Program grant you additional -permission to convey the resulting work. Corresponding Source for a -non-source form of such a combination shall include the source code for -the parts of OpenSSL and IJG JPEG Library used as well as that of the covered -work. - -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 "hsStlUtils.h" - -// stl extensions -namespace xtl { - -//std::string -std::string & trimleft(std::string & s, const char * charset) -{ - s.erase(0, s.find_first_not_of(charset)); - return s; -} - -std::wstring & trimleft(std::wstring & s, const wchar_t * charset) -{ - s.erase(0, s.find_first_not_of(charset)); - return s; -} - -std::string & trimright(std::string & s, const char * charset) -{ - int idx = s.find_last_not_of(charset); - - if (std::string::npos == idx) - { - s.erase(); - } - else - { - char c = s.at(idx); - s.erase(idx, std::string::npos); - s.append(1, c); - } - - return s; -} - -std::wstring & trimright(std::wstring & s, const wchar_t * charset) -{ - int idx = s.find_last_not_of(charset); - - if (std::wstring::npos == idx) - { - s.erase(); - } - else - { - wchar_t c = s.at(idx); - s.erase(idx, std::string::npos); - s.append(1, c); - } - - return s; -} - -std::string & trim(std::string & s, const char * charset) -{ - trimleft(s,charset); - trimright(s,charset); - return s; -} - -std::wstring & trim(std::wstring & s, const wchar_t * charset) -{ - trimleft(s,charset); - trimright(s,charset); - return s; -} - -//xtl::istring -xtl::istring & trimleft(xtl::istring & s, const char * charset) -{ - s.erase(0, s.find_first_not_of(charset)); - return s; -} - -xtl::iwstring & trimleft(xtl::iwstring & s, const wchar_t * charset) -{ - s.erase(0, s.find_first_not_of(charset)); - return s; -} - -xtl::istring & trimright(xtl::istring & s, const char * charset) -{ - int idx = s.find_last_not_of(charset); - - if (xtl::istring::npos == idx) - { - s.erase(); - } - else - { - char c = s.at(idx); - s.erase(idx, xtl::istring::npos); - s.append(1, c); - } - - return s; -} - -xtl::iwstring & trimright(xtl::iwstring & s, const wchar_t * charset) -{ - int idx = s.find_last_not_of(charset); - - if (xtl::iwstring::npos == idx) - { - s.erase(); - } - else - { - wchar_t c = s.at(idx); - s.erase(idx, xtl::iwstring::npos); - s.append(1, c); - } - - return s; -} - -xtl::istring & trim(xtl::istring & s, const char * charset) -{ - trimleft(s,charset); - trimright(s,charset); - return s; -} - -xtl::iwstring & trim(xtl::iwstring & s, const wchar_t * charset) -{ - trimleft(s,charset); - trimright(s,charset); - return s; -} - -// c-string -std::string trim(const char * s, const char * charset) -{ - std::string result = s; - trimleft(result,charset); - trimright(result,charset); - return result; -} - -std::wstring trim(const wchar_t * s, const wchar_t * charset) -{ - std::wstring result = s; - trimleft(result,charset); - trimright(result,charset); - return result; -} - - -// format -std::string format(const char * fmt, ...) -{ - std::string result; - va_list args; - va_start(args,fmt); - formatv(result,fmt,args); - va_end(args); - return result; -} - -std::wstring format(const wchar_t * fmt, ...) -{ - std::wstring result; - va_list args; - va_start(args,fmt); - formatv(result,fmt,args); - va_end(args); - return result; -} - -std::string formatv(const char * fmt, va_list args) -{ - std::string result; - formatv( result, fmt, args ); - return result; -} - -std::wstring formatv(const wchar_t * fmt, va_list args) -{ - std::wstring result; - formatv( result, fmt, args ); - return result; -} - -bool format(std::string & out, const char * fmt, ...) -{ - va_list args; - va_start(args,fmt); - bool r = formatv(out,fmt,args); - va_end(args); - return r; -} - -bool format(std::wstring & out, const wchar_t * fmt, ...) -{ - va_list args; - va_start(args,fmt); - bool r = formatv(out,fmt,args); - va_end(args); - return r; -} - -bool formatv(std::string & out, const char * fmt, va_list args) -{ -#define kBufSz 2048 - - char buf[kBufSz]; - char * pbuf = buf; - int len = 0; - int attempts = 0; - bool success = false; - const int kMaxAttempts = 40; - - do - { - int maxlen = kBufSz*attempts+kBufSz-1; - len = hsVsnprintf(pbuf,maxlen,fmt,args); - attempts++; - success = (len>=0 && len=0 && len StringVector; -typedef std::vector WStringVector; -typedef std::list StringList; -typedef std::list WStringList; -typedef std::set StringSet; -typedef std::set WStringSet; - -template bool GetStringGroup(const std::string& s, StringList& group, char sep); -template bool GetStringGroup(const std::wstring& s, WStringList& group, wchar_t sep); -template bool GetStringGroup(const std::string& s, StringVector& group, char sep); -template bool GetStringGroup(const std::wstring& s, WStringVector& group, wchar_t sep); -template bool GetStringGroup(const std::string& s, StringSet& group, char sep); -template bool GetStringGroup(const std::wstring& s, WStringSet& group, wchar_t sep); - -template bool GetStringGroup(const std::string& s, T& group, char sep) -{ - bool ret = false; - std::string::size_type oldpos = 0, newpos = 0; - - if (!(s.empty())) - { - do - { - newpos = s.find(',',oldpos); - group.insert(group.end(),s.substr(oldpos,newpos)); - if (newpos != s.npos) - oldpos = newpos+1; - } - while(newpos != s.npos); - ret = true; - } - - return ret; -} - -template bool GetStringGroup(const std::wstring& s, T& group, wchar_t sep) -{ - bool ret = false; - std::wstring::size_type oldpos = 0, newpos = 0; - - if (!(s.empty())) - { - do - { - newpos = s.find(L',',oldpos); - group.insert(group.end(),s.substr(oldpos,newpos)); - if (newpos != s.npos) - oldpos = newpos+1; - } while(newpos != s.npos); - ret = true; - } - - return ret; -} - - -template bool GetStringGroupAsString(const StringList& group, std::string& s, char sep); -template bool GetStringGroupAsString(const WStringList& group, std::wstring& s, wchar_t sep); -template bool GetStringGroupAsString(const StringVector& group, std::string& s, char sep); -template bool GetStringGroupAsString(const WStringVector& group, std::wstring& s, wchar_t sep); -template bool GetStringGroupAsString(const StringSet& group, std::string& s, char sep); -template bool GetStringGroupAsString(const WStringSet& group, std::wstring& s, wchar_t sep); - -template bool GetStringGroupAsString(const T& group, std::string& s, char sep) -{ - typename T::const_iterator it = group.begin(); - bool fst = true; - while (it != group.end()) - { - if (!fst) - s += ","; - else - fst = false; - s+= (*it).c_str(); - it++; - } - - return true; -} - -template bool GetStringGroupAsString(const T& group, std::wstring& s, wchar_t sep) -{ - typename T::const_iterator it = group.begin(); - bool fst = true; - while (it != group.end()) - { - if (!fst) - s += L","; - else - fst = false; - s+= (*it).c_str(); - it++; - } - - return true; -} - - -} // namespace std - diff --git a/Sources/Plasma/CoreLib/hsStlUtils.h b/Sources/Plasma/CoreLib/hsStlUtils.h deleted file mode 100644 index f419f997..00000000 --- a/Sources/Plasma/CoreLib/hsStlUtils.h +++ /dev/null @@ -1,210 +0,0 @@ -/*==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 . - -Additional permissions under GNU GPL version 3 section 7 - -If you modify this Program, or any covered work, by linking or -combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK, -NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent -JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK -(or a modified version of those libraries), -containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA, -PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG -JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the -licensors of this Program grant you additional -permission to convey the resulting work. Corresponding Source for a -non-source form of such a combination shall include the source code for -the parts of OpenSSL and IJG JPEG Library used as well as that of the covered -work. - -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 hsStlUtils_h_inc -#define hsStlUtils_h_inc - - -#include "HeadSpin.h" -#include -#include -#include -#include -#include -#include -#include - - -/***************************************************************************** -* -* stl extensions -* -***/ -namespace xtl -{ - -// Why oh why doesn't stl have copy_if? -// See Effective STL [Meyers 2001] Item 36. -template< typename InIt, typename OutIt, typename Pred > -OutIt copy_if( InIt srcBegin, InIt srcEnd, OutIt dstBegin, Pred pred ) -{ - while ( srcBegin!=srcEnd ) - { - if ( pred( *srcBegin ) ) - *dstBegin++ = *srcBegin; - ++srcBegin; - } - return dstBegin; -} - - - -// useful when clearing a vector/list/set of pointers that need to be deleted. -// use like: -// std::vector vec; -// std::for_each(vec.begin(),vec.end(),xtl::delete_ptr()); -// vec.clear(); - -struct delete_ptr -{ - template< class T > void operator()( T * p ) const { delete p;} -}; - -// useful when clearing a map of pointers that need to be deleted. -// use like: -// typedef std::map foomap; -// foomap m; -// std::for_each(m.begin(),m.end(),xtl::delete_map_ptr_T()); -// m.clear(); - -template< class A > -struct delete_map_ptr_T -{ - void operator()( typename A::value_type & pair ) const { delete pair.second;} -}; - -// case insensitive string comparer -// useful in maps that use strings -struct stricmp_less : public std::binary_function -{ - bool operator()(const std::string & _X, const std::string & _Y) const - {return ( stricmp(_X.c_str(),_Y.c_str()) < 0); } -}; -struct wstricmp_less : public std::binary_function -{ - bool operator()(const std::wstring & _X, const std::wstring & _Y) const - {return ( wcsicmp(_X.c_str(),_Y.c_str()) < 0); } -}; - -// struct stricmp_char_traits -// case insensitive char_traits. used in creating istring class below -#ifdef __SGI_STL_PORT -struct stricmp_char_traits : public __std_alias::char_traits< char > -#else -struct stricmp_char_traits : public std::char_traits< char > -#endif -{ - static int compare(const char * A, const char * B, size_t N) - { - for (size_t I=0; I -#else -struct wstricmp_char_traits : public std::char_traits< wchar_t > -#endif -{ - static int compare(const wchar_t * A, const wchar_t * B, size_t N) - { - for (size_t I=0; I istring; -typedef std::basic_string iwstring; - -// std::string trim -std::string & trimleft(std::string & s, const char * charset=" \t\n\r"); -std::wstring & trimleft(std::wstring & s, const wchar_t * charset=L" \t\n\r"); -std::string & trimright(std::string & s, const char * charset=" \t\n\r"); -std::wstring & trimright(std::wstring & s, const wchar_t * charset=L" \t\n\r"); -std::string & trim(std::string & s, const char * charset=" \t\n\r"); -std::wstring & trim(std::wstring & s, const wchar_t * charset=L" \t\n\r"); -// xtl::istring trim -xtl::istring & trimleft(xtl::istring & s, const char * charset=" \t\n\r"); -xtl::iwstring & trimleft(xtl::iwstring & s, const wchar_t * charset=L" \t\n\r"); -xtl::istring & trimright(xtl::istring & s, const char * charset=" \t\n\r"); -xtl::iwstring & trimright(xtl::iwstring & s, const wchar_t * charset=L" \t\n\r"); -xtl::istring & trim(xtl::istring & s, const char * charset=" \t\n\r"); -xtl::iwstring & trim(xtl::iwstring & s, const wchar_t * charset=L" \t\n\r"); -// c-string trim -std::string trim(const char * s, const char * charset=" \t\n\r"); -std::wstring trim(const wchar_t * s, const wchar_t * charset=L" \t\n\r"); -// format -std::string format(const char * fmt, ...); -std::wstring format(const wchar_t * fmt, ...); -std::string formatv(const char * fmt, va_list args); -std::wstring formatv(const wchar_t * fmt, va_list args); -bool format(std::string & out, const char * fmt, ...); -bool format(std::wstring & out, const wchar_t * fmt, ...); -bool formatv(std::string & out, const char * fmt, va_list args); -bool formatv(std::wstring & out, const wchar_t * fmt, va_list args); - - -template bool GetStringGroup(const std::string& s, T& group, char sep = ','); -template bool GetStringGroup(const std::wstring& s, T& group, wchar_t sep = L','); -template bool GetStringGroupAsString(const T& group, std::string& s, char sep = ','); -template bool GetStringGroupAsString(const T& group, std::wstring& s, wchar_t sep = L','); - - -} // namespace xtd - - - -#endif // hsStlUtils_h_inc diff --git a/Sources/Plasma/CoreLib/hsStream.cpp b/Sources/Plasma/CoreLib/hsStream.cpp index e748b155..ba9610f6 100644 --- a/Sources/Plasma/CoreLib/hsStream.cpp +++ b/Sources/Plasma/CoreLib/hsStream.cpp @@ -45,7 +45,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTemplates.h" -#include "hsStlUtils.h" #if HS_BUILD_FOR_UNIX #include @@ -55,7 +54,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #if HS_BUILD_FOR_WIN32 #include #endif -#include "hsStlUtils.h" ////////////////////////////////////////////////////////////////////////////////// @@ -123,9 +121,8 @@ uint32_t hsStream::WriteFmt(const char * fmt, ...) uint32_t hsStream::WriteFmtV(const char * fmt, va_list av) { - std::string buf; - xtl::formatv( buf, fmt, av ); - return Write( buf.length(), buf.data() ); + plString buf = plString::IFormat(fmt, av); + return Write( buf.GetSize(), buf.c_str() ); } uint32_t hsStream::WriteSafeStringLong(const plString &string) diff --git a/Sources/Plasma/CoreLib/hsStream.h b/Sources/Plasma/CoreLib/hsStream.h index ce7919c4..34fac020 100644 --- a/Sources/Plasma/CoreLib/hsStream.h +++ b/Sources/Plasma/CoreLib/hsStream.h @@ -83,6 +83,9 @@ public: hsStream() : fBytesRead(0), fPosition(0) {} virtual ~hsStream() { } + // Pre-filename-stringification shortcut: + bool Open_TEMP(const plString & filename, const char * mode = "rb") { return Open(filename.c_str(), mode); } + virtual bool Open(const char *, const char * = "rb")=0; virtual bool Open(const wchar_t *, const wchar_t * = L"rb")=0; virtual bool Close()=0; diff --git a/Sources/Plasma/CoreLib/plGeneric.h b/Sources/Plasma/CoreLib/plGeneric.h index c73897a8..39d0f19b 100644 --- a/Sources/Plasma/CoreLib/plGeneric.h +++ b/Sources/Plasma/CoreLib/plGeneric.h @@ -43,7 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define __PLGENERIC_H__ #include "hsStream.h" -#include "hsStlUtils.h" class plGeneric { diff --git a/Sources/Plasma/CoreLib/plString.cpp b/Sources/Plasma/CoreLib/plString.cpp index d56d2e4c..57c0c422 100644 --- a/Sources/Plasma/CoreLib/plString.cpp +++ b/Sources/Plasma/CoreLib/plString.cpp @@ -163,7 +163,7 @@ void plString::IConvertFromUtf16(const uint16_t *utf16, size_t size) while (sp < utf16 + size) { if (*sp >= 0xD800 && *sp <= 0xDFFF) { // Surrogate pair - unsigned int unichar = 0x10000; + UniChar unichar = 0x10000; if (sp + 1 >= utf16 + size) { hsAssert(0, "Incomplete surrogate pair in UTF-16 data"); @@ -204,19 +204,25 @@ void plString::IConvertFromWchar(const wchar_t *wstr, size_t size) // We assume that if sizeof(wchar_t) == 2, the data is UTF-16 already IConvertFromUtf16((const uint16_t *)wstr, size); #else + IConvertFromUtf32((const UniChar *)wstr, size); +#endif +} + +void plString::IConvertFromUtf32(const UniChar *ustr, size_t size) +{ fUtf8Buffer = plStringBuffer(); - if (wstr == nil) + if (ustr == nil) return; if ((int32_t)size < 0) - size = wcsnlen(wstr, -(int32_t)size); + size = ustrlen(ustr, -(int32_t)size); // Calculate the UTF-8 size size_t convlen = 0; - const wchar_t *sp = wstr; - while (sp < wstr + size) { + const UniChar *sp = ustr; + while (sp < ustr + size) { if (*sp > 0x10FFFF) { - hsAssert(0, "UCS-4 character out of range"); + hsAssert(0, "UTF-32 character out of range"); convlen += 3; // Use U+FFFD for release builds } else if (*sp > 0xFFFF) @@ -233,8 +239,8 @@ void plString::IConvertFromWchar(const wchar_t *wstr, size_t size) // And perform the actual conversion char *utf8 = fUtf8Buffer.CreateWritableBuffer(convlen); char *dp = utf8; - sp = wstr; - while (sp < wstr + size) { + sp = ustr; + while (sp < ustr + size) { if (*sp > 0x10FFFF) { // Character out of range; Use U+FFFD instead *dp++ = 0xE0 | ((BADCHAR_REPLACEMENT >> 12) & 0x0F); @@ -258,7 +264,6 @@ void plString::IConvertFromWchar(const wchar_t *wstr, size_t size) ++sp; } utf8[convlen] = 0; -#endif } void plString::IConvertFromIso8859_1(const char *astr, size_t size) @@ -327,7 +332,7 @@ plStringBuffer plString::ToUtf16() const uint16_t *dp = ustr; sp = utf8; while (sp < utf8 + srcSize) { - unsigned int unichar; + UniChar unichar; if ((*sp & 0xF8) == 0xF0) { unichar = (*sp++ & 0x07) << 18; unichar |= (*sp++ & 0x3F) << 12; @@ -361,11 +366,18 @@ plStringBuffer plString::ToWchar() const plStringBuffer utf16 = ToUtf16(); return *reinterpret_cast*>(&utf16); #else - plStringBuffer result; + plUnicodeBuffer utf32 = GetUnicodeArray(); + return *reinterpret_cast*>(&utf32); +#endif +} + +plStringBuffer plString::ToIso8859_1() const +{ + plStringBuffer result; if (IsEmpty()) return result; - // Calculate the UCS-4 size + // Calculate the ASCII size size_t convlen = 0; const char *utf8 = fUtf8Buffer.GetData(); const char *sp = utf8; @@ -383,11 +395,11 @@ plStringBuffer plString::ToWchar() const } // And perform the actual conversion - wchar_t *wstr = result.CreateWritableBuffer(convlen); - wchar_t *dp = wstr; + char *astr = result.CreateWritableBuffer(convlen); + char *dp = astr; sp = utf8; while (sp < utf8 + srcSize) { - unsigned int unichar; + UniChar unichar; if ((*sp & 0xF8) == 0xF0) { unichar = (*sp++ & 0x07) << 18; unichar |= (*sp++ & 0x3F) << 12; @@ -403,21 +415,20 @@ plStringBuffer plString::ToWchar() const } else { unichar = *sp++; } - *dp++ = unichar; + *dp++ = (unichar < 0xFF) ? unichar : '?'; } - wstr[convlen] = 0; + astr[convlen] = 0; return result; -#endif } -plStringBuffer plString::ToIso8859_1() const +plUnicodeBuffer plString::GetUnicodeArray() const { - plStringBuffer result; + plUnicodeBuffer result; if (IsEmpty()) return result; - // Calculate the ASCII size + // Calculate the UCS-4 size size_t convlen = 0; const char *utf8 = fUtf8Buffer.GetData(); const char *sp = utf8; @@ -435,11 +446,11 @@ plStringBuffer plString::ToIso8859_1() const } // And perform the actual conversion - char *astr = result.CreateWritableBuffer(convlen); - char *dp = astr; + UniChar *ustr = result.CreateWritableBuffer(convlen); + UniChar *dp = ustr; sp = utf8; while (sp < utf8 + srcSize) { - unsigned int unichar; + UniChar unichar; if ((*sp & 0xF8) == 0xF0) { unichar = (*sp++ & 0x07) << 18; unichar |= (*sp++ & 0x3F) << 12; @@ -455,25 +466,8 @@ plStringBuffer plString::ToIso8859_1() const } else { unichar = *sp++; } - *dp++ = (unichar < 0xFF) ? unichar : '?'; + *dp++ = unichar; } - astr[convlen] = 0; - - return result; -} - -plStringBuffer plString::GetUnicodeArray() const -{ - plStringBuffer result; - if (IsEmpty()) - return result; - - size_t convlen = GetUniCharCount(); - UniChar *ustr = result.CreateWritableBuffer(convlen); - iterator iter = GetIterator(); - size_t dp = 0; - while (!iter.AtEnd()) - ustr[dp++] = *iter++; ustr[convlen] = 0; return result; @@ -518,18 +512,24 @@ plString plString::IFormat(const char *fmt, va_list vptr) int size = 4096; for ( ;; ) { va_copy(vptr, vptr_save); - std::auto_ptr bigbuffer(new char[size]); - chars = vsnprintf(bigbuffer.get(), size, fmt, vptr); - if (chars >= 0) - return plString::FromUtf8(bigbuffer.get(), chars); + plStringBuffer bigbuffer; + char *data = bigbuffer.CreateWritableBuffer(size-1); + chars = vsnprintf(data, size, fmt, vptr); + if (chars >= 0) { + // We need to construct a new string here so the length + // parameter is accurate :( + return plString::FromUtf8(bigbuffer.GetData(), chars); + } size *= 2; + hsAssert(size > 0, "Formatted string output is waaaaay too long"); } } else if (chars >= 256) { va_copy(vptr, vptr_save); - std::unique_ptr bigbuffer(new char[chars+1]); - vsnprintf(bigbuffer.get(), chars+1, fmt, vptr); - return plString::FromUtf8(bigbuffer.get(), chars); + plStringBuffer bigbuffer; + char *data = bigbuffer.CreateWritableBuffer(chars); + vsnprintf(data, chars+1, fmt, vptr); + return bigbuffer; } return plString::FromUtf8(buffer, chars); @@ -754,6 +754,15 @@ std::vector plString::Split(const char *split, size_t maxSplits) const return result; } +plString plString::Fill(size_t count, char c) +{ + plStringBuffer buf; + char *data = buf.CreateWritableBuffer(count + 1); + memset(data, c, count); + data[count] = 0; + return buf; +} + plString operator+(const plString &left, const plString &right) { plString cat; @@ -822,3 +831,11 @@ plStringStream &plStringStream::operator<<(unsigned int num) snprintf(buffer, 12, "%u", num); return operator<<(buffer); } + +size_t ustrlen(const UniChar *ustr, size_t max) +{ + size_t length = 0; + for ( ; *ustr++ && max--; ++length) + ; + return length; +} diff --git a/Sources/Plasma/CoreLib/plString.h b/Sources/Plasma/CoreLib/plString.h index a8efd713..bfecb1de 100644 --- a/Sources/Plasma/CoreLib/plString.h +++ b/Sources/Plasma/CoreLib/plString.h @@ -49,6 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com typedef unsigned int UniChar; #define SSO_CHARS (16) +#define WHITESPACE_CHARS " \t\n\r" template class plStringBuffer @@ -121,7 +122,6 @@ public: const _Ch *GetData() const { return IHaveACow() ? fData->fStringData : fShort; } size_t GetSize() const { return fSize; } - operator const _Ch *() const { return GetData(); } // From Haxxia with love @@ -142,14 +142,15 @@ public: } }; +typedef plStringBuffer plUnicodeBuffer; + class plString { +public: enum { kSizeAuto = (size_t)(0x80000000) }; - -public: static const plString Null; private: @@ -158,6 +159,7 @@ private: void IConvertFromUtf8(const char *utf8, size_t size); void IConvertFromUtf16(const uint16_t *utf16, size_t size); void IConvertFromWchar(const wchar_t *wstr, size_t size); + void IConvertFromUtf32(const UniChar *ustr, size_t size); void IConvertFromIso8859_1(const char *astr, size_t size); public: @@ -166,10 +168,12 @@ public: plString(const char *cstr) { IConvertFromUtf8(cstr, kSizeAuto); } plString(const plString ©) : fUtf8Buffer(copy.fUtf8Buffer) { } plString(const plStringBuffer &init) { operator=(init); } + plString(const plUnicodeBuffer &init) { IConvertFromUtf32(init.GetData(), init.GetSize()); } plString &operator=(const char *cstr) { IConvertFromUtf8(cstr, kSizeAuto); return *this; } plString &operator=(const plString ©) { fUtf8Buffer = copy.fUtf8Buffer; return *this; } plString &operator=(const plStringBuffer &init); + plString &operator=(const plUnicodeBuffer &init) { IConvertFromUtf32(init.GetData(), init.GetSize()); return *this; } plString &operator+=(const char *cstr) { return operator=(*this + cstr); } plString &operator+=(const plString &str) { return operator=(*this + str); } @@ -213,7 +217,7 @@ public: plStringBuffer ToIso8859_1() const; // For use in displaying characters in a GUI - plStringBuffer GetUnicodeArray() const; + plUnicodeBuffer GetUnicodeArray() const; size_t GetSize() const { return fUtf8Buffer.GetSize(); } bool IsEmpty() const { return fUtf8Buffer.GetSize() == 0; } @@ -276,15 +280,15 @@ public: int Find(const plString &str, CaseSensitivity sense = kCaseSensitive) const { return Find(str.c_str(), sense); } - plString TrimLeft(const char *charset = " \t\n\r") const; - plString TrimRight(const char *charset = " \t\n\r") const; - plString Trim(const char *charset = " \t\n\r") const; + plString TrimLeft(const char *charset = WHITESPACE_CHARS) const; + plString TrimRight(const char *charset = WHITESPACE_CHARS) const; + plString Trim(const char *charset = WHITESPACE_CHARS) const; plString Substr(int start, size_t size = kSizeAuto) const; plString Left(size_t size) const { return Substr(0, size); } plString Right(size_t size) const { return Substr(GetSize() - size, size); } - // NOTE: Does ::Compare(blah, kCaseInsensitive) make more sense? If + // NOTE: Does Compare(blah, kCaseInsensitive) make more sense? If // so, use that instead -- it's faster and more efficient! plString ToUpper() const; plString ToLower() const; @@ -294,7 +298,9 @@ public: // all delimiters and only returns the pieces left between them), whereas // Split will split on a full string, returning whatever is left between. std::vector Split(const char *split, size_t maxSplits = kSizeAuto) const; - std::vector Tokenize(const char *delims = " \t\r\n\f\v") const; + std::vector Tokenize(const char *delims = WHITESPACE_CHARS) const; + + static plString Fill(size_t count, char c); public: struct less @@ -321,108 +327,6 @@ public: { return _L.Compare(_R, kCaseInsensitive) == 0; } }; -public: - struct iterator - { - iterator() : m_ptr(nil), m_end(nil) { } - iterator(const iterator ©) : m_ptr(copy.m_ptr), m_end(copy.m_end) { } - - iterator &operator=(const iterator ©) - { m_ptr = copy.m_ptr; m_end = copy.m_end; return *this; } - - iterator &operator++() - { - if ((*m_ptr & 0xF8) == 0xF0) - m_ptr += 4; - else if ((*m_ptr & 0xF0) == 0xE0) - m_ptr += 3; - else if ((*m_ptr & 0xE0) == 0xC0) - m_ptr += 2; - else - m_ptr += 1; - return *this; - } - - iterator operator++(int) - { - iterator iter_save = *this; - (void) operator++(); - return iter_save; - } - - iterator &operator+=(size_t delta) - { - while (delta) { - operator++(); - --delta; - } - return *this; - } - - iterator operator+(size_t delta) const - { - iterator copy(*this); - copy += delta; - return copy; - } - - int operator-(const iterator &other) const - { - return (int)(m_ptr - other.m_ptr); - } - - bool operator==(const iterator &other) const { return m_ptr == other.m_ptr; } - bool operator!=(const iterator &other) const { return m_ptr != other.m_ptr; } - bool operator<(const iterator &other) const { return m_ptr < other.m_ptr; } - bool operator>(const iterator &other) const { return m_ptr > other.m_ptr; } - bool operator<=(const iterator &other) const { return m_ptr <= other.m_ptr; } - bool operator>=(const iterator &other) const { return m_ptr >= other.m_ptr; } - - UniChar operator*() const - { - UniChar ch; - if ((*m_ptr & 0xF8) == 0xF0) { - ch = (m_ptr[0] & 0x07) << 18; - ch |= (m_ptr[1] & 0x3F) << 12; - ch |= (m_ptr[2] & 0x3F) << 6; - ch |= (m_ptr[3] & 0x3F); - } else if ((*m_ptr & 0xF0) == 0xE0) { - ch = (m_ptr[0] & 0x0F) << 12; - ch |= (m_ptr[1] & 0x3F) << 6; - ch |= (m_ptr[2] & 0x3F); - } else if ((*m_ptr & 0xE0) == 0xC0) { - ch = (m_ptr[0] & 0x1F) << 6; - ch |= (m_ptr[1] & 0x3F); - } else { - ch = m_ptr[0]; - } - return ch; - } - - bool AtEnd() const { return m_ptr >= m_end; } - bool IsValid() const { return m_ptr != 0; } - - private: - friend class plString; - iterator(const char *ptr, size_t size) : m_ptr(ptr), m_end(ptr + size) { } - - const char *m_ptr; - const char *m_end; - }; - - iterator GetIterator() const { return iterator(c_str(), GetSize()); } - - size_t GetUniCharCount() const - { - iterator iter = GetIterator(); - size_t count = 0; - while (!iter.AtEnd()) { - ++iter; - ++count; - } - return count; - } - private: friend plString operator+(const plString &left, const plString &right); friend plString operator+(const plString &left, const char *right); @@ -464,4 +368,6 @@ private: size_t fLength; }; +size_t ustrlen(const UniChar *ustr, size_t max = plString::kSizeAuto); + #endif //plString_Defined diff --git a/Sources/Plasma/FeatureLib/pfAnimation/pfObjectFlocker.cpp b/Sources/Plasma/FeatureLib/pfAnimation/pfObjectFlocker.cpp index 89227e2f..302a919b 100644 --- a/Sources/Plasma/FeatureLib/pfAnimation/pfObjectFlocker.cpp +++ b/Sources/Plasma/FeatureLib/pfAnimation/pfObjectFlocker.cpp @@ -40,7 +40,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "HeadSpin.h" -#include "hsStlUtils.h" #include "hsMatrix44.h" #include "hsGeometry3.h" #include "plgDispatch.h" diff --git a/Sources/Plasma/FeatureLib/pfAnimation/plAnimDebugList.cpp b/Sources/Plasma/FeatureLib/pfAnimation/plAnimDebugList.cpp index 3df1e750..cc1fa04b 100644 --- a/Sources/Plasma/FeatureLib/pfAnimation/plAnimDebugList.cpp +++ b/Sources/Plasma/FeatureLib/pfAnimation/plAnimDebugList.cpp @@ -39,7 +39,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ -#include "hsStlUtils.h" #include "hsResMgr.h" #include "hsTemplates.h" #include "hsTimer.h" diff --git a/Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp b/Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp index 0727502a..e94c864c 100644 --- a/Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp +++ b/Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp @@ -40,6 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "HeadSpin.h" +#include #include "plCameraBrain.h" #include "hsTimer.h" diff --git a/Sources/Plasma/FeatureLib/pfCamera/plVirtualCamNeu.cpp b/Sources/Plasma/FeatureLib/pfCamera/plVirtualCamNeu.cpp index 9f85f786..e42d4a59 100644 --- a/Sources/Plasma/FeatureLib/pfCamera/plVirtualCamNeu.cpp +++ b/Sources/Plasma/FeatureLib/pfCamera/plVirtualCamNeu.cpp @@ -41,6 +41,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "HeadSpin.h" +#include + #include "plVirtualCamNeu.h" #include "plCameraModifier.h" #include "plCameraBrain.h" diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp index 31f17977..5c7676b3 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp @@ -161,7 +161,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plStatusLog/plStatusLog.h" #include "pnTimer/pnBuildDates.h" -#include "hsStlUtils.h" #include "hsTemplates.h" #include "plResMgr/plResManagerHelper.h" @@ -538,7 +537,7 @@ PF_CONSOLE_CMD(Stats, ListGroups, "", "Prints the names of all the stat groups t plProfileManagerFull::GroupSet::iterator it; for (it = groups.begin(); it != groups.end(); it++) - PrintString((char*)*it); + PrintString(it->c_str()); } PF_CONSOLE_CMD(Stats, ListLaps, "", "Prints the names of all the stats with laps to the console") diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp index b8e31b75..11cc95e0 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp @@ -88,7 +88,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plStatusLog/plStatusLog.h" -#include "hsStlUtils.h" #include "hsTemplates.h" #include "plVault/plVault.h" diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.h b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.h index 3d065e9a..b245f463 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.h +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.h @@ -56,7 +56,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define _pfConsoleDirSrc_h #include "HeadSpin.h" -#include "hsStlUtils.h" +#include + #include "pfConsoleCore/pfConsoleEngine.h" //// pfConsoleDirSrc Class Definition //////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfDispatchLog.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfDispatchLog.cpp index 968f6599..96521fbd 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfDispatchLog.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfDispatchLog.cpp @@ -48,7 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnKeyedObject/plKey.h" #include "plString.h" -static bool DumpSpecificMsgInfo(plMessage* msg, std::string& info); +static bool DumpSpecificMsgInfo(plMessage* msg, plString& info); plDispatchLog::plDispatchLog() : fLog(nil), @@ -101,7 +101,7 @@ void plDispatchLog::LogStatusBarChange(const char* name, const char* action) void plDispatchLog::LogLongReceive(const char* keyname, const char* className, uint32_t clonePlayerID, plMessage* msg, float ms) { - std::string info; + plString info; if (DumpSpecificMsgInfo(msg, info)) fLog->AddLineF("%-30s[%7u](%-20s) took %6.1f ms to receive %s[%s]\n", keyname, clonePlayerID, className, ms, msg->ClassName(), info.c_str()); else @@ -195,7 +195,7 @@ void plDispatchLog::RemoveFilterExactType(uint16_t type) #include "plResMgr/plKeyFinder.h" #include "plResMgr/plPageInfo.h" -static bool DumpSpecificMsgInfo(plMessage* msg, std::string& info) +static bool DumpSpecificMsgInfo(plMessage* msg, plString& info) { #ifndef PLASMA_EXTERNAL_RELEASE // Don't bloat up the external release with all these strings pfKIMsg* kiMsg = pfKIMsg::ConvertNoRef(msg); @@ -257,7 +257,7 @@ static bool DumpSpecificMsgInfo(plMessage* msg, std::string& info) PrintKIType(kGZFlashUpdate); // flash an update without saving (for animation of GZFill in) PrintKIType(kNoCommand); - info = xtl::format("Type: %s Str: %s User: %s(%d) Delay: %f Int: %d", + info = plString::Format("Type: %s Str: %s User: %s(%d) Delay: %f Int: %d", typeName, kiMsg->GetString() != "" ? kiMsg->GetString().c_str() : "(nil)", kiMsg->GetUser() ? kiMsg->GetUser() : "(nil)", @@ -298,14 +298,14 @@ static bool DumpSpecificMsgInfo(plMessage* msg, std::string& info) const plPageInfo* pageInfo = plKeyFinder::Instance().GetLocationInfo(loc); if (pageInfo) - info += xtl::format("%s-%s ", pageInfo->GetAge(), pageInfo->GetPage()); + info += plString::Format("%s-%s ", pageInfo->GetAge(), pageInfo->GetPage()); } } break; case plClientMsg::kLoadAgeKeys: case plClientMsg::kReleaseAgeKeys: - info += xtl::format(" - Age: %s", clientMsg->GetAgeName()); + info += plString::Format(" - Age: %s", clientMsg->GetAgeName()); break; } return true; @@ -321,7 +321,7 @@ static bool DumpSpecificMsgInfo(plMessage* msg, std::string& info) GetType(kOnRequest); GetType(kOnRemove); GetType(kOnReplace); - xtl::format(info, "Obj: %s RefType: %s", refMsg->GetRef()->GetKeyName().c_str(), typeName); + info = plString::Format("Obj: %s RefType: %s", refMsg->GetRef()->GetKeyName().c_str(), typeName); return true; } diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.h b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.h index 4968d3d3..a478142d 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.h +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.h @@ -48,7 +48,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef _pfGUIEditBoxMod_h #define _pfGUIEditBoxMod_h -#include "hsStlUtils.h" #include "pfGUIControlMod.h" #include "pnInputCore/plKeyDef.h" diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUITextBoxMod.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUITextBoxMod.cpp index b090c37d..e5f1f574 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUITextBoxMod.cpp +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUITextBoxMod.cpp @@ -46,7 +46,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ////////////////////////////////////////////////////////////////////////////// #include "HeadSpin.h" -#include "hsStlUtils.h" #include "pfGUITextBoxMod.h" #include "pfGameGUIMgr.h" diff --git a/Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp b/Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp index 0ff2c533..ec35082b 100644 --- a/Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp +++ b/Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp @@ -51,7 +51,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pfJournalBook.h" #include -#include "hsStlUtils.h" #include "hsResMgr.h" #include "pcSmallRect.h" #include "plgDispatch.h" diff --git a/Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.h b/Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.h index c99f9a53..4fdf7d61 100644 --- a/Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.h +++ b/Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.h @@ -165,7 +165,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ////////////////////////////////////////////////////////////////////////////// #include "HeadSpin.h" -#include "hsStlUtils.h" +#include +#include + #include "hsTemplates.h" #include "hsColorRGBA.h" diff --git a/Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationDataMgr.h b/Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationDataMgr.h index 51a73210..fbbc7832 100644 --- a/Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationDataMgr.h +++ b/Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationDataMgr.h @@ -50,7 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define _pfLocalizationDataMgr_h #include "HeadSpin.h" -#include "hsStlUtils.h" +#include #include "pfLocalizedString.h" diff --git a/Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationMgr.h b/Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationMgr.h index 889b4ba9..ccb10063 100644 --- a/Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationMgr.h +++ b/Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationMgr.h @@ -50,7 +50,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define _pfLocalizationMgr_h #include "HeadSpin.h" -#include "hsStlUtils.h" class pfLocalizationMgr { diff --git a/Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizedString.cpp b/Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizedString.cpp index ccf6ece6..704215f7 100644 --- a/Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizedString.cpp +++ b/Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizedString.cpp @@ -49,7 +49,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" - #include "pfLocalizedString.h" // MinGW sucks diff --git a/Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizedString.h b/Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizedString.h index 5448d3d0..fc5f4f3f 100644 --- a/Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizedString.h +++ b/Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizedString.h @@ -51,7 +51,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define _pfLocalizedString_h #include "HeadSpin.h" -#include "hsStlUtils.h" +#include +#include //// pfLocalizedString Class Definition ////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfMessage/pfKIMsg.h b/Sources/Plasma/FeatureLib/pfMessage/pfKIMsg.h index f7155e5b..de534a37 100644 --- a/Sources/Plasma/FeatureLib/pfMessage/pfKIMsg.h +++ b/Sources/Plasma/FeatureLib/pfMessage/pfKIMsg.h @@ -49,7 +49,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define _pfKIMsg_h #include "HeadSpin.h" -#include "hsStlUtils.h" #include "hsStream.h" #include "pnMessage/plMessage.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekMsg.h index 589e77ae..dda02fc9 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekMsg.h @@ -49,6 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // PURPOSE: Class wrapper for Heek game messages // +#include #include "../../pyGlueHelpers.h" #include "../pyGameCliMsg.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerMsg.h index b2ce74ca..f4d24064 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerMsg.h @@ -49,6 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // PURPOSE: Class wrapper for Marker game messages // +#include #include "../../pyGlueHelpers.h" #include "../pyGameCliMsg.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncMsg.h index 481ff126..27eced1e 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncMsg.h @@ -49,6 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // PURPOSE: Class wrapper for VarSync game messages // +#include #include "../../pyGlueHelpers.h" #include "../pyGameCliMsg.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Pch.h b/Sources/Plasma/FeatureLib/pfPython/Pch.h index 4a41f08b..324fccfc 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Pch.h +++ b/Sources/Plasma/FeatureLib/pfPython/Pch.h @@ -52,6 +52,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include #include +#include // Platform Library Includes #include @@ -69,8 +70,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsGeometry3.h" #include "hsQuat.h" #include "hsResMgr.h" -#include "hsStlSortUtils.h" -#include "hsStlUtils.h" #include "hsStream.h" #include "hsTemplates.h" #include "hsTimer.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAccountManagement.h b/Sources/Plasma/FeatureLib/pfPython/cyAccountManagement.h index 4d41ae55..4c8ccf8c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyAccountManagement.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyAccountManagement.h @@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // #include +#include typedef struct _object PyObject; typedef struct PyMethodDef PyMethodDef; diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAvatar.h b/Sources/Plasma/FeatureLib/pfPython/cyAvatar.h index 2d64705f..e5610de3 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyAvatar.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyAvatar.h @@ -48,7 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper to map animation functions to plasma2 message // -#include "hsStlUtils.h" +#include #include "hsTemplates.h" #include "pnKeyedObject/plKey.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMisc.h b/Sources/Plasma/FeatureLib/pfPython/cyMisc.h index 2011c167..f89b6d58 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyMisc.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyMisc.h @@ -59,6 +59,7 @@ class pyPoint3; #include "HeadSpin.h" #include +#include class pyGUIDialog; class plPipeline; diff --git a/Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.h b/Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.h index 2df041d7..686011a0 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.h @@ -47,8 +47,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // only be one instance of this interface. // #include "HeadSpin.h" -#include "hsStlUtils.h" #include "plString.h" +#include #if defined(HAVE_CYPYTHONIDE) && !defined(PLASMA_EXTERNAL_RELEASE) #include "../../Apps/CyPythonIDE/plCyDebug/plCyDebServer.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/plPythonPack.cpp b/Sources/Plasma/FeatureLib/pfPython/plPythonPack.cpp index b23d3483..960e59f7 100644 --- a/Sources/Plasma/FeatureLib/pfPython/plPythonPack.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/plPythonPack.cpp @@ -45,11 +45,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include #include +#include #include "HeadSpin.h" -#include "hsStlUtils.h" #include "hsStream.h" -#include "hsStlSortUtils.h" #pragma hdrstop #include "plPythonPack.h" @@ -219,7 +218,7 @@ PyObject* plPythonPack::OpenPacked(const char* fileName) { char *buf = new char[size]; uint32_t readSize = fPackStream->Read(size, buf); - hsAssert(readSize <= size, xtl::format("Python PackFile %s: Incorrect amount of data, read %d instead of %d", + hsAssert(readSize <= size, plString::Format("Python PackFile %s: Incorrect amount of data, read %d instead of %d", fileName, readSize, size).c_str()); // let the python marshal make it back into a code object diff --git a/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.h b/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.h index f5f1150a..2632ae62 100644 --- a/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.h +++ b/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.h @@ -46,7 +46,7 @@ class plPythonFileMod; class plStateDataRecord; class plSimpleStateVariable; -#include "hsStlUtils.h" +#include #include "plModifier/plSDLModifier.h" #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp b/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp index 4e76ff5c..b506b914 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp @@ -41,6 +41,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include +#include #pragma hdrstop #include "pyAgeInfoStruct.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.h b/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.h index c240675b..d28ab403 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.h @@ -42,7 +42,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef pyAgeInfoStruct_h_inc #define pyAgeInfoStruct_h_inc -#include "hsStlUtils.h" #include "plNetCommon/plNetServerSessionInfo.h" #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyCCRMgr.h b/Sources/Plasma/FeatureLib/pfPython/pyCCRMgr.h index 8d060696..39ea0281 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyCCRMgr.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyCCRMgr.h @@ -49,7 +49,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ////////////////////////////////////////////////////////////////////// #include "HeadSpin.h" -#include "hsStlUtils.h" #include "pfCCR/plCCRMgr.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyEnum.cpp b/Sources/Plasma/FeatureLib/pfPython/pyEnum.cpp index 99b23128..cda95b17 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyEnum.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyEnum.cpp @@ -49,7 +49,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include -#include "hsStlUtils.h" #include "pyGlueHelpers.h" #pragma hdrstop diff --git a/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h b/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h index 6dc6e1ab..e2bfc04b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h @@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyGlueHelpers.h" #include +#include class cyAnimation; class pyImage; diff --git a/Sources/Plasma/FeatureLib/pfPython/pySDL.h b/Sources/Plasma/FeatureLib/pfPython/pySDL.h index a49ad65a..cd253d22 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySDL.h +++ b/Sources/Plasma/FeatureLib/pfPython/pySDL.h @@ -49,7 +49,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ////////////////////////////////////////////////////////////////////// #include "HeadSpin.h" -#include "hsStlUtils.h" +#include + #include "pyGlueHelpers.h" class plStateDataRecord; diff --git a/Sources/Plasma/NucleusLib/inc/plPipeline.h b/Sources/Plasma/NucleusLib/inc/plPipeline.h index 6c9c30cc..6d09ee84 100644 --- a/Sources/Plasma/NucleusLib/inc/plPipeline.h +++ b/Sources/Plasma/NucleusLib/inc/plPipeline.h @@ -46,7 +46,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnFactory/plCreatable.h" #include "hsGMatState.h" #include "hsTemplates.h" -#include "hsStlUtils.h" #define MIN_WIDTH 640 #define MIN_HEIGHT 480 diff --git a/Sources/Plasma/NucleusLib/inc/plProfileManager.h b/Sources/Plasma/NucleusLib/inc/plProfileManager.h index e36df329..cef7a60d 100644 --- a/Sources/Plasma/NucleusLib/inc/plProfileManager.h +++ b/Sources/Plasma/NucleusLib/inc/plProfileManager.h @@ -43,7 +43,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plProfileManager_h_inc #include "HeadSpin.h" -#include "hsStlUtils.h" +#include + #include "plProfile.h" class plProfileManager diff --git a/Sources/Plasma/NucleusLib/pnDispatch/plDispatch.cpp b/Sources/Plasma/NucleusLib/pnDispatch/plDispatch.cpp index 966cd91a..38297684 100644 --- a/Sources/Plasma/NucleusLib/pnDispatch/plDispatch.cpp +++ b/Sources/Plasma/NucleusLib/pnDispatch/plDispatch.cpp @@ -331,7 +331,7 @@ void plDispatch::IMsgDispatch() if (plNetObjectDebuggerBase::GetInstance()->IsDebugObject(ko)) { hsLogEntry(plNetObjectDebuggerBase::GetInstance()->LogMsg( - xtl::format(" object:%s, GameMessage %s st=%.3f rt=%.3f", + plString::Format(" object:%s, GameMessage %s st=%.3f rt=%.3f", ko->GetKeyName().c_str(), msg->ClassName(), hsTimer::GetSysSeconds(), hsTimer::GetSeconds()).c_str())); } } diff --git a/Sources/Plasma/NucleusLib/pnDispatch/plDispatch.h b/Sources/Plasma/NucleusLib/pnDispatch/plDispatch.h index 7bfb1e31..9554673c 100644 --- a/Sources/Plasma/NucleusLib/pnDispatch/plDispatch.h +++ b/Sources/Plasma/NucleusLib/pnDispatch/plDispatch.h @@ -42,8 +42,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plDispatch_inc #define plDispatch_inc +#include #include "hsTemplates.h" -#include "hsStlUtils.h" #include "plgDispatch.h" #include "hsThread.h" #include "pnKeyedObject/hsKeyedObject.h" diff --git a/Sources/Plasma/NucleusLib/pnKeyedObject/plMsgForwarder.h b/Sources/Plasma/NucleusLib/pnKeyedObject/plMsgForwarder.h index e367da82..22e87e01 100644 --- a/Sources/Plasma/NucleusLib/pnKeyedObject/plMsgForwarder.h +++ b/Sources/Plasma/NucleusLib/pnKeyedObject/plMsgForwarder.h @@ -42,9 +42,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plMsgForwarder_h_inc #define plMsgForwarder_h_inc +#include #include "hsKeyedObject.h" #include "hsTemplates.h" -#include "hsStlUtils.h" class plMessageWithCallbacks; diff --git a/Sources/Plasma/NucleusLib/pnMessage/plClientMsg.h b/Sources/Plasma/NucleusLib/pnMessage/plClientMsg.h index 508f06e4..a7c8f8ad 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plClientMsg.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plClientMsg.h @@ -47,7 +47,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsStream.h" #include "hsResMgr.h" -#include "hsStlUtils.h" #include "pnKeyedObject/plUoid.h" // diff --git a/Sources/Plasma/NucleusLib/pnMessage/plMessage.cpp b/Sources/Plasma/NucleusLib/pnMessage/plMessage.cpp index b79ec0a5..8706b4a8 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plMessage.cpp +++ b/Sources/Plasma/NucleusLib/pnMessage/plMessage.cpp @@ -280,7 +280,7 @@ int plMsgStdStringHelper::Peek(std::string & stringref, hsStream* stream, const stringref.resize(strlen); if (strlen){ stream->LogRead(strlen,(void*)stringref.data(),"StdString"); - stream->LogStringString(xtl::format("Value: %s", stringref.data()).c_str()); + stream->LogStringString(plString::Format("Value: %s", stringref.data()).c_str()); } } else @@ -302,7 +302,7 @@ int plMsgStdStringHelper::PeekBig(std::string & stringref, hsStream* stream, co stringref.resize(bufsz); if (bufsz){ stream->LogRead(bufsz,(void*)stringref.data(),"StdString"); - stream->LogStringString(xtl::format("Value: %s", stringref.data()).c_str()); + stream->LogStringString(plString::Format("Value: %s", stringref.data()).c_str()); } } else @@ -329,39 +329,6 @@ int plMsgStdStringHelper::PeekBig(plString & stringref, hsStream* stream, const return pos; } -///////////////////////////////////////////////////////////////// - -// STATIC -int plMsgXtlStringHelper::Poke(const xtl::istring & stringref, hsStream* stream, const uint32_t peekOptions) -{ - plMessage::plStrLen strlen; - strlen = stringref.length(); - stream->WriteLE(strlen); - if (strlen) - stream->Write(strlen,stringref.data()); - return stream->GetPosition(); -} - -// STATIC -int plMsgXtlStringHelper::Peek(xtl::istring & stringref, hsStream* stream, const uint32_t peekOptions) -{ - plMessage::plStrLen strlen; - stream->LogSubStreamStart("push me"); - stream->LogReadLE(&strlen,"StrLen"); - stringref.erase(); - if (strlen <= stream->GetSizeLeft()) - { - stringref.resize(strlen); - if (strlen){ - stream->LogRead(strlen,(void*)stringref.data(),"XtlString"); - stream->LogStringString(xtl::format("Value: %s", stringref.data()).c_str()); - } - } - stream->LogSubStreamEnd(); - return stream->GetPosition(); -} - - ///////////////////////////////////////////////////////////////// // STATIC @@ -390,7 +357,7 @@ int plMsgCStringHelper::Peek(char *& str, hsStream* stream, const uint32_t peekO str[strlen] = '\0'; if (strlen) { stream->LogRead(strlen,str,"CString"); - stream->LogStringString(xtl::format("Value: %s",str).c_str()); + stream->LogStringString(plString::Format("Value: %s",str).c_str()); } } } diff --git a/Sources/Plasma/NucleusLib/pnMessage/plMessage.h b/Sources/Plasma/NucleusLib/pnMessage/plMessage.h index d0f841ba..ba97b1b1 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plMessage.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plMessage.h @@ -43,10 +43,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plMessage_inc #define plMessage_inc +#include #include "pnFactory/plCreatable.h" #include "pnKeyedObject/plKey.h" #include "hsTemplates.h" -#include "hsStlUtils.h" class plKey; class hsStream; @@ -157,8 +157,8 @@ public: ///////////////////////////////////////////////////////////////// // Helpers for reading/writing these types: +// plString // std::string -// xtl::istring // c strings (char *) // c arrays (type []) @@ -180,15 +180,6 @@ struct plMsgStdStringHelper static int PeekBig(plString & stringref, hsStream* stream, const uint32_t peekOptions=0); }; -///////////////////////////////////////////////////////////////// -// reads/writes your xtl::istring field - -struct plMsgXtlStringHelper -{ - static int Poke(const xtl::istring & stringref, hsStream* stream, const uint32_t peekOptions=0); - static int Peek(xtl::istring & stringref, hsStream* stream, const uint32_t peekOptions=0); -}; - ///////////////////////////////////////////////////////////////// // reads/writes your char * field (deprecated) diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/plGenericVar.cpp b/Sources/Plasma/NucleusLib/pnNetCommon/plGenericVar.cpp index 9109c4a4..0d71e07c 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/plGenericVar.cpp +++ b/Sources/Plasma/NucleusLib/pnNetCommon/plGenericVar.cpp @@ -42,7 +42,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsStream.h" #include "plGenericVar.h" #include "hsMemory.h" -#include "hsStlUtils.h" ////////////////////////////////////////////////////// // plGenericType @@ -317,45 +316,28 @@ void plGenericType::SetVar(Types t, unsigned int size, void* val) } -std::string plGenericType::GetAsStdString() const +plString plGenericType::GetAsString() const { - std::string s; - switch (fType) { case kInt : - { - xtl::format(s,"%d",fI); - break; - } + return plString::Format("%d", fI); case kBool : case kUInt : - { - xtl::format(s,"%u",fType==kBool?fB:fU); - break; - } + return plString::Format("%u", fType==kBool?fB:fU); case kFloat : case kDouble : - { - xtl::format(s,"%f",fType==kDouble?fD:fF); - break; - } + return plString::Format("%f", fType==kDouble?fD:fF); case kChar : - { - xtl::format(s,"%c",fC); - break; - } + return plString::Format("%c", fC); case kAny : case kString : - { - s = fS; - break; - } + return fS; case kNone : break; default: hsAssert(false,"plGenericType::GetAsStdString unknown type"); } - return s; -} \ No newline at end of file + return plString::Null; +} diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/plGenericVar.h b/Sources/Plasma/NucleusLib/pnNetCommon/plGenericVar.h index eb27db91..b3ff533b 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/plGenericVar.h +++ b/Sources/Plasma/NucleusLib/pnNetCommon/plGenericVar.h @@ -44,7 +44,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" -#include "hsStlUtils.h" #include "pnFactory/plCreatable.h" class hsStream; @@ -117,7 +116,7 @@ public: void SetType(Types t) { fType=t; } uint8_t GetType( void ) const { return fType; } - std::string GetAsStdString() const; + plString GetAsString() const; // implicit set void Set( int32_t i ) { fI = i; fType = kInt; } diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/plNetAddress.h b/Sources/Plasma/NucleusLib/pnNetCommon/plNetAddress.h index 17b64cda..837a1f80 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/plNetAddress.h +++ b/Sources/Plasma/NucleusLib/pnNetCommon/plNetAddress.h @@ -48,7 +48,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsWindows.h" // FIXME #include "plString.h" -#include "hsStlUtils.h" #include "hsStream.h" #if defined(HS_BUILD_FOR_WIN32) diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/plNetApp.cpp b/Sources/Plasma/NucleusLib/pnNetCommon/plNetApp.cpp index 774c6211..af69b9e7 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/plNetApp.cpp +++ b/Sources/Plasma/NucleusLib/pnNetCommon/plNetApp.cpp @@ -40,7 +40,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "plNetApp.h" -#include "hsStlUtils.h" #include "pnMessage/plMessage.h" plNetApp* plNetApp::fInstance = nil; diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/plNetApp.h b/Sources/Plasma/NucleusLib/pnNetCommon/plNetApp.h index 750d9714..6e5fb76e 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/plNetApp.h +++ b/Sources/Plasma/NucleusLib/pnNetCommon/plNetApp.h @@ -43,7 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plNetApp_h #include "HeadSpin.h" -#include "hsStlUtils.h" #include "hsBitVector.h" #include "plNetGroup.h" @@ -192,7 +191,7 @@ public: virtual int IsLocallyOwned(const plUoid&) const { hsAssert(false, "stub"); return 0; } virtual plNetGroupId GetEffectiveNetGroup(const plSynchedObject* obj) const { hsAssert(false, "stub"); return plNetGroup::kNetGroupUnknown; } virtual int Update(double secs) { return hsOK;} - virtual const char* GetServerLogTimeAsString(std::string& ts) const { hsAssert(false, "stub"); return nil; } + virtual const char* GetServerLogTimeAsString(plString& ts) const { hsAssert(false, "stub"); return nil; } virtual plUoid GetAgeSDLObjectUoid(const char* ageName) const { hsAssert(false, "stub"); return plUoid(); } virtual void StayAlive(double secs) {} virtual void QueueDisableNet( bool showDlg, const char msg[] ) {} diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/plNetGroup.h b/Sources/Plasma/NucleusLib/pnNetCommon/plNetGroup.h index b4e65bd7..8f74183b 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/plNetGroup.h +++ b/Sources/Plasma/NucleusLib/pnNetCommon/plNetGroup.h @@ -42,9 +42,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plNetGroup_h #define plNetGroup_h +#include #include "pnKeyedObject/plUoid.h" #include "hsStream.h" -#include "hsStlUtils.h" class plNetGroupId { diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/plNetSharedState.h b/Sources/Plasma/NucleusLib/pnNetCommon/plNetSharedState.h index 2733b05b..042d4aaa 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/plNetSharedState.h +++ b/Sources/Plasma/NucleusLib/pnNetCommon/plNetSharedState.h @@ -43,8 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plNetSharedState_inc #include "HeadSpin.h" - -#include "hsStlUtils.h" +#include class hsStream; diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedObject.h b/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedObject.h index c01a0c98..0fa8995f 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedObject.h +++ b/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedObject.h @@ -45,7 +45,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" #include "pnKeyedObject/hsKeyedObject.h" #include "pnKeyedObject/plKey.h" -#include "hsStlUtils.h" #include "plNetGroup.h" ///////////////////////////////////// diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/pnNetCommon.cpp b/Sources/Plasma/NucleusLib/pnNetCommon/pnNetCommon.cpp index 342875ea..3554ebfb 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/pnNetCommon.cpp +++ b/Sources/Plasma/NucleusLib/pnNetCommon/pnNetCommon.cpp @@ -39,6 +39,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ +#include #include "pnNetCommon.h" #include "hsWindows.h" diff --git a/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrProductId.cpp b/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrProductId.cpp index 5f928da1..05b76957 100644 --- a/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrProductId.cpp +++ b/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrProductId.cpp @@ -46,6 +46,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ***/ #include "../Pch.h" +#include #pragma hdrstop diff --git a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h index 567fd0b5..4f68e0ee 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h +++ b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h @@ -43,7 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define pnUUID_h_inc #include "HeadSpin.h" -#include "hsStlUtils.h" #include "pnUtils/pnUtUuid.h" class hsStream; diff --git a/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp b/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp index e7ae52e6..c18d46ea 100644 --- a/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp +++ b/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp @@ -43,7 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsStream.h" #include "plAgeDescription.h" -#include "hsStlUtils.h" #include "plFile/hsFiles.h" #include "plFile/plInitFileReader.h" #include "plFile/plEncryptedStream.h" @@ -162,7 +161,7 @@ char *plAgePage::GetAsString( void ) const // // static -char plAgeDescription::kAgeDescPath[]={"dat"PATH_SEPARATOR_STR}; +char plAgeDescription::kAgeDescPath[] = { "dat" PATH_SEPARATOR_STR }; const char* plAgeDescription::fCommonPages[] = { "Textures", "BuiltIn" }; // Also gotta init the separators for our helper reading function diff --git a/Sources/Plasma/PubUtilLib/plAgeLoader/plAgeLoader.h b/Sources/Plasma/PubUtilLib/plAgeLoader/plAgeLoader.h index a395e098..09998288 100644 --- a/Sources/Plasma/PubUtilLib/plAgeLoader/plAgeLoader.h +++ b/Sources/Plasma/PubUtilLib/plAgeLoader/plAgeLoader.h @@ -43,7 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plAgeLoader_h #include "HeadSpin.h" -#include "hsStlUtils.h" #include "pnUtils/pnUtils.h" #include "pnNetBase/pnNetBase.h" diff --git a/Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp b/Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp index ed421c79..330fe267 100644 --- a/Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp +++ b/Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp @@ -69,19 +69,19 @@ public: fIsZipped = wcscmp(plFileUtils::GetFileExt(reqFile), L"gz") == 0; } - ~plResDownloadStream() + virtual ~plResDownloadStream() { if (fFilename) delete[] fFilename; } - bool Open(const char* filename, const char* mode) + virtual bool Open(const char* filename, const char* mode) { fFilename = hsStrcpy(filename); return plZlibStream::Open(filename, mode); } - uint32_t Write(uint32_t count, const void* buf) + virtual uint32_t Write(uint32_t count, const void* buf) { fProgress->Increment((float)count); if (fIsZipped) @@ -231,37 +231,33 @@ void plResPatcher::IssueRequest() Request req = fRequests.front(); fRequests.pop(); - std::wstring title; + plString title; if (req.fType == kManifest) { - char* eapSucksString = hsWStringToString(req.fFile.c_str()); - PatcherLog(kMajorStatus, " Downloading manifest... %s", eapSucksString); - xtl::format(title, L"Checking %s for updates...", req.fFile.c_str()); + PatcherLog(kMajorStatus, " Downloading manifest... %S", req.fFile.c_str()); + title = plString::Format("Checking %S for updates...", req.fFile.c_str()); NetCliFileManifestRequest(ManifestDownloaded, this, req.fFile.c_str()); - delete[] eapSucksString; } else if (req.fType == kFile) { - char* eapSucksString = hsWStringToString(req.fFriendlyName.c_str()); - PatcherLog(kMajorStatus, " Downloading file... %s", eapSucksString); - xtl::format(title, L"Downloading... %s", plFileUtils::GetFileName(req.fFriendlyName.c_str())); + PatcherLog(kMajorStatus, " Downloading file... %S", req.fFriendlyName.c_str()); + title = plString::Format("Downloading... %S", plFileUtils::GetFileName(req.fFriendlyName.c_str())); // If this is a PRP, we need to unload it from the ResManager - if (stricmp(plFileUtils::GetFileExt(eapSucksString), "prp") == 0) - ((plResManager*)hsgResMgr::ResMgr())->RemoveSinglePage(eapSucksString); + + plString filename = plString::FromWchar(req.fFriendlyName.c_str()); + if (stricmp(plFileUtils::GetFileExt(filename.c_str()), "prp") == 0) + ((plResManager*)hsgResMgr::ResMgr())->RemoveSinglePage(filename.c_str()); plFileUtils::EnsureFilePathExists(req.fFriendlyName.c_str()); plResDownloadStream* stream = new plResDownloadStream(fProgress, req.fFile.c_str()); - if(stream->Open(eapSucksString, "wb")) + if (stream->Open_TEMP(filename, "wb")) NetCliFileDownloadRequest(req.fFile.c_str(), stream, FileDownloaded, this); else { - PatcherLog(kError, " Unable to create file %s", eapSucksString); + PatcherLog(kError, " Unable to create file %s", filename.c_str()); Finish(false); } - delete[] eapSucksString; } - char* hack = hsWStringToString(title.c_str()); - fProgress->SetTitle(hack); - delete[] hack; + fProgress->SetTitle(title.c_str()); } } diff --git a/Sources/Plasma/PubUtilLib/plAudio/plAudioSystem.h b/Sources/Plasma/PubUtilLib/plAudio/plAudioSystem.h index 15c81c58..57b279fe 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plAudioSystem.h +++ b/Sources/Plasma/PubUtilLib/plAudio/plAudioSystem.h @@ -43,7 +43,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plAudioSystem_h #include "HeadSpin.h" -#include "hsStlUtils.h" +#include + #include "hsTemplates.h" #include "hsGeometry3.h" #include "pnKeyedObject/hsKeyedObject.h" diff --git a/Sources/Plasma/PubUtilLib/plAudio/plDSoundBuffer.h b/Sources/Plasma/PubUtilLib/plAudio/plDSoundBuffer.h index 438c6f4c..ac161a5a 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plDSoundBuffer.h +++ b/Sources/Plasma/PubUtilLib/plAudio/plDSoundBuffer.h @@ -50,7 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef _plDSoundBuffer_h #define _plDSoundBuffer_h -#include "hsStlUtils.h" +#include #include "hsTemplates.h" #include "plEAXEffects.h" #define STREAMING_BUFFERS 16 diff --git a/Sources/Plasma/PubUtilLib/plAudioCore/plWavFile.h b/Sources/Plasma/PubUtilLib/plAudioCore/plWavFile.h index 459fc3c0..16b4fee9 100644 --- a/Sources/Plasma/PubUtilLib/plAudioCore/plWavFile.h +++ b/Sources/Plasma/PubUtilLib/plAudioCore/plWavFile.h @@ -48,7 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" -#include "hsStlUtils.h" +#include #include "hsWindows.h" // FIXME #include #include "plAudioFileReader.h" diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAGAnim.h b/Sources/Plasma/PubUtilLib/plAvatar/plAGAnim.h index b9826a27..70e9b172 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAGAnim.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAGAnim.h @@ -50,9 +50,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com */ #pragma warning(disable: 4786) // don't care if mangled names are longer than 255 characters +#include #include "pnNetCommon/plSynchedObject.h" -#include "hsStlUtils.h" -#include "hsStlSortUtils.h" class plTMController; class hsAffineParts; diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAGAnimInstance.h b/Sources/Plasma/PubUtilLib/plAvatar/plAGAnimInstance.h index edd259f7..f0e18e39 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAGAnimInstance.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAGAnimInstance.h @@ -53,9 +53,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // disable warning C4786: symbol greater than 255 characters, #pragma warning(disable: 4503 4786) -// templates -#include "hsStlUtils.h" -#include "hsStlSortUtils.h" +#include "HeadSpin.h" +#include // local #include "plScalarChannel.h" diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAGMasterMod.h b/Sources/Plasma/PubUtilLib/plAvatar/plAGMasterMod.h index 4cdb376f..815e72b7 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAGMasterMod.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAGMasterMod.h @@ -58,10 +58,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plAvDefs.h" #include "pnKeyedObject/plMsgForwarder.h" -// templates -#include "hsStlUtils.h" -#include "hsStlSortUtils.h" - class plAGModifier; class plAGAnimInstance; diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAGModifier.h b/Sources/Plasma/PubUtilLib/plAvatar/plAGModifier.h index 8ebff9db..bcf699be 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAGModifier.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAGModifier.h @@ -53,10 +53,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // local #include "plAvatar/plScalarChannel.h" -// stl -#include "hsStlUtils.h" -#include "hsStlSortUtils.h" - class plSceneObject; class plAGAnimInstance; diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp index f5dc5ac5..e7e39ce2 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp @@ -54,11 +54,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // global -#include "hsStlUtils.h" #include "hsResMgr.h" #include "hsTimer.h" #include +#include // other #include "pnSceneObject/plSceneObject.h" diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.h b/Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.h index 4166e330..22a44bc2 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.h @@ -47,8 +47,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef PL_ANIM_STAGE_INC #define PL_ANIM_STAGE_INC +#include #include "hsMatrix44.h" -#include "hsStlUtils.h" #include "pnFactory/plCreatable.h" class plMessage; diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp index 1268a5d5..a3d0986a 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp @@ -39,6 +39,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ +#include + #include "plAvBehaviors.h" #include "plAvBrainHuman.h" #include "plArmatureMod.h" diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCoop.h b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCoop.h index c0291986..eb7a392c 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCoop.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCoop.h @@ -42,7 +42,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef PLAVBRAINGENERIC_H #define PLAVBRAINGENERIC_H -#include "hsStlUtils.h" #include "plAvBrainGeneric.h" /** \class plAvBrainCoop diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.h b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.h index 561797be..0e72f24a 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.h @@ -42,6 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef PL_AV_BRAIN_CRITTER_H #define PL_AV_BRAIN_CRITTER_H +#include #include "plAvBrain.h" #include "hsTemplates.h" #include "pnKeyedObject/plKey.h" diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp index 05422c7b..98c6ffad 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp @@ -41,6 +41,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "HeadSpin.h" +#include #include "plPhysicalControllerCore.h" #include "plAvBrainHuman.h" diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp index 5a990f09..2805de77 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp @@ -46,6 +46,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ///////////////////////////////////////////////////////////////////////////////////////// +#include + // singular #include "plAvBrainSwim.h" diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvLadderModifier.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvLadderModifier.cpp index a1fdf22d..b1fc2478 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvLadderModifier.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvLadderModifier.cpp @@ -42,6 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plPhysicalControllerCore.h" #include "HeadSpin.h" +#include // singular #include "plAvLadderModifier.h" diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.cpp index 60f2322e..f834ddb1 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.cpp @@ -46,6 +46,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ///////////////////////////////////////////////////////////////////////////////////////// +#include + // singular #include "plAvTaskSeek.h" diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.h b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.h index e8c57f70..1f5e8a49 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.h @@ -45,8 +45,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef PLAVATARMGR_INC #define PLAVATARMGR_INC -#include "hsStlUtils.h" -#include "hsStlSortUtils.h" +#include "HeadSpin.h" +#include + #include "hsGeometry3.h" #include "pnKeyedObject/hsKeyedObject.h" diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarSDLModifier.h b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarSDLModifier.h index dfe1f969..8b1ca4a7 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarSDLModifier.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarSDLModifier.h @@ -43,7 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plAvatarSDLModifier_inc #include "HeadSpin.h" -#include "hsStlUtils.h" #include "plModifier/plSDLModifier.h" diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plCritterCommands.h b/Sources/Plasma/PubUtilLib/plAvatar/plCritterCommands.h index c7810f42..f58d517b 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plCritterCommands.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plCritterCommands.h @@ -43,8 +43,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef __PLCRITTERCMDS_H__ #define __PLCRITTERCMDS_H__ -#include "hsStlUtils.h" - +#include +#include typedef std::vector VCharArray; diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plMatrixChannel.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plMatrixChannel.cpp index 64e9d275..65d9ce67 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plMatrixChannel.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plMatrixChannel.cpp @@ -50,6 +50,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com //#include //#include +#include + // singular #include "plMatrixChannel.h" @@ -1015,4 +1017,4 @@ void plIK2Applicator::IApply(const plAGModifier *mod, double time) void plIK2Applicator::ISolve() { -} \ No newline at end of file +} diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plMultistageBehMod.h b/Sources/Plasma/PubUtilLib/plAvatar/plMultistageBehMod.h index 275e820f..467dba2c 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plMultistageBehMod.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plMultistageBehMod.h @@ -43,7 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plMultistageBehMod_h_inc #include "pnModifier/plSingleModifier.h" -#include "hsStlUtils.h" class plAnimStageVec; diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plPhysicalControllerCore.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plPhysicalControllerCore.cpp index 6fa701fc..fba853f5 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plPhysicalControllerCore.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plPhysicalControllerCore.cpp @@ -39,6 +39,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ +#include + #include "plPhysicalControllerCore.h" #include "plArmatureMod.h" diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plSwimRegion.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plSwimRegion.cpp index 1ba908a5..e3adae43 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plSwimRegion.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plSwimRegion.cpp @@ -39,6 +39,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ +#include + #include "hsGeometry3.h" #include "hsResMgr.h" diff --git a/Sources/Plasma/PubUtilLib/plCompression/plZlibStream.h b/Sources/Plasma/PubUtilLib/plCompression/plZlibStream.h index e543aef3..a387402e 100644 --- a/Sources/Plasma/PubUtilLib/plCompression/plZlibStream.h +++ b/Sources/Plasma/PubUtilLib/plCompression/plZlibStream.h @@ -43,7 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plZlibStream_h_inc #include "hsStream.h" -#include "hsStlUtils.h" +#include // // This is for reading a .gz file from a buffer, and writing the uncompressed data to a file. diff --git a/Sources/Plasma/PubUtilLib/plContainer/plConfigInfo.cpp b/Sources/Plasma/PubUtilLib/plContainer/plConfigInfo.cpp index 849a7a0d..b7097eb0 100644 --- a/Sources/Plasma/PubUtilLib/plContainer/plConfigInfo.cpp +++ b/Sources/Plasma/PubUtilLib/plContainer/plConfigInfo.cpp @@ -42,15 +42,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plConfigInfo.h" #include "HeadSpin.h" -#include "hsStlUtils.h" #include #include #include #include -const std::string& plConfigInfo::GlobalSection() +const plString& plConfigInfo::GlobalSection() { - static std::string section("global"); + static plString section("global"); return section; } @@ -74,32 +73,32 @@ void plConfigInfo::Clear() fSections.clear(); } -void plConfigInfo::RemoveSection(const std::string & section) +void plConfigInfo::RemoveSection(const plString & section) { - fSections.erase(section.c_str()); + fSections.erase(section); } -void plConfigInfo::RemoveKey(const std::string & section, const std::string & key) +void plConfigInfo::RemoveKey(const plString & section, const plString & key) { - Sections::iterator si = fSections.find(section.c_str()); + Sections::iterator si = fSections.find(section); if (si != fSections.end()) - fSections[section.c_str()].RemoveKey(key); + fSections[section].RemoveKey(key); } -bool plConfigInfo::HasSection(const std::string & section) const +bool plConfigInfo::HasSection(const plString & section) const { - return fSections.find(section.c_str())!=fSections.end(); + return fSections.find(section)!=fSections.end(); } -bool plConfigInfo::HasKey(const std::string & section, const std::string & key) +bool plConfigInfo::HasKey(const plString & section, const plString & key) { - Sections::iterator si = fSections.find(section.c_str()); + Sections::iterator si = fSections.find(section); if (si == fSections.end()) return false; return (si->second.HasKey(key)); } -bool plConfigInfo::HasKeyAny(const std::string & key) +bool plConfigInfo::HasKeyAny(const plString & key) { for (Sections::iterator si=fSections.begin(); si!=fSections.end(); ++si) { @@ -109,12 +108,12 @@ bool plConfigInfo::HasKeyAny(const std::string & key) return false; } -bool plConfigInfo::HasKeyIn(const std::string & key, const char * section1, ...) +bool plConfigInfo::HasKeyIn(const plString & key, const char * section1, ...) { const char * section = section1; va_list va; va_start(va,section1); - std::vector sections; + std::vector sections; while (section) { sections.push_back( section ); @@ -124,114 +123,105 @@ bool plConfigInfo::HasKeyIn(const std::string & key, const char * section1, ...) return HasKeyIn( key, sections ); } -bool plConfigInfo::HasKeyIn(const std::string & key, const std::vector & sections ) +bool plConfigInfo::HasKeyIn(const plString & key, const std::vector & sections ) { for ( int i=0; isecond.KeyHasValue(key,value); } -bool plConfigInfo::KeyHasValue(const std::string & section, const std::string & key, int value) +bool plConfigInfo::KeyHasValue(const plString & section, const plString & key, int value) { - Sections::iterator si = fSections.find(section.c_str()); + Sections::iterator si = fSections.find(section); if (si == fSections.end()) return false; return si->second.KeyHasValue(key,value); } -bool plConfigInfo::KeyHasValue(const std::string & section, const std::string & key, double value) +bool plConfigInfo::KeyHasValue(const plString & section, const plString & key, double value) { - Sections::iterator si = fSections.find(section.c_str()); + Sections::iterator si = fSections.find(section); if (si == fSections.end()) return false; return si->second.KeyHasValue(key,value); } -bool plConfigInfo::AddValue(const std::string & section, const std::string & key, const std::string & value, KAddValueMode mode) +bool plConfigInfo::AddValue(const plString & section, const plString & key, const plString & value, KAddValueMode mode) { - fSections[section.c_str()].AddValue(key,value,mode); - return true; + return fSections[section].AddValue(key,value,mode); } -bool plConfigInfo::AddValue(const std::string & section, const std::string & key, int value, KAddValueMode mode) +bool plConfigInfo::AddValue(const plString & section, const plString & key, int value, KAddValueMode mode) { - char buf[20]; - sprintf(buf, "%d", value); - std::string v(buf); - return AddValue(section,key,v,mode); + return fSections[section].AddValue(key,value,mode); } -bool plConfigInfo::AddValue(const std::string & section, const std::string & key, double value, KAddValueMode mode) +bool plConfigInfo::AddValue(const plString & section, const plString & key, double value, KAddValueMode mode) { - char buf[30]; - sprintf(buf, "%f", value); - std::string v(buf); - return AddValue(section,key,v,mode); + return fSections[section].AddValue(key,value,mode); } -bool plConfigInfo::AddValues(const std::string & section, const std::string & key, const std::vector & values, KAddValueMode mode) +bool plConfigInfo::AddValues(const plString & section, const plString & key, const std::vector & values, KAddValueMode mode) { - return fSections[section.c_str()].AddValues(key,values); + return fSections[section].AddValues(key,values); } -plKeysAndValues plConfigInfo::GetSection(const std::string & section, bool & found) +plKeysAndValues plConfigInfo::GetSection(const plString & section, bool & found) { found = HasSection(section); if (found) - return fSections[section.c_str()]; + return fSections[section]; else return plKeysAndValues(); // empty } -std::vector plConfigInfo::GetSectionNames() +std::vector plConfigInfo::GetSectionNames() { - std::vector results; + std::vector results; for (Sections::const_iterator ii=fSections.begin(); ii!=fSections.end(); ++ii) - results.push_back(ii->first.c_str()); + results.push_back(ii->first); return results; } -std::string plConfigInfo::GetValue(const std::string & section, const std::string & key, const std::string & defval, bool * outFound) const +plString plConfigInfo::GetValue(const plString & section, const plString & key, const plString & defval, bool * outFound) const { - return fSections[section.c_str()].GetValue(key,defval,outFound); + return fSections[section].GetValue(key,defval,outFound); } -int plConfigInfo::GetValue(const std::string & section, const std::string & key, int defval, bool * outFound) const +int plConfigInfo::GetValue(const plString & section, const plString & key, int defval, bool * outFound) const { - return fSections[section.c_str()].GetValue(key,defval,outFound); + return fSections[section].GetValue(key,defval,outFound); } -double plConfigInfo::GetValue(const std::string & section, const std::string & key, double defval, bool * outFound) const +double plConfigInfo::GetValue(const plString & section, const plString & key, double defval, bool * outFound) const { - return fSections[section.c_str()].GetValue(key,defval,outFound); + return fSections[section].GetValue(key,defval,outFound); } -std::vector plConfigInfo::GetAllValues(const std::string & section, const std::string & key) const +std::vector plConfigInfo::GetAllValues(const plString & section, const plString & key) const { - Sections::iterator si = fSections.find(section.c_str()); + Sections::iterator si = fSections.find(section); if (si != fSections.end()) return si->second.GetAllValues(key); - std::vector empty; - return empty; + return std::vector(); } -std::string plConfigInfo::GetValueAny(const std::string & key, const std::string & defval, bool * outFound) const +plString plConfigInfo::GetValueAny(const plString & key, const plString & defval, bool * outFound) const { if (outFound) *outFound=false; for (Sections::iterator si=fSections.begin(); si!=fSections.end(); ++si) @@ -240,7 +230,7 @@ std::string plConfigInfo::GetValueAny(const std::string & key, const std::string return defval; } -int plConfigInfo::GetValueAny(const std::string & key, int defval, bool * outFound) const +int plConfigInfo::GetValueAny(const plString & key, int defval, bool * outFound) const { if (outFound) *outFound=false; for (Sections::iterator si=fSections.begin(); si!=fSections.end(); ++si) @@ -249,7 +239,7 @@ int plConfigInfo::GetValueAny(const std::string & key, int defval, bool * outFou return defval; } -double plConfigInfo::GetValueAny(const std::string & key, double defval, bool * outFound) const +double plConfigInfo::GetValueAny(const plString & key, double defval, bool * outFound) const { if (outFound) *outFound=false; for (Sections::iterator si=fSections.begin(); si!=fSections.end(); ++si) @@ -258,17 +248,16 @@ double plConfigInfo::GetValueAny(const std::string & key, double defval, bool * return defval; } -std::vector plConfigInfo::GetAllValuesAny(const std::string & key) const +std::vector plConfigInfo::GetAllValuesAny(const plString & key) const { for (Sections::iterator si=fSections.begin(); si!=fSections.end(); ++si) if (si->second.HasKey(key)) return si->second.GetAllValues(key); - std::vector empty; - return empty; + return std::vector(); } -std::string plConfigInfo::GetValueIn(const std::string & key, const std::string & defval, bool * outFound, const char * section1, ...) const +plString plConfigInfo::GetValueIn(const plString & key, const plString & defval, bool * outFound, const char * section1, ...) const { if (outFound) *outFound=false; const char * section = section1; @@ -288,14 +277,14 @@ std::string plConfigInfo::GetValueIn(const std::string & key, const std::string return defval; } -std::string plConfigInfo::GetValueIn(const std::string & key, const std::string & defval, bool * outFound, const std::vector & sections ) const +plString plConfigInfo::GetValueIn(const plString & key, const plString & defval, bool * outFound, const std::vector & sections ) const { if (outFound) *outFound=false; for ( int i=0; i & sections ) const +int plConfigInfo::GetValueIn(const plString & key, int defval, bool * outFound, const std::vector & sections ) const { if (outFound) *outFound=false; for ( int i=0; i & sections ) const +double plConfigInfo::GetValueIn(const plString & key, double defval, bool * outFound, const std::vector & sections ) const { if (outFound) *outFound=false; for ( int i=0; i plConfigInfo::GetAllValuesIn(const std::string & key, const char * section1, ...) +std::vector plConfigInfo::GetAllValuesIn(const plString & key, const char * section1, ...) { const char * section = section1; va_list sections; va_start(sections,section1); - std::vector result; + std::vector result; while (section) { if (HasSection(section)) @@ -386,7 +375,7 @@ std::vector plConfigInfo::GetAllValuesIn(const std::string & key, c plKeysAndValues & kv = fSections[section]; if (kv.HasKey(key)) { - std::vector values = kv.GetAllValues(key); + std::vector values = kv.GetAllValues(key); result.insert(result.end(),values.begin(),values.end()); } } @@ -403,7 +392,7 @@ bool plConfigInfo::GetSectionIterators(Sections::const_iterator & iter, Sections return true; } -bool plConfigInfo::GetKeyIterators(const xtl::istring & section, Keys::const_iterator & iter, Keys::const_iterator & end) const +bool plConfigInfo::GetKeyIterators(const plString & section, Keys::const_iterator & iter, Keys::const_iterator & end) const { Sections::const_iterator si = fSections.find(section); if (si==fSections.end()) @@ -411,7 +400,7 @@ bool plConfigInfo::GetKeyIterators(const xtl::istring & section, Keys::const_ite return fSections[section].GetKeyIterators(iter, end); } -bool plConfigInfo::GetValueIterators(const xtl::istring & section, const xtl::istring & key, Values::const_iterator & iter, Values::const_iterator & end) const +bool plConfigInfo::GetValueIterators(const plString & section, const plString & key, Values::const_iterator & iter, Values::const_iterator & end) const { Sections::const_iterator si = fSections.find(section); if (si==fSections.end()) @@ -432,63 +421,62 @@ bool plConfigInfo::WriteTo(plConfigSource * src) //////////////////////////////////////////////// -void plConfigSource::SplitAt(std::string & key, std::string & value, char splitter, std::string & in) +void plConfigSource::SplitAt(plString & key, plString & value, char splitter, plString & in) { - if(in.length() == 0) + if (in.IsEmpty()) return; - int t = in.find(splitter); - if(t == std::string::npos) + int t = in.Find(splitter); + if (t < 0) { key = in; return; } - key.assign(in.substr(0,t)); - value.assign(in.substr(t+1,in.size()-t-1)); + key = in.Left(t); + value = in.Substr(t+1,in.GetSize()-t-1); } -bool plConfigSource::ReadString(const std::string & in) +bool plConfigSource::ReadString(const plString & in) { - std::string work = in; - xtl::trim(work); + plString work = in.Trim(); // comment - if (work[0] == '#') + if (work.CharAt(0) == '#') return true; // comment - if (work[0] == ';') + if (work.CharAt(0) == ';') return true; // section - if (work[0] == '[') + if (work.CharAt(0) == '[') { - int close = work.find_first_of("]"); - if(close == std::string::npos) + int close = work.Find("]"); + if (close < 0) return false; - fCurrSection = work.substr(1,close-1); + fCurrSection = work.Substr(1, close-1); fEffectiveSection = fCurrSection; return true; } // key=value - std::string key, value; + plString key, value; SplitAt(key, value, '=', work); // dot notation makes section change for this key=value only. - int t = key.find('.'); - if (t>0 && t0 && tAddValue(fEffectiveSection, key, value, fAddMode); @@ -542,7 +529,7 @@ bool plConfigSource::WriteOutOf(plConfigInfo & configInfo) plCmdLineConfigSource::plCmdLineConfigSource(int argc, char ** argv, const char * mySection) : fArgc(argc) , fArgv(argv) -, fMySection(mySection?mySection:"") +, fMySection(mySection) {} @@ -560,7 +547,7 @@ bool plCmdLineConfigSource::ReadInto(plConfigInfo & configInfo, KAddValueMode mo if(argc < 1) return true; - fConfigInfo->AddValue(fEffectiveSection.c_str(), "ARGV0", *argv, fAddMode); + fConfigInfo->AddValue(fEffectiveSection, "ARGV0", *argv, fAddMode); argc--; argv++; @@ -582,7 +569,7 @@ bool plCmdLineConfigSource::ReadInto(plConfigInfo & configInfo, KAddValueMode mo plEnvConfigSource::plEnvConfigSource(char ** envp, const char * mySection) : fEnvp(envp) -, fMySection(mySection?mySection:"") +, fMySection(mySection) {} @@ -617,7 +604,7 @@ bool plIniConfigSource::ReadInto(plConfigInfo & configInfo, KAddValueMode mode) fCurrSection = plConfigInfo::GlobalSection(); fEffectiveSection = fCurrSection; - if(fFileName.size() < 2) + if(fFileName.GetSize() < 2) return false; @@ -760,33 +747,34 @@ bool plIniStreamConfigSource::WriteOutOf(plConfigInfo & configInfo) ///////////////////////////////////////////////// -plIniSectionConfigSource::plIniSectionConfigSource(const char * iniFileName, std::vector & sections) +plIniSectionConfigSource::plIniSectionConfigSource(const char * iniFileName, std::vector & sections) : plIniConfigSource(iniFileName) { for (int i=0; i::iterator ii = std::find(fSections.begin(), fSections.end(), fCurrSection.c_str()); + Sections::iterator ii = std::find_if(fSections.begin(), fSections.end(), + [this](const plString &v) { return v.CompareI(fCurrSection) == 0; } + ); if (ii==fSections.end()) return true; - xtl::trim(key); - xtl::trim(value); - xtl::trim(value,"\"'"); + key = key.Trim(); + value = value.Trim().Trim("\"'"); - if (key.size() == 0) + if (key.IsEmpty()) return true; - if (key == "section") - fSections.push_back(value.c_str()); + if (key.CompareI("section") == 0) + fSections.push_back(value); return fConfigInfo->AddValue(fEffectiveSection, key, value, fAddMode); } @@ -794,10 +782,7 @@ bool plIniSectionConfigSource::ReadPair(std::string & key, std::string & value) bool plIniSectionConfigSource::ReadSubSource( const char * name ) { - std::vector sections; - for ( int i=0; iReadFrom(&src); } @@ -809,21 +794,20 @@ plIniNoSectionsConfigSource::plIniNoSectionsConfigSource(const char * filename) fEffectiveSection = fCurrSection = ""; } -bool plIniNoSectionsConfigSource::ReadString(const std::string & in) +bool plIniNoSectionsConfigSource::ReadString(const plString & in) { - std::string work = in; - xtl::trim(work); + plString work = in.Trim(); // ignore comments - if (work[0]=='#' || work[0]==';') + if (work.CharAt(0)=='#' || work.CharAt(0)==';') return true; // ignore sections - if (work[0] == '[') + if (work.CharAt(0) == '[') return true; // parse key value - std::string key, value; + plString key, value; SplitAt(key, value, '=', work); return ReadPair(key, value); @@ -834,7 +818,7 @@ bool plIniNoSectionsConfigSource::ReadInto(plConfigInfo & configInfo, KAddValueM if (!plConfigSource::ReadInto(configInfo, mode)) return false; - if(fFileName.size() < 2) + if (fFileName.GetSize() < 2) return false; std::ifstream file; @@ -944,11 +928,11 @@ void plConfigValueBase::ConfigRead(plConfigInfo * opts) { if (fReadEvaluate()) { - std::string value; + plString value; bool found; value = opts->GetValue(GetConfigGroup(),GetConfigName(),"",&found); if (found) - SetValue(fReadModify(value).c_str()); + SetValue(fReadModify(value)); } } @@ -960,12 +944,12 @@ void plConfigValueBase::ConfigWrite(plConfigInfo * opts) } } -void plConfigValueBase::SetValue(const char * value) +void plConfigValueBase::SetValue(const plString & value) { - ISetValue(fSetModify(value).c_str()); + ISetValue(fSetModify(value)); } -std::string plConfigValueBase::GetValue() const +plString plConfigValueBase::GetValue() const { return fGetModify(IGetValue()); } @@ -1030,7 +1014,7 @@ bool plConfigGroup::Write(plConfigSource * src) void plConfigGroup::AddItem(plConfigValueBase * item, const char * name) { - item->SetConfigGroup(fGroupName.c_str()); + item->SetConfigGroup(fGroupName); if (name) item->SetConfigName(name); fItems.push_back(item); @@ -1071,29 +1055,28 @@ void plConfigAggregateValue::AddItems( if (item7) AddItem(item7); } -void plConfigAggregateValue::ISetValue(const char * value) +void plConfigAggregateValue::ISetValue(const plString & value) { - std::string work = value; + plString work = value.Trim(); int p=0,i=0; do { - xtl::trim(work); - p = work.find(" "); - fItems[i]->SetValue(work.substr(0,p).c_str()); - work.erase(0,p); + p = work.Find(" "); + fItems[i]->SetValue(work.Left(p)); + work = work.Substr(p).TrimLeft(); i++; - } while (i=0); } -std::string plConfigAggregateValue::IGetValue() const +plString plConfigAggregateValue::IGetValue() const { - std::string value; + plStringStream value; for (int i=0; iGetValue()); - value.append(" "); + value << fItems[i]->GetValue(); + value << ' '; } - return xtl::trim(value); + return value.GetString().Trim(); } void plConfigAggregateValue::AddItem(plConfigValueBase * item) @@ -1103,7 +1086,7 @@ void plConfigAggregateValue::AddItem(plConfigValueBase * item) //////////////////////////////////////////////////////////////////// -plWWWAuthenticateConfigSource::plWWWAuthenticateConfigSource(const std::string& auth) +plWWWAuthenticateConfigSource::plWWWAuthenticateConfigSource(const plString& auth) : fAuth(auth) { fEffectiveSection = fCurrSection = ""; @@ -1119,21 +1102,20 @@ bool plWWWAuthenticateConfigSource::ReadInto(plConfigInfo & configInfo, KAddValu unsigned int i = 0; - while (i < fAuth.size()) + while (i < fAuth.GetSize()) { bool inQuote = false; unsigned int begin = i,end; - while (i < fAuth.size() - && ((fAuth[i] != ',' && !inQuote) || inQuote)) + while (i < fAuth.GetSize() + && ((fAuth.CharAt(i) != ',' && !inQuote) || inQuote)) { - if (fAuth[i] == '"') + if (fAuth.CharAt(i) == '"') inQuote = ! inQuote; i++; } end = i; - std::string buf; - buf.assign(fAuth,begin,end-begin); + plString buf = fAuth.Substr(begin, end-begin); if(!ReadString(buf.c_str())) { // TODO log warning here diff --git a/Sources/Plasma/PubUtilLib/plContainer/plConfigInfo.h b/Sources/Plasma/PubUtilLib/plContainer/plConfigInfo.h index 2c13339d..f7b23293 100644 --- a/Sources/Plasma/PubUtilLib/plContainer/plConfigInfo.h +++ b/Sources/Plasma/PubUtilLib/plContainer/plConfigInfo.h @@ -43,13 +43,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plConfigInfo_h_inc #include "plKeysAndValues.h" -#include "hsStlUtils.h" #include ///////////////////////////////////////////////// -typedef std::vector plStringList; -typedef std::vector plWStringList; +typedef std::vector plStringList; ///////////////////////////////////////////////// @@ -61,10 +59,10 @@ public: Keys; typedef plKeysAndValues::Values Values; - typedef std::map + typedef std::map Sections; - static const std::string& GlobalSection(); + static const plString& GlobalSection(); private: mutable Sections fSections; @@ -79,54 +77,54 @@ public: // remove all sections void Clear(); // remove section - void RemoveSection(const std::string & section); + void RemoveSection(const plString & section); // remove key from section - void RemoveKey(const std::string & section, const std::string & key); + void RemoveKey(const plString & section, const plString & key); // QUERY // does this section exist? - bool HasSection(const std::string & section) const; + bool HasSection(const plString & section) const; // does the given section contain this key? - bool HasKey(const std::string & section, const std::string & key); + bool HasKey(const plString & section, const plString & key); // does any section contain this key? - bool HasKeyAny(const std::string & key); + bool HasKeyAny(const plString & key); // does any of the given sections contain this key? - bool HasKeyIn(const std::string & key, const char * section1, ... /*, nil*/); - bool HasKeyIn(const std::string & key, const std::vector & sections ); + bool HasKeyIn(const plString & key, const char * section1, ... /*, nil*/); + bool HasKeyIn(const plString & key, const std::vector & sections ); // does key in section have this value? - bool KeyHasValue(const std::string & section, const std::string & key, const std::string & value); - bool KeyHasValue(const std::string & section, const std::string & key, int value); - bool KeyHasValue(const std::string & section, const std::string & key, double value); + bool KeyHasValue(const plString & section, const plString & key, const plString & value); + bool KeyHasValue(const plString & section, const plString & key, int value); + bool KeyHasValue(const plString & section, const plString & key, double value); // ADD // add key=value to the section - bool AddValue(const std::string & section, const std::string & key, const std::string & value, KAddValueMode mode=kAlwaysAdd); - bool AddValue(const std::string & section, const std::string & key, int value, KAddValueMode mode=kAlwaysAdd); - bool AddValue(const std::string & section, const std::string & key, double value, KAddValueMode mode=kAlwaysAdd); - bool AddValues(const std::string & section, const std::string & key, const std::vector & values, KAddValueMode mode=kAlwaysAdd); + bool AddValue(const plString & section, const plString & key, const plString & value, KAddValueMode mode=kAlwaysAdd); + bool AddValue(const plString & section, const plString & key, int value, KAddValueMode mode=kAlwaysAdd); + bool AddValue(const plString & section, const plString & key, double value, KAddValueMode mode=kAlwaysAdd); + bool AddValues(const plString & section, const plString & key, const std::vector & values, KAddValueMode mode=kAlwaysAdd); // GET - plKeysAndValues GetSection(const std::string & section, bool & found); - std::vector GetSectionNames(); + plKeysAndValues GetSection(const plString & section, bool & found); + std::vector GetSectionNames(); // get value for key from given section - std::string GetValue(const std::string & section, const std::string & key, const std::string & defval="", bool * outFound=nil) const; - int GetValue(const std::string & section, const std::string & key, int defval, bool * outFound=nil) const; - double GetValue(const std::string & section, const std::string & key, double defval, bool * outFound=nil) const; - std::vector GetAllValues(const std::string & section, const std::string & key) const; + plString GetValue(const plString & section, const plString & key, const plString & defval="", bool * outFound=nil) const; + int GetValue(const plString & section, const plString & key, int defval, bool * outFound=nil) const; + double GetValue(const plString & section, const plString & key, double defval, bool * outFound=nil) const; + std::vector GetAllValues(const plString & section, const plString & key) const; // get value for key from any section - std::string GetValueAny(const std::string & key, const std::string & defval="", bool * outFound=nil) const; - int GetValueAny(const std::string & key, int defval, bool * outFound=nil) const; - double GetValueAny(const std::string & key, double defval, bool * outFound=nil) const; - std::vector GetAllValuesAny(const std::string & key) const; + plString GetValueAny(const plString & key, const plString & defval="", bool * outFound=nil) const; + int GetValueAny(const plString & key, int defval, bool * outFound=nil) const; + double GetValueAny(const plString & key, double defval, bool * outFound=nil) const; + std::vector GetAllValuesAny(const plString & key) const; // get value for key from one of the given sections - std::string GetValueIn(const std::string & key, const std::string & defval, bool * outFound, const char * section1, ... /*, nil*/) const; - std::string GetValueIn(const std::string & key, const std::string & defval, bool * outFound, const std::vector & sections ) const; - int GetValueIn(const std::string & key, int defval, bool * outFound, const char * section1, ... /*, nil*/) const; - int GetValueIn(const std::string & key, int defval, bool * outFound, const std::vector & sections ) const; - double GetValueIn(const std::string & key, double defval, bool * outFound, const char * section1, ... /*, nil*/) const; - double GetValueIn(const std::string & key, double defval, bool * outFound, const std::vector & sections ) const; - std::vector GetAllValuesIn(const std::string & key, const char * section1, ... /*, nil*/); + plString GetValueIn(const plString & key, const plString & defval, bool * outFound, const char * section1, ... /*, nil*/) const; + plString GetValueIn(const plString & key, const plString & defval, bool * outFound, const std::vector & sections ) const; + int GetValueIn(const plString & key, int defval, bool * outFound, const char * section1, ... /*, nil*/) const; + int GetValueIn(const plString & key, int defval, bool * outFound, const std::vector & sections ) const; + double GetValueIn(const plString & key, double defval, bool * outFound, const char * section1, ... /*, nil*/) const; + double GetValueIn(const plString & key, double defval, bool * outFound, const std::vector & sections ) const; + std::vector GetAllValuesIn(const plString & key, const char * section1, ... /*, nil*/); // ITERATORS bool GetSectionIterators(Sections::const_iterator & iter, Sections::const_iterator & end) const; - bool GetKeyIterators(const xtl::istring & section, Keys::const_iterator & iter, Keys::const_iterator & end) const; - bool GetValueIterators(const xtl::istring & section, const xtl::istring & key, Values::const_iterator & iter, Values::const_iterator & end) const; + bool GetKeyIterators(const plString & section, Keys::const_iterator & iter, Keys::const_iterator & end) const; + bool GetValueIterators(const plString & section, const plString & key, Values::const_iterator & iter, Values::const_iterator & end) const; // CONFIG SOURCE virtual bool ReadFrom(plConfigSource * src, KAddValueMode mode=kAlwaysAdd); virtual bool WriteTo(plConfigSource * src); @@ -145,33 +143,33 @@ public: plConfigInfo* GetConfigInfo() { return &fConfigInfo; } plConfigInfo* GetConfigInfoLog() { return &fLog; } - bool GetValue(std::string& retval, const std::string & section, const std::string & key, const std::string & desc, const std::string& defval = ""); - bool GetValue(int& retval, const std::string & section, const std::string & key, const std::string & desc, int defval); - bool GetValue(bool& retval, const std::string & section, const std::string & key, const std::string & desc, bool defval); - bool GetValue(float& retval, const std::string & section, const std::string & key, const std::string & desc, float defval); - bool GetValue(double& retval, const std::string & section, const std::string & key, const std::string & desc, double defval); - bool GetAllValues(std::vector& values, const std::string & section, const std::string & key, const std::string & desc); + bool GetValue(plString& retval, const plString & section, const plString & key, const plString & desc, const plString& defval = ""); + bool GetValue(int& retval, const plString & section, const plString & key, const plString & desc, int defval); + bool GetValue(bool& retval, const plString & section, const plString & key, const plString & desc, bool defval); + bool GetValue(float& retval, const plString & section, const plString & key, const plString & desc, float defval); + bool GetValue(double& retval, const plString & section, const plString & key, const plString & desc, double defval); + bool GetAllValues(std::vector& values, const plString & section, const plString & key, const plString & desc); #if USE_MULT_SECTIONS // get value for key from any section - bool GetValueAny(std::string& retval, const std::string & key, const std::string & desc, const std::string & defval); - bool GetValueAny(int &retval, const std::string & key, const std::string & desc, int defval); - bool GetValueAny(bool& retval, const std::string & key, const std::string & desc, bool defval); - bool GetValueAny(float& retval, const std::string & key, const std::string & desc, float defval); - bool GetValueAny(double& retval, const std::string & key, const std::string & desc, double defval); - bool GetAllValuesAny(std::vector& values, const std::string & key, const std::string & desc); + bool GetValueAny(plString& retval, const plString & key, const plString & desc, const plString & defval); + bool GetValueAny(int &retval, const plString & key, const plString & desc, int defval); + bool GetValueAny(bool& retval, const plString & key, const plString & desc, bool defval); + bool GetValueAny(float& retval, const plString & key, const plString & desc, float defval); + bool GetValueAny(double& retval, const plString & key, const plString & desc, double defval); + bool GetAllValuesAny(std::vector& values, const plString & key, const plString & desc); // get value for key from one of the given sections - bool GetValueIn(std::string& retval, const std::string & key, const std::string & desc, const std::string & defval, const char * section1, ... /*, nil*/); - bool GetValueIn(std::string& retval, const std::string & key, const std::string & desc, const std::string & defval, std::vector & sections ); - bool GetValueIn(int& retval, const std::string & key, const std::string & desc, int defval, const char * section1, ... /*, nil*/); - bool GetValueIn(int& retval, const std::string & key, const std::string & desc, int defval, std::vector & sections ); - bool GetValueIn(bool& retval, const std::string & key, const std::string & desc, bool defval, const char * section1, ... /*, nil*/); - bool GetValueIn(bool& retval, const std::string & key, const std::string & desc, bool defval, std::vector & sections ); - bool GetValueIn(float& retval, const std::string & key, const std::string & desc, double defval, const char * section1, ... /*, nil*/); - bool GetValueIn(float& retval, const std::string & key, const std::string & desc, double defval, std::vector & sections ); - bool GetValueIn(double& retval, const std::string & key, const std::string & desc, double defval, const char * section1, ... /*, nil*/); - bool GetValueIn(double& retval, const std::string & key, const std::string & desc, double defval, std::vector & sections ); + bool GetValueIn(plString& retval, const plString & key, const plString & desc, const plString & defval, const char * section1, ... /*, nil*/); + bool GetValueIn(plString& retval, const plString & key, const plString & desc, const plString & defval, std::vector & sections ); + bool GetValueIn(int& retval, const plString & key, const plString & desc, int defval, const char * section1, ... /*, nil*/); + bool GetValueIn(int& retval, const plString & key, const plString & desc, int defval, std::vector & sections ); + bool GetValueIn(bool& retval, const plString & key, const plString & desc, bool defval, const char * section1, ... /*, nil*/); + bool GetValueIn(bool& retval, const plString & key, const plString & desc, bool defval, std::vector & sections ); + bool GetValueIn(float& retval, const plString & key, const plString & desc, double defval, const char * section1, ... /*, nil*/); + bool GetValueIn(float& retval, const plString & key, const plString & desc, double defval, std::vector & sections ); + bool GetValueIn(double& retval, const plString & key, const plString & desc, double defval, const char * section1, ... /*, nil*/); + bool GetValueIn(double& retval, const plString & key, const plString & desc, double defval, std::vector & sections ); #endif }; @@ -180,14 +178,14 @@ public: class plConfigSource { protected: - std::string fCurrSection; // used in parsing - std::string fEffectiveSection; // used in parsing + plString fCurrSection; // used in parsing + plString fEffectiveSection; // used in parsing KAddValueMode fAddMode; // used in parsing plConfigInfo * fConfigInfo; - void SplitAt(std::string & key, std::string & value, char splitter, std::string & in); - virtual bool ReadString(const std::string & in); - virtual bool ReadPair(std::string & key, std::string & value); + void SplitAt(plString & key, plString & value, char splitter, plString & in); + virtual bool ReadString(const plString & in); + virtual bool ReadPair(plString & key, plString & value); virtual bool ReadList(char ** list); virtual bool ReadSubSource( const char * name ) { return true; } @@ -209,7 +207,7 @@ class plCmdLineConfigSource : public plConfigSource { int fArgc; char ** fArgv; - std::string fMySection; + plString fMySection; protected: bool ReadInto(plConfigInfo & configInfo, KAddValueMode mode=kAlwaysAdd); public: @@ -222,7 +220,7 @@ public: class plEnvConfigSource : public plConfigSource { char ** fEnvp; - std::string fMySection; + plString fMySection; protected: bool ReadInto(plConfigInfo & configInfo, KAddValueMode mode=kAlwaysAdd); public: @@ -235,7 +233,7 @@ public: class plIniConfigSource : public plConfigSource { protected: - std::string fFileName; + plString fFileName; bool ReadInto(plConfigInfo & configInfo, KAddValueMode mode=kAlwaysAdd); bool WriteOutOf(plConfigInfo & configInfo); public: @@ -262,9 +260,9 @@ public: // data in an unnamed section, or more accurately, in a section named "". class plIniNoSectionsConfigSource : public plConfigSource { - std::string fFileName; + plString fFileName; protected: - bool ReadString(const std::string & in); + bool ReadString(const plString & in); bool ReadInto(plConfigInfo & configInfo, KAddValueMode mode=kAlwaysAdd); bool WriteOutOf(plConfigInfo & configInfo); public: @@ -276,14 +274,14 @@ public: // an ini file reader that only reads specified sections class plIniSectionConfigSource : public plIniConfigSource { - typedef std::vector + typedef std::vector Sections; protected: Sections fSections; - bool ReadPair(std::string & key, std::string & value); + bool ReadPair(plString & key, plString & value); bool ReadSubSource( const char * name ); public: - plIniSectionConfigSource(const char * iniFileName, std::vector & sections); + plIniSectionConfigSource(const char * iniFileName, std::vector & sections); }; ///////////////////////////////////////////////// @@ -304,7 +302,7 @@ public: class plDebugConfigSource : public plConfigSource { protected: - std::string fFileName; + plString fFileName; bool WriteOutOf(plConfigInfo & configInfo); public: plDebugConfigSource(){} @@ -314,11 +312,11 @@ public: class plWWWAuthenticateConfigSource : public plConfigSource { - const std::string& fAuth; + const plString& fAuth; protected: bool ReadInto(plConfigInfo & configInfo, KAddValueMode mode=kAlwaysAdd); public: - plWWWAuthenticateConfigSource(const std::string& auth); + plWWWAuthenticateConfigSource(const plString& auth); }; //////////////////////////////////////////////////////////////////// @@ -363,18 +361,18 @@ struct plEvaluate //////////////////////////////////////////////////////////////////// -typedef std::string (plClass::*TModify)(const std::string & value); +typedef plString (plClass::*TModify)(const plString & value); struct plModify { plClass * fTarget; - std::string (plClass::*fModify)(const std::string & value); + plString (plClass::*fModify)(const plString & value); plModify( plClass * target=nil, TModify modify=nil ) : fTarget(target) , fModify(modify) {} - std::string operator()(const std::string & value) { return (fTarget)?(fTarget->*fModify)(value):value;} - std::string operator()(const std::string & value) const { return (fTarget)?(fTarget->*fModify)(value):value;} + plString operator()(const plString & value) { return (fTarget)?(fTarget->*fModify)(value):value;} + plString operator()(const plString & value) const { return (fTarget)?(fTarget->*fModify)(value):value;} }; //////////////////////////////////////////////////////////////////// @@ -382,8 +380,8 @@ struct plModify class plConfigValueBase { public: - std::string fConfigName; - std::string fConfigGroup; + plString fConfigName; + plString fConfigGroup; plEvaluate fReadEvaluate; // returns true if we want to read this value from options plEvaluate fWriteEvaluate; // returns true if we want to write this value to options plModify fReadModify; // may modify the value being read from options @@ -394,18 +392,18 @@ public: : fConfigName(configName) , fConfigGroup(configGroup) {} - void SetConfigName(const char * name) { fConfigName=(name)?name:"";} - std::string GetConfigName() const { return fConfigName;} - void SetConfigGroup(const char * group) { fConfigGroup=group;} - std::string GetConfigGroup() const { return fConfigGroup;} - bool HasConfigName() { return fConfigName.length()>0;} - bool HasConfigGroup() { return fConfigGroup.length()>0;} + void SetConfigName(const plString & name) { fConfigName=name;} + plString GetConfigName() const { return fConfigName;} + void SetConfigGroup(const plString & group) { fConfigGroup=group;} + plString GetConfigGroup() const { return fConfigGroup;} + bool HasConfigName() { return !fConfigName.IsEmpty();} + bool HasConfigGroup() { return !fConfigGroup.IsEmpty();} virtual void ConfigRead(plConfigInfo * opts); virtual void ConfigWrite(plConfigInfo * opts); - void SetValue(const char * value); - std::string GetValue() const; - virtual void ISetValue(const char * value) = 0; - virtual std::string IGetValue() const = 0; + void SetValue(const plString & value); + plString GetValue() const; + virtual void ISetValue(const plString & value) = 0; + virtual plString IGetValue() const = 0; void SetReadEvaluate(plClass * targetObj, TEvaluate evalFunc); void SetWriteEvaluate(plClass * targetObj, TEvaluate evalFunc); @@ -424,9 +422,9 @@ public: plConfigValue( const char * configName="", const char * configGroup="" ) : plConfigValueBase(configName, configGroup) {} - std::string fConfigValue; - void ISetValue(const char * value) { fConfigValue=value;} - std::string IGetValue() const { return fConfigValue;} + plString fConfigValue; + void ISetValue(const plString & value) { fConfigValue=value;} + plString IGetValue() const { return fConfigValue;} }; //////////////////////////////////////////////////////////////////// @@ -451,8 +449,8 @@ public: plConfigValueBase * item5=nil, plConfigValueBase * item6=nil, plConfigValueBase * item7=nil); - void ISetValue(const char * value); - std::string IGetValue() const; + void ISetValue(const plString & value); + plString IGetValue() const; void AddItem(plConfigValueBase * item); void AddItems( plConfigValueBase * item1=nil, @@ -474,8 +472,8 @@ public: : fConfigurable(item) {} void Set(plConfigValueBase * item) { fConfigurable=item;} - void ISetValue(const char * value) { fConfigurable->ISetValue(value);} - std::string IGetValue() const { return fConfigurable->IGetValue();} + void ISetValue(const plString & value) { fConfigurable->ISetValue(value);} + plString IGetValue() const { return fConfigurable->IGetValue();} }; //////////////////////////////////////////////////////////////////// @@ -484,7 +482,7 @@ class plConfigGroup { public: plConfigInfo fOpts; - std::string fGroupName; + plString fGroupName; std::vector fItems; plConfigGroup(const char * groupName=""); bool Read(plConfigSource * src); diff --git a/Sources/Plasma/PubUtilLib/plContainer/plConfigInfoLogging.cpp b/Sources/Plasma/PubUtilLib/plContainer/plConfigInfoLogging.cpp index 282a06c6..6ec622d4 100644 --- a/Sources/Plasma/PubUtilLib/plContainer/plConfigInfoLogging.cpp +++ b/Sources/Plasma/PubUtilLib/plContainer/plConfigInfoLogging.cpp @@ -49,10 +49,9 @@ plConfigInfoLogging::~plConfigInfoLogging() { } -bool plConfigInfoLogging::GetValue(std::string& retval, const std::string & section, const std::string & key, const std::string & desc, const std::string& defval) +bool plConfigInfoLogging::GetValue(plString& retval, const plString & section, const plString & key, const plString & desc, const plString& defval) { - std::string descwdef; - xtl::format(descwdef,"%s # %s",defval.c_str(),desc.c_str()); + plString descwdef = plString::Format("%s # %s",defval.c_str(),desc.c_str()); fLog.AddValue(section,key,descwdef,kReplaceIfExists); bool found; @@ -60,10 +59,9 @@ bool plConfigInfoLogging::GetValue(std::string& retval, const std::string & sect return found; } -bool plConfigInfoLogging::GetValue(int& retval, const std::string & section, const std::string & key, const std::string & desc, int defval) +bool plConfigInfoLogging::GetValue(int& retval, const plString & section, const plString & key, const plString & desc, int defval) { - std::string descwdef; - xtl::format(descwdef,"%d # %s",defval,desc.c_str()); + plString descwdef = plString::Format("%d # %s",defval,desc.c_str()); fLog.AddValue(section,key,descwdef,kReplaceIfExists); bool found; @@ -71,10 +69,9 @@ bool plConfigInfoLogging::GetValue(int& retval, const std::string & section, con return found; } -bool plConfigInfoLogging::GetValue(bool& retval, const std::string & section, const std::string & key, const std::string & desc, bool defval) +bool plConfigInfoLogging::GetValue(bool& retval, const plString & section, const plString & key, const plString & desc, bool defval) { - std::string descwdef; - xtl::format(descwdef,"%d # %s",defval,desc.c_str()); + plString descwdef = plString::Format("%d # %s",defval,desc.c_str()); fLog.AddValue(section,key,descwdef,kReplaceIfExists); bool found; @@ -82,10 +79,9 @@ bool plConfigInfoLogging::GetValue(bool& retval, const std::string & section, co return found; } -bool plConfigInfoLogging::GetValue(float& retval, const std::string & section, const std::string & key, const std::string & desc, float defval) +bool plConfigInfoLogging::GetValue(float& retval, const plString & section, const plString & key, const plString & desc, float defval) { - std::string descwdef; - xtl::format(descwdef,"%f # %s",defval,desc.c_str()); + plString descwdef = plString::Format("%f # %s",defval,desc.c_str()); fLog.AddValue(section,key,descwdef,kReplaceIfExists); bool found; @@ -94,10 +90,9 @@ bool plConfigInfoLogging::GetValue(float& retval, const std::string & section, c return found; } -bool plConfigInfoLogging::GetValue(double& retval, const std::string & section, const std::string & key, const std::string & desc, double defval) +bool plConfigInfoLogging::GetValue(double& retval, const plString & section, const plString & key, const plString & desc, double defval) { - std::string descwdef; - xtl::format(descwdef,"%f # %s",defval,desc.c_str()); + plString descwdef = plString::Format("%f # %s",defval,desc.c_str()); fLog.AddValue(section,key,descwdef,kReplaceIfExists); bool found; @@ -105,10 +100,9 @@ bool plConfigInfoLogging::GetValue(double& retval, const std::string & section, return found; } -bool plConfigInfoLogging::GetAllValues(std::vector& values, const std::string & section, const std::string & key, const std::string & desc) +bool plConfigInfoLogging::GetAllValues(std::vector& values, const plString & section, const plString & key, const plString & desc) { - std::string descwdef; - xtl::format(descwdef,"%s # %s","\"Multiple Entries\"",desc.c_str()); + plString descwdef = plString::Format("%s # %s","\"Multiple Entries\"",desc.c_str()); fLog.AddValue(section,key,descwdef,kReplaceIfExists); values = fConfigInfo.GetAllValues(section,key); @@ -117,7 +111,7 @@ bool plConfigInfoLogging::GetAllValues(std::vector& values, const s #if USE_MULT_SECTIONS -bool plConfigInfoLogging::GetValueAny(std::string& retval, const std::string & key, const std::string & desc, const std::string & defval) +bool plConfigInfoLogging::GetValueAny(plString& retval, const plString & key, const plString & desc, const plString & defval) { fLog.AddValue("ANY SECTION",key,desc,kReplaceIfExists); @@ -126,7 +120,7 @@ bool plConfigInfoLogging::GetValueAny(std::string& retval, const std::string & k return found; } -bool plConfigInfoLogging::GetValueAny(int &retval, const std::string & key, const std::string & desc, int defval) +bool plConfigInfoLogging::GetValueAny(int &retval, const plString & key, const plString & desc, int defval) { fLog.AddValue("ANY SECTION",key,desc,kReplaceIfExists); @@ -135,7 +129,7 @@ bool plConfigInfoLogging::GetValueAny(int &retval, const std::string & key, cons return found; } -bool plConfigInfoLogging::GetValueAny(bool &retval, const std::string & key, const std::string & desc, bool defval) +bool plConfigInfoLogging::GetValueAny(bool &retval, const plString & key, const plString & desc, bool defval) { fLog.AddValue("ANY SECTION",key,desc,kReplaceIfExists); @@ -144,7 +138,7 @@ bool plConfigInfoLogging::GetValueAny(bool &retval, const std::string & key, con return found; } -bool plConfigInfoLogging::GetValueAny(float& retval, const std::string & key, const std::string & desc, float defval) +bool plConfigInfoLogging::GetValueAny(float& retval, const plString & key, const plString & desc, float defval) { fLog.AddValue("ANY SECTION",key,desc,kReplaceIfExists); @@ -153,7 +147,7 @@ bool plConfigInfoLogging::GetValueAny(float& retval, const std::string & key, co return found; } -bool plConfigInfoLogging::GetValueAny(double& retval, const std::string & key, const std::string & desc, double defval) +bool plConfigInfoLogging::GetValueAny(double& retval, const plString & key, const plString & desc, double defval) { fLog.AddValue("ANY SECTION",key,desc,kReplaceIfExists); @@ -162,7 +156,7 @@ bool plConfigInfoLogging::GetValueAny(double& retval, const std::string & key, c return found; } -bool plConfigInfoLogging::GetAllValuesAny(std::vector& values, const std::string & key, const std::string & desc) +bool plConfigInfoLogging::GetAllValuesAny(std::vector& values, const plString & key, const plString & desc) { fLog.AddValue("ANY SECTION",key,desc,kReplaceIfExists); @@ -170,12 +164,12 @@ bool plConfigInfoLogging::GetAllValuesAny(std::vector& values, cons return values.size() != 0; } -bool plConfigInfoLogging::GetValueIn(std::string& retval, const std::string & key, const std::string & desc, const std::string & defval, const char * section1, ... /*, nil*/) +bool plConfigInfoLogging::GetValueIn(plString& retval, const plString & key, const plString & desc, const plString & defval, const char * section1, ... /*, nil*/) { const char * section = section1; va_list va; va_start(va,section1); - std::vector sections; + std::vector sections; while (section) { sections.push_back( section ); @@ -186,9 +180,9 @@ bool plConfigInfoLogging::GetValueIn(std::string& retval, const std::string & ke return GetValueIn(retval,key,desc,defval,sections); } -bool plConfigInfoLogging::GetValueIn(std::string& retval, const std::string & key, const std::string & desc, const std::string & defval, std::vector & sections ) +bool plConfigInfoLogging::GetValueIn(plString& retval, const plString & key, const plString & desc, const plString & defval, std::vector & sections ) { - std::vector::iterator si = sections.begin(); + std::vector::iterator si = sections.begin(); while (si != sections.end()) { fLog.AddValue(*si,key,desc,kReplaceIfExists); @@ -200,12 +194,12 @@ bool plConfigInfoLogging::GetValueIn(std::string& retval, const std::string & ke return found; } -bool plConfigInfoLogging::GetValueIn(int& retval, const std::string & key, const std::string & desc, int defval, const char * section1, ... /*, nil*/) +bool plConfigInfoLogging::GetValueIn(int& retval, const plString & key, const plString & desc, int defval, const char * section1, ... /*, nil*/) { const char * section = section1; va_list va; va_start(va,section1); - std::vector sections; + std::vector sections; while (section) { sections.push_back( section ); @@ -216,9 +210,9 @@ bool plConfigInfoLogging::GetValueIn(int& retval, const std::string & key, cons return GetValueIn(retval,key,desc,defval,sections); } -bool plConfigInfoLogging::GetValueIn(int& retval, const std::string & key, const std::string & desc, int defval, std::vector & sections ) +bool plConfigInfoLogging::GetValueIn(int& retval, const plString & key, const plString & desc, int defval, std::vector & sections ) { - std::vector::iterator si = sections.begin(); + std::vector::iterator si = sections.begin(); while (si != sections.end()) { fLog.AddValue(*si,key,desc,kReplaceIfExists); @@ -230,12 +224,12 @@ bool plConfigInfoLogging::GetValueIn(int& retval, const std::string & key, cons return found; } -bool plConfigInfoLogging::GetValueIn(bool& retval, const std::string & key, const std::string & desc, bool defval, const char * section1, ... /*, nil*/) +bool plConfigInfoLogging::GetValueIn(bool& retval, const plString & key, const plString & desc, bool defval, const char * section1, ... /*, nil*/) { const char * section = section1; va_list va; va_start(va,section1); - std::vector sections; + std::vector sections; while (section) { sections.push_back( section ); @@ -246,9 +240,9 @@ bool plConfigInfoLogging::GetValueIn(bool& retval, const std::string & key, con return GetValueIn(retval,key,desc,defval,sections); } -bool plConfigInfoLogging::GetValueIn(bool& retval, const std::string & key, const std::string & desc, bool defval, std::vector & sections ) +bool plConfigInfoLogging::GetValueIn(bool& retval, const plString & key, const plString & desc, bool defval, std::vector & sections ) { - std::vector::iterator si = sections.begin(); + std::vector::iterator si = sections.begin(); while (si != sections.end()) { fLog.AddValue(*si,key,desc,kReplaceIfExists); @@ -260,12 +254,12 @@ bool plConfigInfoLogging::GetValueIn(bool& retval, const std::string & key, con return found; } -bool plConfigInfoLogging::GetValueIn(float& retval, const std::string & key, const std::string & desc, double defval, const char * section1, ... /*, nil*/) +bool plConfigInfoLogging::GetValueIn(float& retval, const plString & key, const plString & desc, double defval, const char * section1, ... /*, nil*/) { const char * section = section1; va_list va; va_start(va,section1); - std::vector sections; + std::vector sections; while (section) { sections.push_back( section ); @@ -276,9 +270,9 @@ bool plConfigInfoLogging::GetValueIn(float& retval, const std::string & key, co return GetValueIn(retval,key,desc,defval,sections); } -bool plConfigInfoLogging::GetValueIn(float& retval, const std::string & key, const std::string & desc, double defval, std::vector & sections ) +bool plConfigInfoLogging::GetValueIn(float& retval, const plString & key, const plString & desc, double defval, std::vector & sections ) { - std::vector::iterator si = sections.begin(); + std::vector::iterator si = sections.begin(); while (si != sections.end()) { fLog.AddValue(*si,key,desc,kReplaceIfExists); @@ -290,12 +284,12 @@ bool plConfigInfoLogging::GetValueIn(float& retval, const std::string & key, co return found; } -bool plConfigInfoLogging::GetValueIn(double& retval, const std::string & key, const std::string & desc, double defval, const char * section1, ... /*, nil*/) +bool plConfigInfoLogging::GetValueIn(double& retval, const plString & key, const plString & desc, double defval, const char * section1, ... /*, nil*/) { const char * section = section1; va_list va; va_start(va,section1); - std::vector sections; + std::vector sections; while (section) { sections.push_back( section ); @@ -306,9 +300,9 @@ bool plConfigInfoLogging::GetValueIn(double& retval, const std::string & key, c return GetValueIn(retval,key,desc,defval,sections); } -bool plConfigInfoLogging::GetValueIn(double& retval, const std::string & key, const std::string & desc, double defval, std::vector & sections ) +bool plConfigInfoLogging::GetValueIn(double& retval, const plString & key, const plString & desc, double defval, std::vector & sections ) { - std::vector::iterator si = sections.begin(); + std::vector::iterator si = sections.begin(); while (si != sections.end()) { fLog.AddValue(*si,key,desc,kReplaceIfExists); diff --git a/Sources/Plasma/PubUtilLib/plContainer/plContainer.h b/Sources/Plasma/PubUtilLib/plContainer/plContainer.h index c59ff697..b6eecccc 100644 --- a/Sources/Plasma/PubUtilLib/plContainer/plContainer.h +++ b/Sources/Plasma/PubUtilLib/plContainer/plContainer.h @@ -43,7 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plContainer_h_inc #include "HeadSpin.h" -#include "hsStlUtils.h" template < class T > class plDataContainerT diff --git a/Sources/Plasma/PubUtilLib/plContainer/plKeysAndValues.cpp b/Sources/Plasma/PubUtilLib/plContainer/plKeysAndValues.cpp index 4335acca..913141e5 100644 --- a/Sources/Plasma/PubUtilLib/plContainer/plKeysAndValues.cpp +++ b/Sources/Plasma/PubUtilLib/plContainer/plKeysAndValues.cpp @@ -65,41 +65,37 @@ void plKeysAndValues::Clear() fKeys.clear(); } -void plKeysAndValues::RemoveKey(const std::string & key) +void plKeysAndValues::RemoveKey(const plString & key) { - fKeys.erase(key.c_str()); + fKeys.erase(key); } -bool plKeysAndValues::HasKey(const std::string & key) const +bool plKeysAndValues::HasKey(const plString & key) const { - return (fKeys.find(key.c_str()) != fKeys.end()); + return (fKeys.find(key) != fKeys.end()); } -bool plKeysAndValues::KeyHasValue(const std::string & key, const std::string & value) +bool plKeysAndValues::KeyHasValue(const plString & key, const plString & value) { - Keys::const_iterator ki = fKeys.find(key.c_str()); + Keys::const_iterator ki = fKeys.find(key); if (ki==fKeys.end()) return false; - return std::find(ki->second.begin(),ki->second.end(), value.c_str()) != ki->second.end(); + return std::find_if(ki->second.begin(), ki->second.end(), + [&value](const plString &v) { return v.CompareI(value) == 0; } + ) != ki->second.end(); } -bool plKeysAndValues::KeyHasValue(const std::string & key, int value) +bool plKeysAndValues::KeyHasValue(const plString & key, int value) { - char buf[20]; - sprintf(buf, "%d", value); - std::string v(buf); - return KeyHasValue(key, v); + return KeyHasValue(key, plString::Format("%d", value)); } -bool plKeysAndValues::KeyHasValue(const std::string & key, double value) +bool plKeysAndValues::KeyHasValue(const plString & key, double value) { - char buf[30]; - sprintf(buf, "%f", value); - std::string v(buf); - return KeyHasValue(key, v); + return KeyHasValue(key, plString::Format("%f", value)); } -bool plKeysAndValues::AddValue(const std::string & key, const std::string & value, KAddValueMode mode) +bool plKeysAndValues::AddValue(const plString & key, const plString & value, KAddValueMode mode) { switch (mode) { @@ -114,97 +110,75 @@ bool plKeysAndValues::AddValue(const std::string & key, const std::string & valu default: break; } - fKeys[key.c_str()].push_front(value.c_str()); + fKeys[key].push_front(value); return true; } -bool plKeysAndValues::AddValue(const std::string & key, int value, KAddValueMode mode) +bool plKeysAndValues::AddValue(const plString & key, int value, KAddValueMode mode) { - char buf[20]; - sprintf(buf, "%d", value); - std::string v(buf); - return AddValue(key,v,mode); + return AddValue(key, plString::Format("%d", value), mode); } -bool plKeysAndValues::AddValue(const std::string & key, double value, KAddValueMode mode) +bool plKeysAndValues::AddValue(const plString & key, double value, KAddValueMode mode) { - char buf[30]; - sprintf(buf, "%f", value); - std::string v(buf); - return AddValue(key,v,mode); + return AddValue(key, plString::Format("%f", value), mode); } -bool plKeysAndValues::AddValues(const std::string & key, const std::vector & values, KAddValueMode mode) +bool plKeysAndValues::AddValues(const plString & key, const std::vector & values, KAddValueMode mode) { for (int i=0; isecond.front().c_str(); -// fKeys[key.c_str()].push_front(defval.c_str()); + return ki->second.front(); +// fKeys[key].push_front(defval); return defval; } -uint32_t plKeysAndValues::GetValue(const std::string & key, uint32_t defval, bool * outFound) const +uint32_t plKeysAndValues::GetValue(const plString & key, uint32_t defval, bool * outFound) const { - char buf[20]; - sprintf(buf, "%ul", defval); - std::string v(buf); - return strtoul(GetValue(key,v,outFound).c_str(), nil, 0); + return strtoul(GetValue(key, plString::Format("%ul", defval), outFound).c_str(), nil, 0); } -int plKeysAndValues::GetValue(const std::string & key, int defval, bool * outFound) const +int plKeysAndValues::GetValue(const plString & key, int defval, bool * outFound) const { - char buf[20]; - sprintf(buf, "%d", defval); - std::string v(buf); - return atol(GetValue(key,v,outFound).c_str()); + return atol(GetValue(key, plString::Format("%d", defval), outFound).c_str()); } -double plKeysAndValues::GetValue(const std::string & key, double defval, bool * outFound) const +double plKeysAndValues::GetValue(const plString & key, double defval, bool * outFound) const { - char buf[30]; - sprintf(buf, "%f", defval); - std::string v(buf); - return atof(GetValue(key,v,outFound).c_str()); + return atof(GetValue(key, plString::Format("%f", defval), outFound).c_str()); } -std::vector plKeysAndValues::GetAllValues(const std::string & key) +std::vector plKeysAndValues::GetAllValues(const plString & key) { - std::vector result; - xtl::istring xkey = key.c_str(); + std::vector result; if (HasKey(key)) - for (Values::const_iterator vi=fKeys[xkey].begin(); vi!=fKeys[xkey].end(); ++vi) - result.push_back(vi->c_str()); + for (Values::const_iterator vi=fKeys[key].begin(); vi!=fKeys[key].end(); ++vi) + result.push_back(*vi); return result; } @@ -215,7 +189,7 @@ bool plKeysAndValues::GetKeyIterators(Keys::const_iterator & iter, Keys::const_i return true; } -bool plKeysAndValues::GetValueIterators(const xtl::istring & key, Values::const_iterator & iter, Values::const_iterator & end) const +bool plKeysAndValues::GetValueIterators(const plString & key, Values::const_iterator & iter, Values::const_iterator & end) const { Keys::const_iterator ki = fKeys.find(key); if(ki != fKeys.end()) @@ -235,19 +209,19 @@ void plKeysAndValues::Read(hsStream * s) { uint16_t strlen; s->ReadLE(&strlen); - std::string key; - key.assign(strlen+1,'\0'); - s->Read(strlen,(void*)key.data()); - key.resize(strlen); + plStringBuffer key; + char* kdata = key.CreateWritableBuffer(strlen); + s->Read(strlen,(void*)kdata); + kdata[strlen] = 0; uint16_t nvalues; s->ReadLE(&nvalues); for (int vi=0; viReadLE(&strlen); - std::string value; - value.assign(strlen+1,'\0'); - s->Read(strlen,(void*)value.data()); - value.resize(strlen); + plStringBuffer value; + char* vdata = value.CreateWritableBuffer(strlen); + s->Read(strlen,(void*)vdata); + vdata[strlen] = 0; // for now, only single value for key on stream is allowed. SetValue(key,value); } @@ -264,8 +238,8 @@ void plKeysAndValues::Write(hsStream * s) for (;ki!=ke;++ki) { // write key string - s->WriteLE((uint16_t)ki->first.size()); - s->Write(ki->first.size(),ki->first.c_str()); + s->WriteLE((uint16_t)ki->first.GetSize()); + s->Write(ki->first.GetSize(),ki->first.c_str()); // write nvalues for this key s->WriteLE((uint16_t)ki->second.size()); // iterate through values for this key @@ -274,8 +248,8 @@ void plKeysAndValues::Write(hsStream * s) for (;vi!=ve;++vi) { // write value string - s->WriteLE((uint16_t)vi->size()); - s->Write(vi->size(),vi->c_str()); + s->WriteLE((uint16_t)vi->GetSize()); + s->Write(vi->GetSize(),vi->c_str()); } } } diff --git a/Sources/Plasma/PubUtilLib/plContainer/plKeysAndValues.h b/Sources/Plasma/PubUtilLib/plContainer/plKeysAndValues.h index c35546f2..c951df5b 100644 --- a/Sources/Plasma/PubUtilLib/plContainer/plKeysAndValues.h +++ b/Sources/Plasma/PubUtilLib/plContainer/plKeysAndValues.h @@ -43,8 +43,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plKeysAndValues_h_inc #include "HeadSpin.h" +#include +#include -#include "hsStlUtils.h" #include "hsStream.h" #pragma warning(disable:4284) @@ -62,9 +63,9 @@ enum KAddValueMode class plKeysAndValues : public hsStreamable { public: - typedef std::list + typedef std::list Values; - typedef std::map + typedef std::map Keys; private: @@ -79,31 +80,31 @@ public: plKeysAndValues & operator =(const plKeysAndValues & src); // clear void Clear(); - void RemoveKey(const std::string & key); + void RemoveKey(const plString & key); // query - bool HasKey(const std::string & key) const; - bool KeyHasValue(const std::string & key, const std::string & value); - bool KeyHasValue(const std::string & key, int value); - bool KeyHasValue(const std::string & key, double value); + bool HasKey(const plString & key) const; + bool KeyHasValue(const plString & key, const plString & value); + bool KeyHasValue(const plString & key, int value); + bool KeyHasValue(const plString & key, double value); // add - bool AddValue(const std::string & key, const std::string & value, KAddValueMode mode=kAlwaysAdd); - bool AddValue(const std::string & key, int value, KAddValueMode mode=kAlwaysAdd); - bool AddValue(const std::string & key, double value, KAddValueMode mode=kAlwaysAdd); - bool AddValues(const std::string & key, const std::vector & values, KAddValueMode mode=kAlwaysAdd); + bool AddValue(const plString & key, const plString & value, KAddValueMode mode=kAlwaysAdd); + bool AddValue(const plString & key, int value, KAddValueMode mode=kAlwaysAdd); + bool AddValue(const plString & key, double value, KAddValueMode mode=kAlwaysAdd); + bool AddValues(const plString & key, const std::vector & values, KAddValueMode mode=kAlwaysAdd); // set (clear and add) - bool SetValue(const std::string & key, const std::string & value); - bool SetValue(const std::string & key, int value); - bool SetValue(const std::string & key, double value); + bool SetValue(const plString & key, const plString & value); + bool SetValue(const plString & key, int value); + bool SetValue(const plString & key, double value); // get single value - std::string GetValue(const std::string & key, const std::string & defval="", bool * outFound=nil) const; - uint32_t GetValue(const std::string & key, uint32_t defval, bool * outFound=nil) const; - int GetValue(const std::string & key, int defval, bool * outFound=nil) const; - double GetValue(const std::string & key, double defval, bool * outFound=nil) const; - std::vector GetAllValues(const std::string & key); + plString GetValue(const plString & key, const plString & defval="", bool * outFound=nil) const; + uint32_t GetValue(const plString & key, uint32_t defval, bool * outFound=nil) const; + int GetValue(const plString & key, int defval, bool * outFound=nil) const; + double GetValue(const plString & key, double defval, bool * outFound=nil) const; + std::vector GetAllValues(const plString & key); // key iterator bool GetKeyIterators(Keys::const_iterator & iter, Keys::const_iterator & end) const; // value iterator (use for getting all values for key) - bool GetValueIterators(const xtl::istring & key, Values::const_iterator & iter, Values::const_iterator & end) const; + bool GetValueIterators(const plString & key, Values::const_iterator & iter, Values::const_iterator & end) const; // streamable void Read(hsStream * s); void Write(hsStream * s); diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.h b/Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.h index c23c9515..dc979b48 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.h +++ b/Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.h @@ -43,11 +43,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plDynaDecalMgr_inc #define plDynaDecalMgr_inc +#include #include "pnNetCommon/plSynchedObject.h" #include "hsTemplates.h" #include "hsGeometry3.h" #include "hsMatrix44.h" -#include "hsStlUtils.h" class plParticleSystem; diff --git a/Sources/Plasma/PubUtilLib/plFile/hsFiles_Unix.cpp b/Sources/Plasma/PubUtilLib/plFile/hsFiles_Unix.cpp index d95cfa84..5864f42a 100644 --- a/Sources/Plasma/PubUtilLib/plFile/hsFiles_Unix.cpp +++ b/Sources/Plasma/PubUtilLib/plFile/hsFiles_Unix.cpp @@ -50,9 +50,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include #include +#include #include "hsTemplates.h" #include "plFileUtils.h" -#include "hsStlUtils.h" struct hsFolderIterator_Data { glob_t fGlobBuf; diff --git a/Sources/Plasma/PubUtilLib/plFile/plEncryptedStream.cpp b/Sources/Plasma/PubUtilLib/plFile/plEncryptedStream.cpp index 0ea7c9da..60367d58 100644 --- a/Sources/Plasma/PubUtilLib/plFile/plEncryptedStream.cpp +++ b/Sources/Plasma/PubUtilLib/plFile/plEncryptedStream.cpp @@ -45,6 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsSTLStream.h" #include +#include static const uint32_t kDefaultKey[4] = { 0x6c0a5452, 0x3827d0f, 0x3a170b92, 0x16db7fc2 }; static const int kEncryptChunkSize = 8; diff --git a/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp b/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp index d582f345..81a176d6 100644 --- a/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp +++ b/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp @@ -52,7 +52,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" #include "hsWindows.h" -#include "hsStlUtils.h" #include "plFileUtils.h" #include "hsFiles.h" #include "hsStringTokenizer.h" diff --git a/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp b/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp index eef375fd..2b138543 100644 --- a/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp +++ b/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp @@ -39,6 +39,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ +#include + #include "plSecureStream.h" #include "hsWindows.h" diff --git a/Sources/Plasma/PubUtilLib/plFile/plStreamSource.cpp b/Sources/Plasma/PubUtilLib/plFile/plStreamSource.cpp index 8c57804c..d7b18dfd 100644 --- a/Sources/Plasma/PubUtilLib/plFile/plStreamSource.cpp +++ b/Sources/Plasma/PubUtilLib/plFile/plStreamSource.cpp @@ -40,6 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ +#include #include "hsFiles.h" #include "plStreamSource.h" #include "plSecureStream.h" diff --git a/Sources/Plasma/PubUtilLib/plFile/plStreamSource.h b/Sources/Plasma/PubUtilLib/plFile/plStreamSource.h index fb11bb08..817e2901 100644 --- a/Sources/Plasma/PubUtilLib/plFile/plStreamSource.h +++ b/Sources/Plasma/PubUtilLib/plFile/plStreamSource.h @@ -42,8 +42,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plStreamSource_h_inc #define plStreamSource_h_inc +#include +#include #include "hsStream.h" -#include "hsStlUtils.h" // A class for holding and accessing file streams. The preloader will insert // files in here once they are loaded. In internal builds, if a requested file diff --git a/Sources/Plasma/PubUtilLib/plGImage/plFont.cpp b/Sources/Plasma/PubUtilLib/plGImage/plFont.cpp index be1e74ba..155f2ec0 100644 --- a/Sources/Plasma/PubUtilLib/plGImage/plFont.cpp +++ b/Sources/Plasma/PubUtilLib/plGImage/plFont.cpp @@ -63,7 +63,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com /////////////////////////////////////////////////////////////////////////////// #include "HeadSpin.h" -#include "hsStlUtils.h" +#include + #include "plFont.h" #include "plMipmap.h" diff --git a/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp b/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp index 586c8301..cb4787f6 100644 --- a/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp +++ b/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp @@ -835,17 +835,16 @@ void plSceneInputInterface::ILinkOffereeToAge() // We must have an owned copy of the age before we can offer it, so make one now plUUID guid(GuidGenerate()); info.SetAgeInstanceGuid(&guid); - std::string title; - std::string desc; + plString title, desc; unsigned nameLen = plNetClientMgr::GetInstance()->GetPlayerName().GetSize(); if (plNetClientMgr::GetInstance()->GetPlayerName().CharAt(nameLen - 1) == 's' || plNetClientMgr::GetInstance()->GetPlayerName().CharAt(nameLen - 1) == 'S') { - xtl::format( title, "%s'", plNetClientMgr::GetInstance()->GetPlayerName().c_str() ); - xtl::format( desc, "%s' %s", plNetClientMgr::GetInstance()->GetPlayerName().c_str(), link.GetAgeInfo()->GetAgeInstanceName() ); + title = plString::Format( "%s'", plNetClientMgr::GetInstance()->GetPlayerName().c_str() ); + desc = plString::Format( "%s' %s", plNetClientMgr::GetInstance()->GetPlayerName().c_str(), link.GetAgeInfo()->GetAgeInstanceName() ); } else { - xtl::format( title, "%s's", plNetClientMgr::GetInstance()->GetPlayerName().c_str() ); - xtl::format( desc, "%s's %s", plNetClientMgr::GetInstance()->GetPlayerName().c_str(), link.GetAgeInfo()->GetAgeInstanceName() ); + title = plString::Format( "%s's", plNetClientMgr::GetInstance()->GetPlayerName().c_str() ); + desc = plString::Format( "%s's %s", plNetClientMgr::GetInstance()->GetPlayerName().c_str(), link.GetAgeInfo()->GetAgeInstanceName() ); } info.SetAgeUserDefinedName( title.c_str() ); diff --git a/Sources/Plasma/PubUtilLib/plInterp/plATCEaseCurves.cpp b/Sources/Plasma/PubUtilLib/plInterp/plATCEaseCurves.cpp index 0f26b4da..9d01c783 100644 --- a/Sources/Plasma/PubUtilLib/plInterp/plATCEaseCurves.cpp +++ b/Sources/Plasma/PubUtilLib/plInterp/plATCEaseCurves.cpp @@ -39,6 +39,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ +#include + #include "plAnimEaseTypes.h" #include "plAnimTimeConvert.h" diff --git a/Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.cpp b/Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.cpp index b5ca6f50..b0865cfe 100644 --- a/Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.cpp +++ b/Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.cpp @@ -40,6 +40,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "HeadSpin.h" +#include + #include "plAnimEaseTypes.h" #include "plAnimTimeConvert.h" #include "plAvatar/plAGAnim.h" diff --git a/Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.h b/Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.h index 57752d2f..7e192fe0 100644 --- a/Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.h +++ b/Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.h @@ -42,6 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plAnimTimeConvert_inc #define plAnimTimeConvert_inc +#include #include "pnFactory/plCreatable.h" #include "hsTemplates.h" #include "pnNetCommon/plSynchedValue.h" diff --git a/Sources/Plasma/PubUtilLib/plMath/plAvg.h b/Sources/Plasma/PubUtilLib/plMath/plAvg.h index 69494c50..80721d3d 100644 --- a/Sources/Plasma/PubUtilLib/plMath/plAvg.h +++ b/Sources/Plasma/PubUtilLib/plMath/plAvg.h @@ -43,8 +43,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define PL_AVG_H #include "HeadSpin.h" +#include + #include "hsThread.h" -#include "hsStlUtils.h" // A Time based Value Averaging class diff --git a/Sources/Plasma/PubUtilLib/plMessage/plLinkToAgeMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plLinkToAgeMsg.h index e5c0128d..079e30fe 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plLinkToAgeMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plLinkToAgeMsg.h @@ -64,7 +64,7 @@ class plLinkToAgeMsg : public plMessage public: plLinkToAgeMsg(); plLinkToAgeMsg( const plAgeLinkStruct * link ); - ~plLinkToAgeMsg(); + virtual ~plLinkToAgeMsg(); CLASSNAME_REGISTER( plLinkToAgeMsg ); GETINTERFACE_ANY( plLinkToAgeMsg, plMessage ); diff --git a/Sources/Plasma/PubUtilLib/plMessage/plNetOwnershipMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plNetOwnershipMsg.h index b91d720b..2f55cef0 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plNetOwnershipMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plNetOwnershipMsg.h @@ -42,7 +42,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plNetOwnershipMsg_INC #define plNetOwnershipMsg_INC -#include "hsStlUtils.h" #include "pnMessage/plMessage.h" #include "plNetMessage/plNetMessage.h" diff --git a/Sources/Plasma/PubUtilLib/plMessage/plOneShotCallbacks.h b/Sources/Plasma/PubUtilLib/plMessage/plOneShotCallbacks.h index ec46c548..ee086776 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plOneShotCallbacks.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plOneShotCallbacks.h @@ -40,7 +40,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "HeadSpin.h" -#include "hsStlUtils.h" #include "hsRefCnt.h" #include "pnKeyedObject/plKey.h" diff --git a/Sources/Plasma/PubUtilLib/plModifier/plAxisAnimModifier.h b/Sources/Plasma/PubUtilLib/plModifier/plAxisAnimModifier.h index 0e5ad23b..f0acf9b4 100644 --- a/Sources/Plasma/PubUtilLib/plModifier/plAxisAnimModifier.h +++ b/Sources/Plasma/PubUtilLib/plModifier/plAxisAnimModifier.h @@ -43,7 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plAxisAnimMod_inc #define plAxisAnimMod_inc -#include "hsStlUtils.h" #include "pnModifier/plSingleModifier.h" #include "plString.h" diff --git a/Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.cpp b/Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.cpp index 7def6966..5e71bba2 100644 --- a/Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.cpp +++ b/Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.cpp @@ -40,7 +40,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "HeadSpin.h" -#include "hsStlUtils.h" #include "hsTimer.h" #include "plResponderModifier.h" #include "plResponderSDLModifier.h" diff --git a/Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.h b/Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.h index 38ee3d04..5734ea85 100644 --- a/Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.h +++ b/Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.h @@ -42,7 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plResponderModifier_inc #define plResponderModifier_inc -#include "hsStlUtils.h" +#include #include "pnModifier/plSingleModifier.h" #include "pnMessage/plMessage.h" diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientGroup.h b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientGroup.h index 324d172b..b5703568 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientGroup.h +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientGroup.h @@ -42,7 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plNetClientGroup_h #define plNetClientGroup_h -#include "hsStlUtils.h" +#include #include "pnNetCommon/plNetGroup.h" // diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp index 5eacc796..4d0d66b1 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp @@ -210,7 +210,9 @@ void plNetClientMgr::Shutdown() // void plNetClientMgr::IClearPendingLoads() { - std::for_each( fPendingLoads.begin(), fPendingLoads.end(), xtl::delete_ptr() ); + std::for_each( fPendingLoads.begin(), fPendingLoads.end(), + [](PendingLoad *pl) { delete pl; } + ); fPendingLoads.clear(); } @@ -250,10 +252,10 @@ void plNetClientMgr::SetNullSend(bool on) // // returns server time in the form "[m/d/y h:m:s]" // -const char* plNetClientMgr::GetServerLogTimeAsString(std::string& timestamp) const +const char* plNetClientMgr::GetServerLogTimeAsString(plString& timestamp) const { const plUnifiedTime st=GetServerTime(); - xtl::format(timestamp, "{%02d/%02d %02d:%02d:%02d}", + timestamp = plString::Format("{%02d/%02d %02d:%02d:%02d}", st.GetMonth(), st.GetDay(), st.GetHour(), st.GetMinute(), st.GetSecond()); return timestamp.c_str(); } @@ -263,10 +265,10 @@ const char* plNetClientMgr::GetServerLogTimeAsString(std::string& timestamp) con // const char* ProcessTab(const char* fmt) { - static std::string s; + static plString s; if (fmt && *fmt=='\t') { - s = xtl::format(" %s", fmt); + s = plString::Format(" %s", fmt); return s.c_str(); } return fmt; @@ -281,7 +283,7 @@ bool plNetClientMgr::Log(const char* str) const return true; // prepend raw time - std::string buf2 = xtl::format("%.2f %s", hsTimer::GetSeconds(), ProcessTab(str)); + plString buf2 = plString::Format("%.2f %s", hsTimer::GetSeconds(), ProcessTab(str)); if ( GetConsoleOutput() ) hsStatusMessage(buf2.c_str()); @@ -1557,7 +1559,9 @@ void plNetClientMgr::SendPendingPagingRoomMsgs() void plNetClientMgr::ClearPendingPagingRoomMsgs() { - std::for_each( fPendingPagingRoomMsgs.begin(), fPendingPagingRoomMsgs.end(), xtl::delete_ptr() ); + std::for_each( fPendingPagingRoomMsgs.begin(), fPendingPagingRoomMsgs.end(), + [](plNetMsgPagingRoom *pr) { delete pr; } + ); fPendingPagingRoomMsgs.clear(); } diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.h b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.h index 8453cd7d..0a32d7d1 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.h +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.h @@ -43,7 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define PL_NET_CLIENT_inc #include "HeadSpin.h" -#include "hsStlUtils.h" +#include #include "plNetClientGroup.h" #include "plNetVoiceList.h" @@ -348,7 +348,7 @@ public: // time converters plUnifiedTime GetServerTime() const; - const char* GetServerLogTimeAsString(std::string& ts) const; + const char* GetServerLogTimeAsString(plString& ts) const; double GetCurrentAgeElapsedSeconds() const; float GetCurrentAgeTimeOfDayPercent() const; diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp index 30813010..c578688a 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp @@ -159,7 +159,7 @@ void plNetClientMgr::ISendCCRPetition(plCCRPetitionMsg* petMsg) char buffy[20]; sprintf( buffy, "%lu", GetPlayerID() ); info.AddValue( "Petition", "PlayerID", buffy ); - info.AddValue( "Petition", "PlayerName", GetPlayerName().c_str() ); + info.AddValue( "Petition", "PlayerName", GetPlayerName() ); // write config info formatted like an ini file to a buffer hsRAMStream ram; @@ -437,7 +437,7 @@ int plNetClientMgr::SendMsg(plNetMessage* msg) if (plNetMsgGameMessage::ConvertNoRef(msg)) SetFlagsBit(kSendingActions); - plCheckNetMgrResult_ValReturn(ret,(char*)xtl::format("Failed to send %s, NC ret=%d", + plCheckNetMgrResult_ValReturn(ret, plString::Format("Failed to send %s, NC ret=%d", msg->ClassName(), ret).c_str()); return ret; diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrShow.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrShow.cpp index 8c4bd094..42279dfa 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrShow.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrShow.cpp @@ -39,6 +39,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ +#include + #include "plNetClientMgr.h" #include "plNetLinkingMgr.h" diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.cpp index a028ff83..c15f9e6a 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.cpp @@ -250,15 +250,15 @@ MSG_HANDLER_DEFN(plNetClientMsgHandler,plNetMsgSDLState) plStateDataRecord* sdRec = des ? new plStateDataRecord(des) : nil; if (!sdRec || sdRec->GetDescriptor()->GetVersion()!=ver) { - std::string err; + plString err; if (!sdRec) - err = xtl::format( "SDL descriptor %s missing, v=%d", descName, ver); + err = plString::Format( "SDL descriptor %s missing, v=%d", descName.c_str(), ver); else - err = xtl::format( "SDL descriptor %s, version mismatch, server v=%d, client v=%d", - descName, ver, sdRec->GetDescriptor()->GetVersion()); + err = plString::Format( "SDL descriptor %s, version mismatch, server v=%d, client v=%d", + descName.c_str(), ver, sdRec->GetDescriptor()->GetVersion()); hsAssert(false, err.c_str()); - nc->ErrorMsg(const_cast(err.c_str())); + nc->ErrorMsg(err.c_str()); // Post Quit message nc->QueueDisableNet(true, "SDL Desc Problem"); diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.h b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.h index efe8cbff..cbac09c3 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.h +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.h @@ -43,7 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plNetClientMsgHandler_inc #include "plNetCommon/plNetMsgHandler.h" -#include "hsStlUtils.h" /////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp index 8ee10b3a..cfaa2077 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp @@ -301,7 +301,7 @@ void plNetLinkingMgr::SetEnabled( bool b ) std::string plNetLinkingMgr::GetProperAgeName( const char * ageName ) { plNetClientMgr * nc = plNetClientMgr::GetInstance(); - hsFolderIterator it("dat"PATH_SEPARATOR_STR"*.age", true); + hsFolderIterator it("dat" PATH_SEPARATOR_STR "*.age", true); while ( it.NextFile() ) { std::string work = it.GetFileName(); diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.h b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.h index 161f57cc..8cf62260 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.h +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.h @@ -43,7 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plNetLinkingMgr_h_inc #include "HeadSpin.h" -#include "hsStlUtils.h" #include "hsBitVector.h" #include "plNetCommon/plNetServerSessionInfo.h" #include "plNetCommon/plNetCommon.h" diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetObjectDebugger.h b/Sources/Plasma/PubUtilLib/plNetClient/plNetObjectDebugger.h index 88b39bd9..622806ab 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetObjectDebugger.h +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetObjectDebugger.h @@ -43,7 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plNetObjectDebugger_inc #include "HeadSpin.h" -#include "hsStlUtils.h" #include "pnKeyedObject/plUoid.h" #include "pnNetCommon/plNetApp.h" diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetVoiceList.h b/Sources/Plasma/PubUtilLib/plNetClient/plNetVoiceList.h index 35083a36..1ae1739b 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetVoiceList.h +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetVoiceList.h @@ -43,7 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plNetVoiceList_h #include "HeadSpin.h" -#include "hsStlUtils.h" // // a simple class used by the net client code to hold listenLists and talkLists diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plClientGuid.h b/Sources/Plasma/PubUtilLib/plNetCommon/plClientGuid.h index 0583cda7..3c2818af 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plClientGuid.h +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plClientGuid.h @@ -43,7 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plClientGuid_h_inc #include "HeadSpin.h" -#include "hsStlUtils.h" #include "pnFactory/plCreatable.h" #include "pnUUID/pnUUID.h" diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommon.cpp b/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommon.cpp index aebec2f9..01f3aaaa 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommon.cpp +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommon.cpp @@ -40,7 +40,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "plNetCommon.h" -#include "hsStlUtils.h" #include "pnUUID/pnUUID.h" #include diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommon.h b/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommon.h index b32ac2f1..aac0258f 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommon.h +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommon.h @@ -45,7 +45,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef PLNETCOMMON_CONSTANTS_ONLY #include "plNetServerSessionInfo.h" -#include "hsStlUtils.h" #endif // PLNETCOMMON_CONSTANTS_ONLY diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommonHelpers.cpp b/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommonHelpers.cpp index 9d31cdda..e59d2ccc 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommonHelpers.cpp +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommonHelpers.cpp @@ -42,7 +42,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" #include "hsStream.h" -#include "hsStlUtils.h" #include "plNetCommonHelpers.h" #include "pnNetCommon/plGenericVar.h" #include "plCompression/plZlibCompress.h" @@ -102,7 +101,9 @@ plCreatableListHelper::plCreatableListHelper() void plCreatableListHelper::IClearItems() { - std::for_each( fManagedItems.begin(), fManagedItems.end(), xtl::delete_ptr() ); + std::for_each( fManagedItems.begin(), fManagedItems.end(), + [](plCreatable * cre) { delete cre; } + ); fManagedItems.clear(); fItems.clear(); } diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommonHelpers.h b/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommonHelpers.h index 55d0f866..86935e10 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommonHelpers.h +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommonHelpers.h @@ -43,7 +43,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plNetCommonHelpers_h_inc #include "HeadSpin.h" -#include "hsStlUtils.h" +#include + #include "hsTimer.h" #include "pnNetCommon/pnNetCommon.h" #include "pnNetCommon/plNetApp.h" diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plNetMember.h b/Sources/Plasma/PubUtilLib/plNetCommon/plNetMember.h index 6e0aafff..a393a366 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plNetMember.h +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plNetMember.h @@ -44,7 +44,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" -#include "hsStlUtils.h" #include "pnFactory/plCreatable.h" class plNetApp; diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp b/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp index 6a45338c..2827daf0 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp @@ -43,7 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsStream.h" #include "pnMessage/plMessage.h" #include "plNetServerSessionInfo.h" -#include "hsStlUtils.h" #include "plNetCommon.h" #include "plVault/plVault.h" @@ -354,16 +353,6 @@ void plAgeInfoStruct::Clear() fAgeLanguage = -1; } -const char * plAgeInfoStruct::GetDisplayName() const -{ - int seq = GetAgeSequenceNumber(); - if ( seq>0 ) - xtl::format( fDisplayName, "%s(%d) %s", GetAgeUserDefinedName(), seq, GetAgeInstanceName() ); - else - xtl::format( fDisplayName, "%s %s", GetAgeUserDefinedName(), GetAgeInstanceName() ); - return fDisplayName.c_str(); -} - //////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.h b/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.h index 46221858..43a68608 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.h +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.h @@ -43,7 +43,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plNetServerSessionInfo_h_inc #include "HeadSpin.h" -#include "hsStlUtils.h" +#include + #include "pnFactory/plCreatable.h" #include "pnNetCommon/plNetServers.h" #include "plNetCommon/plSpawnPointInfo.h" @@ -84,8 +85,6 @@ class plAgeInfoStruct : public plCreatable // The language of the client that created this age int32_t fAgeLanguage; - mutable std::string fDisplayName; - enum { kHasAgeFilename = 1<<0, @@ -145,8 +144,6 @@ public: void Read( hsStream * s, hsResMgr* ); void Write( hsStream * s, hsResMgr* ); - const char * GetDisplayName() const; - plString AsString() const; }; @@ -303,48 +300,4 @@ public: virtual void WriteVersion(hsStream* s, hsResMgr* mgr); }; -//////////////////////////////////////////////////////////////////// - -//class plVaultAgeInfoNode; -//class plAgeLinkingInfo : public plCreatable -//{ -// int fLinkingRules; -// uint32_t fPlayerID; -// bool8 fSuperUser; -// mutable plAgeInfoStruct fAgeInfo; -// mutable plNetServerSessionInfo fServerInfo; -// -//public: -// plAgeLinkingInfo(); -// -// CLASSNAME_REGISTER( plAgeLinkingInfo ); -// GETINTERFACE_ANY( plAgeLinkingInfo, plCreatable ); -// -// int GetLinkingRules( void ) const { return fLinkingRules;} -// void SetLinkingRules( int v ) { fLinkingRules=v;} -// uint32_t GetPlayerID( void ) const { return fPlayerID;} -// void SetPlayerID( uint32_t v ) { fPlayerID=v;} -// void SetSuperUser(bool b) { fSuperUser=b; } -// bool GetSuperUser() const { return fSuperUser ? true : false; } -// -// plAgeInfoStruct * GetAgeInfo(); -// const plAgeInfoStruct * GetAgeInfo() const; -// -// // initializes info with age name and guid for you. -// plNetServerSessionInfo * GetServerInfo(); -// const plNetServerSessionInfo * GetServerInfo() const; -// const plNetServerSessionInfo * AsServerInfo() const; -// -// void Clear( void ); -// void CopyFrom( const plAgeLinkingInfo * other ); -// void CopyFrom( const plVaultAgeInfoNode * node ); -// void CopyFrom( const plNetServerSessionInfo * info ); -// void CopyFrom( const plAgeInfoStruct * info ); -// -// void Read(hsStream* s, hsResMgr* mgr=nil); -// void Write(hsStream* s, hsResMgr* mgr=nil); -// -// std::string AsStdString() const; -//}; - #endif // plNetServerSessionInfo_h_inc diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plSpawnPointInfo.h b/Sources/Plasma/PubUtilLib/plNetCommon/plSpawnPointInfo.h index 46f92d08..100fe397 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plSpawnPointInfo.h +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plSpawnPointInfo.h @@ -42,7 +42,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plSpawnPointInfo_h_inc #define plSpawnPointInfo_h_inc -#include "hsStlUtils.h" #include "plString.h" /////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.cpp b/Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.cpp index 636a1c02..bcf26c87 100644 --- a/Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.cpp +++ b/Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.cpp @@ -226,7 +226,7 @@ int plNetMessage::PeekBuffer(const char* bufIn, int bufLen, uint32_t peekOptions readStream.LogSetList(el); readStream.Init(bufLen, bufIn); readStream.LogSubStreamStart("plNetMessage"); - readStream.LogStringString(xtl::format("ClassName: %s",this->ClassName()).c_str()); + readStream.LogStringString(plString::Format("ClassName: %s", this->ClassName()).c_str()); int ret; if (peekOptions & kBaseClassOnly) { diff --git a/Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.h b/Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.h index c0177835..987eb9a5 100644 --- a/Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.h +++ b/Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.h @@ -44,7 +44,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" -#include "hsStlUtils.h" #include "hsStream.h" #include "hsBitVector.h" #include "hsTemplates.h" @@ -646,13 +645,11 @@ public: bool GetRequestingState() const { return (fPageFlags & kRequestState) != 0; } // debug - std::string AsStdString() const + plString AsString() const { - std::string s; - xtl::format(s,"pageFlags:%02X, paging %s, requestingState:%s, resetting=%d",fPageFlags, - (fPageFlags&kPagingOut)?"out":"in", (fPageFlags&kRequestState)?"yes":"no", - (fPageFlags & kResetList)!=0); - return s; + return plString::Format("pageFlags:%02X, paging %s, requestingState:%s, resetting=%d", + fPageFlags, (fPageFlags&kPagingOut)?"out":"in", + (fPageFlags&kRequestState)?"yes":"no", (fPageFlags & kResetList)!=0); } }; @@ -755,11 +752,9 @@ public: void WriteVersion(hsStream* s, hsResMgr* mgr); // debug - std::string AsStdString() const + plString AsString() const { - std::string s; - xtl::format(s,"len=%d",fVoiceData.size()); - return s; + return plString::Format("len=%d",fVoiceData.size()); } }; @@ -795,7 +790,7 @@ public: void WriteVersion(hsStream* s, hsResMgr* mgr); // debug - plString AsStdString() const + plString AsString() const { return plString::Format("lockReq=%d, %s",fLockRequest, plNetMsgStreamedObject::AsString().c_str()); } @@ -979,7 +974,7 @@ public: const hsBitVector& GetRegionsICareAbout() const { return fRegionsICareAbout; } const hsBitVector& GetRegionsImIn() const { return fRegionsImIn; } - plString AsStdString() const + plString AsString() const { plString b1, b2; int i; diff --git a/Sources/Plasma/PubUtilLib/plNetMessage/plNetMsgHelpers.h b/Sources/Plasma/PubUtilLib/plNetMessage/plNetMsgHelpers.h index 5bb77581..691f77f6 100644 --- a/Sources/Plasma/PubUtilLib/plNetMessage/plNetMsgHelpers.h +++ b/Sources/Plasma/PubUtilLib/plNetMessage/plNetMsgHelpers.h @@ -50,7 +50,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" #include "hsStream.h" -#include "hsStlUtils.h" #include "pnNetCommon/pnNetCommon.h" #include "pnFactory/plCreatable.h" #include "pnKeyedObject/plUoid.h" diff --git a/Sources/Plasma/PubUtilLib/plNetTransport/plNetTransport.h b/Sources/Plasma/PubUtilLib/plNetTransport/plNetTransport.h index aa719320..ec863a85 100644 --- a/Sources/Plasma/PubUtilLib/plNetTransport/plNetTransport.h +++ b/Sources/Plasma/PubUtilLib/plNetTransport/plNetTransport.h @@ -43,7 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plNetTransport_h #include "HeadSpin.h" -#include "hsStlUtils.h" +#include // // The transport class handles the details of sending net msgs to diff --git a/Sources/Plasma/PubUtilLib/plNetTransport/plNetTransportMember.h b/Sources/Plasma/PubUtilLib/plNetTransport/plNetTransportMember.h index 294292b6..77671355 100644 --- a/Sources/Plasma/PubUtilLib/plNetTransport/plNetTransportMember.h +++ b/Sources/Plasma/PubUtilLib/plNetTransport/plNetTransportMember.h @@ -43,7 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plNetTransportMember_h #include "HeadSpin.h" -#include "hsStlUtils.h" #include "plNetCommon/plNetMember.h" #include "pnKeyedObject/plKey.h" #include "plString.h" diff --git a/Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.h b/Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.h index d8a38b50..170ed011 100644 --- a/Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.h +++ b/Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.h @@ -42,7 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plSimulationMgr_H #define plSimulationMgr_H -#include "hsStlUtils.h" +#include #include "pnKeyedObject/hsKeyedObject.h" #include "hsTemplates.h" diff --git a/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp b/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp index ca14aa0b..147c7790 100644 --- a/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp +++ b/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp @@ -41,6 +41,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "HeadSpin.h" +#include + #include "plCollisionDetector.h" #include "plMessage/plCollideMsg.h" #include "plgDispatch.h" diff --git a/Sources/Plasma/PubUtilLib/plPhysical/plPhysicsSoundMgr.h b/Sources/Plasma/PubUtilLib/plPhysical/plPhysicsSoundMgr.h index 7ee2c8b7..49d48f10 100644 --- a/Sources/Plasma/PubUtilLib/plPhysical/plPhysicsSoundMgr.h +++ b/Sources/Plasma/PubUtilLib/plPhysical/plPhysicsSoundMgr.h @@ -42,7 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plPhysicsSoundMgr_h_inc #define plPhysicsSoundMgr_h_inc -#include "hsStlUtils.h" +#include #include "plPhysical.h" #include "hsGeometry3.h" diff --git a/Sources/Plasma/PubUtilLib/plPipeline/plPlates.h b/Sources/Plasma/PubUtilLib/plPipeline/plPlates.h index 6d92eaaa..8513f0e7 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/plPlates.h +++ b/Sources/Plasma/PubUtilLib/plPipeline/plPlates.h @@ -49,7 +49,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define _plPlates_h #include "HeadSpin.h" -#include "hsStlUtils.h" +#include + #include "hsColorRGBA.h" #include "hsTemplates.h" diff --git a/Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.cpp b/Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.cpp index c8cea5da..1204b3fe 100644 --- a/Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.cpp +++ b/Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.cpp @@ -42,7 +42,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plKeyFinder.h" #include "hsTemplates.h" -#include "hsStlUtils.h" #include "hsResMgr.h" #include "plResManager.h" diff --git a/Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.h b/Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.h index ca86b50b..5fe471d2 100644 --- a/Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.h +++ b/Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.h @@ -66,7 +66,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" #include "pnKeyedObject/plKey.h" #include "pnKeyedObject/plUoid.h" -#include "hsStlUtils.h" #include class plLocation; diff --git a/Sources/Plasma/PubUtilLib/plResMgr/plLocalization.h b/Sources/Plasma/PubUtilLib/plResMgr/plLocalization.h index d3b4cde1..a73011c5 100644 --- a/Sources/Plasma/PubUtilLib/plResMgr/plLocalization.h +++ b/Sources/Plasma/PubUtilLib/plResMgr/plLocalization.h @@ -42,7 +42,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plLocalization_h_inc #define plLocalization_h_inc -#include "hsStlUtils.h" +#include +#include class plLocalization { diff --git a/Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.cpp b/Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.cpp index 31f70703..21136278 100644 --- a/Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.cpp +++ b/Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.cpp @@ -47,7 +47,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plStatusLog/plStatusLog.h" #include "pnFactory/plFactory.h" #include "plFile/plFileUtils.h" -#include "hsStlUtils.h" #include "plVersion.h" @@ -168,7 +167,7 @@ void plRegistryPageNode::LoadKeys() hsStream* stream = OpenStream(); if (!stream) { - hsAssert(0, xtl::format("plRegistryPageNode::LoadKeysFromSource - bad stream %s,%s", + hsAssert(0, plString::Format("plRegistryPageNode::LoadKeysFromSource - bad stream %s,%s", GetPageInfo().GetAge(), GetPageInfo().GetPage()).c_str()); return; } diff --git a/Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp b/Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp index f1b0826d..ad7205fd 100644 --- a/Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp +++ b/Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp @@ -48,7 +48,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTimer.h" #include "pnTimer/plTimerCallbackManager.h" -#include "hsStlUtils.h" #include "plScene/plSceneNode.h" #include "pnKeyedObject/hsKeyedObject.h" @@ -1192,7 +1191,7 @@ void plResManager::PageInRoom(const plLocation& page, uint16_t objClassToRef, pl kResMgrLog(1, ILog(1, "...IGNORING pageIn request; verification failed! (%s)", condStr.c_str())); - std::string msg = xtl::format("Data Problem: Age:%s Page:%s Error:%s", + plString msg = plString::Format("Data Problem: Age:%s Page:%s Error:%s", pageNode->GetPageInfo().GetAge(), pageNode->GetPageInfo().GetPage(), condStr.c_str()); hsMessageBox(msg.c_str(), "Error", hsMessageBoxNormal, hsMessageBoxIconError); diff --git a/Sources/Plasma/PubUtilLib/plSDL/plSDL.h b/Sources/Plasma/PubUtilLib/plSDL/plSDL.h index c4de5a1a..207cb3f2 100644 --- a/Sources/Plasma/PubUtilLib/plSDL/plSDL.h +++ b/Sources/Plasma/PubUtilLib/plSDL/plSDL.h @@ -46,9 +46,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // Code for the State Description Language (SDL) // -#include "plSDLDescriptor.h" +#include -#include "hsStlUtils.h" +#include "plSDLDescriptor.h" #include "pnFactory/plCreatable.h" #include "pnKeyedObject/plKey.h" diff --git a/Sources/Plasma/PubUtilLib/plSDL/plSDLDescriptor.h b/Sources/Plasma/PubUtilLib/plSDL/plSDLDescriptor.h index 8cdc077c..12dff703 100644 --- a/Sources/Plasma/PubUtilLib/plSDL/plSDLDescriptor.h +++ b/Sources/Plasma/PubUtilLib/plSDL/plSDLDescriptor.h @@ -48,9 +48,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // #include "HeadSpin.h" - -#include "hsStlUtils.h" #include "plString.h" +#include // // Describes a variable in a state descriptor. diff --git a/Sources/Plasma/PubUtilLib/plSDL/plSDLMgr.cpp b/Sources/Plasma/PubUtilLib/plSDL/plSDLMgr.cpp index 4076baac..004c88c9 100644 --- a/Sources/Plasma/PubUtilLib/plSDL/plSDLMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plSDL/plSDLMgr.cpp @@ -40,7 +40,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "hsStream.h" -#include "hsStlUtils.h" #include "plSDL.h" #include "pnNetCommon/plNetApp.h" #include "pnNetCommon/pnNetCommon.h" @@ -83,7 +82,9 @@ void plSDLMgr::DeInit() // void plSDLMgr::IDeleteDescriptors(plSDL::DescriptorList* dl) { - std::for_each( dl->begin(), dl->end(), xtl::delete_ptr() ); + std::for_each( dl->begin(), dl->end(), + [](plStateDescriptor* sd) { delete sd; } + ); dl->clear(); } diff --git a/Sources/Plasma/PubUtilLib/plSDL/plSDLParser.cpp b/Sources/Plasma/PubUtilLib/plSDL/plSDLParser.cpp index bebd5b1d..a3ad5f61 100644 --- a/Sources/Plasma/PubUtilLib/plSDL/plSDLParser.cpp +++ b/Sources/Plasma/PubUtilLib/plSDL/plSDLParser.cpp @@ -40,7 +40,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "HeadSpin.h" -#include "hsStlUtils.h" #include "plSDL.h" #include "plFile/hsFiles.h" #include "plFile/plStreamSource.h" @@ -70,7 +69,7 @@ void plSDLParser::DebugMsgV(const char* fmt, va_list args) const { if (strlen(fmt)==nil) return; - hsStatusMessage(xtl::formatv(fmt,args).c_str()); + hsStatusMessage(plString::IFormat(fmt,args).c_str()); } // @@ -109,7 +108,7 @@ bool plSDLParser::IParseStateDesc(const char* fileName, hsStream* stream, char t if (!strcmp(token, "VERSION")) { // read desc version - hsAssert(curDesc, xtl::format("Syntax problem with .sdl file, fileName=%s", fileName).c_str()); + hsAssert(curDesc, plString::Format("Syntax problem with .sdl file, fileName=%s", fileName).c_str()); if (stream->GetToken(token, kTokenLen)) { int v=atoi(token); @@ -119,14 +118,14 @@ bool plSDLParser::IParseStateDesc(const char* fileName, hsStream* stream, char t } else { - hsAssert(false, xtl::format("Error parsing state desc, missing VERSION, fileName=%s", + hsAssert(false, plString::Format("Error parsing state desc, missing VERSION, fileName=%s", fileName).c_str()); ok = false; } } else { - hsAssert(false, xtl::format("Error parsing state desc, fileName=%s", fileName).c_str()); + hsAssert(false, plString::Format("Error parsing state desc, fileName=%s", fileName).c_str()); ok = false; } @@ -135,7 +134,8 @@ bool plSDLParser::IParseStateDesc(const char* fileName, hsStream* stream, char t ok = ( plSDLMgr::GetInstance()->FindDescriptor(curDesc->GetName(), curDesc->GetVersion())==nil ); if ( !ok ) { - std::string err = xtl::format( "Found duplicate SDL descriptor for %s version %d.\nFailed to parse file: %s", curDesc->GetName(), curDesc->GetVersion(), fileName ); + plString err = plString::Format( "Found duplicate SDL descriptor for %s version %d.\nFailed to parse file: %s", + curDesc->GetName().c_str(), curDesc->GetVersion(), fileName ); plNetApp::StaticErrorMsg( err.c_str() ); hsAssert( false, err.c_str() ); } diff --git a/Sources/Plasma/PubUtilLib/plSDL/plStateDataRecord.cpp b/Sources/Plasma/PubUtilLib/plSDL/plStateDataRecord.cpp index 7d12c4dd..894e77d9 100644 --- a/Sources/Plasma/PubUtilLib/plSDL/plStateDataRecord.cpp +++ b/Sources/Plasma/PubUtilLib/plSDL/plStateDataRecord.cpp @@ -43,7 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTimer.h" #include "hsTemplates.h" #include "hsStream.h" -#include "hsStlUtils.h" #include "plSDL.h" #include "plNetMessage/plNetMessage.h" @@ -121,7 +120,9 @@ void plStateDataRecord::SetDescriptor(const plString& name, int version) void plStateDataRecord::IDeleteVarsList(VarsList& vars) { - std::for_each( vars.begin(), vars.end(), xtl::delete_ptr() ); + std::for_each( vars.begin(), vars.end(), + [](plStateVariable* var) { delete var; } + ); vars.clear(); } diff --git a/Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp b/Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp index 7f499ae1..ddaa182e 100644 --- a/Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp +++ b/Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp @@ -42,7 +42,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include "hsStream.h" #include "hsTimer.h" -#include "hsStlUtils.h" #include "plSDL.h" #include "pnProduct/pnProduct.h" @@ -1186,7 +1185,7 @@ bool plSimpleStateVariable::ConvertTo(plSimpleVarDescriptor* toVar, bool force ) return true; hsLogEntry( plNetApp::StaticDebugMsg( "SSV(%p) converting %s from %s to %s", - this, fVar.GetName(), fVar.GetTypeString(), toVar->GetTypeString() ) ); + this, fVar.GetName().c_str(), fVar.GetTypeString().c_str(), toVar->GetTypeString().c_str() ) ); switch(fVar.GetType()) // original type { @@ -2683,8 +2682,8 @@ void plSDStateVariable::DumpToObjectDebugger(bool dirtyOnly, int level) const pad += " "; int cnt = dirtyOnly ? GetDirtyCount() : GetUsedCount(); - dbg->LogMsg(xtl::format( "%sSDVar, name:%s dirtyOnly:%d count:%d", - pad.c_str(), GetName(), dirtyOnly, cnt).c_str()); + dbg->LogMsg(plString::Format( "%sSDVar, name:%s dirtyOnly:%d count:%d", + pad.c_str(), GetName().c_str(), dirtyOnly, cnt).c_str()); for(i=0;iWriteString(xtl::format( "%sSDVar, name:%s dirtyOnly:%d count:%d", - pad.c_str(), GetName(), dirtyOnly, cnt).c_str()); + stream->WriteString(plString::Format( "%sSDVar, name:%s dirtyOnly:%d count:%d", + pad.c_str(), GetName().c_str(), dirtyOnly, cnt).c_str()); for(i=0;i group; for (int i = 0; i < fVars.size(); i++) - if (strcmp(fVars[i]->GetGroup(), groupName) == 0) + if (groupName.Compare(fVars[i]->GetGroup()) == 0) group.push_back(fVars[i]); int x = 10; - PrintGroup(group, groupName, x, y); + PrintGroup(group, groupName.c_str(), x, y); maxX = hsMaximum(maxX, x); y += 10; @@ -480,8 +480,8 @@ void plProfileManagerFull::ILogStats() for (it = groups.begin(); it != groups.end(); it++) { - const char* groupName = *it; - IPrintGroup(&s, groupName, true); + plString groupName = *it; + IPrintGroup(&s, groupName.c_str(), true); } s.WriteByte('\r'); s.WriteByte('\n'); @@ -492,8 +492,8 @@ void plProfileManagerFull::ILogStats() for (it = groups.begin(); it != groups.end(); it++) { - const char* groupName = *it; - IPrintGroup(&s, groupName); + plString groupName = *it; + IPrintGroup(&s, groupName.c_str()); } s.WriteByte('\r'); s.WriteByte('\n'); diff --git a/Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.h b/Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.h index fa10c997..167851eb 100644 --- a/Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.h +++ b/Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.h @@ -42,11 +42,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plProfileManagerFull_h_inc #define plProfileManagerFull_h_inc -#include "plProfileManager.h" - -#include "hsStlUtils.h" +#include +#include +#include "plString.h" -#include "hsStlSortUtils.h" +#include "plProfileManager.h" class plProfileManager; class plGraphPlate; @@ -57,7 +57,7 @@ class plProfileVar; class plProfileManagerFull { public: - typedef std::set GroupSet; + typedef std::set GroupSet; protected: plProfileManager::VarVec& fVars; @@ -128,4 +128,4 @@ public: }; -#endif // plProfileManagerFull_h_inc \ No newline at end of file +#endif // plProfileManagerFull_h_inc diff --git a/Sources/Plasma/PubUtilLib/plStatusLog/plLoggable.cpp b/Sources/Plasma/PubUtilLib/plStatusLog/plLoggable.cpp index 92944f90..6ae717d4 100644 --- a/Sources/Plasma/PubUtilLib/plStatusLog/plLoggable.cpp +++ b/Sources/Plasma/PubUtilLib/plStatusLog/plLoggable.cpp @@ -41,7 +41,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "plLoggable.h" #include "plStatusLog.h" -#include "hsStlUtils.h" #include "hsTemplates.h" diff --git a/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp b/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp index 5ce12594..2c1c7aa6 100644 --- a/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp +++ b/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp @@ -60,10 +60,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsThread.h" #include "hsTemplates.h" #include "hsTimer.h" -#include "hsStlUtils.h" #include "plFile/plFileUtils.h" #include "plStatusLog.h" -#include "hsStlUtils.h" #include "plFile/hsFiles.h" #include "plUnifiedTime/plUnifiedTime.h" #include "pnProduct/pnProduct.h" @@ -873,8 +871,7 @@ bool plStatusLog::IPrintLineToFile( const char *line, uint32_t count ) { #if HS_BUILD_FOR_WIN32 #ifndef PLASMA_EXTERNAL_RELEASE - std::string str; - xtl::format( str, "%.*s\n", count, line ); + plString str = plString::Format( "%.*s\n", count, line ); OutputDebugString( str.c_str() ); #endif #else diff --git a/Sources/Plasma/PubUtilLib/plStreamLogger/plStreamLogger.h b/Sources/Plasma/PubUtilLib/plStreamLogger/plStreamLogger.h index 73d9746e..01f5632c 100644 --- a/Sources/Plasma/PubUtilLib/plStreamLogger/plStreamLogger.h +++ b/Sources/Plasma/PubUtilLib/plStreamLogger/plStreamLogger.h @@ -42,8 +42,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef PL_STREAM_LOGGER #define PL_STREAM_LOGGER +#include +#include #include "hsStream.h" -#include "hsStlUtils.h" #include "pnNetCommon/plGenericVar.h" class plStreamLogger diff --git a/Sources/Plasma/PubUtilLib/plSurface/plLayerAnimation.cpp b/Sources/Plasma/PubUtilLib/plSurface/plLayerAnimation.cpp index 3af0080c..dff15914 100644 --- a/Sources/Plasma/PubUtilLib/plSurface/plLayerAnimation.cpp +++ b/Sources/Plasma/PubUtilLib/plSurface/plLayerAnimation.cpp @@ -41,6 +41,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "HeadSpin.h" +#include + #include "hsTimer.h" #include "plLayerAnimation.h" #include "pnKeyedObject/plKey.h" diff --git a/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp b/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp index 8bbd3d91..6910ba7e 100644 --- a/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp +++ b/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp @@ -42,7 +42,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include #include "plUnifiedTime.h" -#include "hsStlUtils.h" #include "hsWindows.h" @@ -310,8 +309,8 @@ const char* plUnifiedTime::Print() const // short year, month, day, hour, minute, second; // GetTime(year, month, day, hour, minute, second); // -// xtl::format(s,"yr %d mo %d day %d hour %d min %d sec %d", -// year, month, day, hour, minute, second); +// s = plString::Format("yr %d mo %d day %d hour %d min %d sec %d", +// year, month, day, hour, minute, second); s = Format("%c"); return s.c_str(); @@ -319,8 +318,8 @@ const char* plUnifiedTime::Print() const const char* plUnifiedTime::PrintWMillis() const { - static std::string s; - xtl::format(s,"%s,s:%lu,ms:%d", + static plString s; + s = plString::Format("%s,s:%lu,ms:%d", Print(), (unsigned long)GetSecs(), GetMillis() ); return s.c_str(); } diff --git a/Sources/Plasma/PubUtilLib/plVault/Pch.h b/Sources/Plasma/PubUtilLib/plVault/Pch.h index 9b751c76..47082c0f 100644 --- a/Sources/Plasma/PubUtilLib/plVault/Pch.h +++ b/Sources/Plasma/PubUtilLib/plVault/Pch.h @@ -63,7 +63,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #pragma warning(push, 0) #include #include -#include "hsStlUtils.h" #include "hsStringTokenizer.h" #include "hsGeometry3.h" #include "plSDL/plSDL.h" diff --git a/Sources/Plasma/PubUtilLib/plVault/plDniCoordinateInfo.cpp b/Sources/Plasma/PubUtilLib/plVault/plDniCoordinateInfo.cpp index 9ef49da2..d33910a1 100644 --- a/Sources/Plasma/PubUtilLib/plVault/plDniCoordinateInfo.cpp +++ b/Sources/Plasma/PubUtilLib/plVault/plDniCoordinateInfo.cpp @@ -91,11 +91,9 @@ void plDniCoordinateInfo::Write( hsStream* s, hsResMgr* mgr ) s->WriteLE( fTorans ); } -std::string plDniCoordinateInfo::AsStdString( int level ) const +plString plDniCoordinateInfo::AsString( int level ) const { - std::string result; - std::string space( level, ' ' ); - xtl::format( result, "%sDniCoords[%d,%d,%d]", space.c_str(), fHSpans, fVSpans, fTorans ); - return result; + plString space = plString::Fill( level, ' ' ); + return plString::Format( "%sDniCoords[%d,%d,%d]", space.c_str(), fHSpans, fVSpans, fTorans ); } #endif // def CLIENT diff --git a/Sources/Plasma/PubUtilLib/plVault/plDniCoordinateInfo.h b/Sources/Plasma/PubUtilLib/plVault/plDniCoordinateInfo.h index d67f7e32..4c265451 100644 --- a/Sources/Plasma/PubUtilLib/plVault/plDniCoordinateInfo.h +++ b/Sources/Plasma/PubUtilLib/plVault/plDniCoordinateInfo.h @@ -43,7 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plDniCoordinateInfo_h_inc #include "HeadSpin.h" -#include "hsStlUtils.h" #include "pnFactory/plCreatable.h" /////////////////////////////////////////////////////////////////// @@ -80,7 +79,7 @@ public: void Write( hsStream* s, hsResMgr* mgr ); // debug - std::string AsStdString( int level=0 ) const; + plString AsString( int level=0 ) const; }; diff --git a/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.h b/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.h index 4dd999ef..a2dd1386 100644 --- a/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.h +++ b/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.h @@ -50,12 +50,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #endif #define PLASMA20_SOURCES_PLASMA_PUBUTILLIB_PLVAULT_PLVAULTNODEACCESS_H -// 'Old' system is full of compiler warnings at /W4, so just hide them -#pragma warning(push, 0) -#include "hsStlUtils.h" -#pragma warning(pop) - - /***************************************************************************** * * VaultNode field access strutures diff --git a/Sources/Tools/MaxComponent/Pch.h b/Sources/Tools/MaxComponent/Pch.h index b8ce38be..b287a30b 100644 --- a/Sources/Tools/MaxComponent/Pch.h +++ b/Sources/Tools/MaxComponent/Pch.h @@ -68,7 +68,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plPhysical.h" #include "plQuality.h" #include "hsResMgr.h" -#include "hsStlSortUtils.h" #include "hsStream.h" #include "hsStringTokenizer.h" #include "hsTemplates.h" diff --git a/Sources/Tools/MaxComponent/plAutoUIParams.cpp b/Sources/Tools/MaxComponent/plAutoUIParams.cpp index a7973d62..2c689d56 100644 --- a/Sources/Tools/MaxComponent/plAutoUIParams.cpp +++ b/Sources/Tools/MaxComponent/plAutoUIParams.cpp @@ -41,6 +41,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "HeadSpin.h" +#include #include #include "plComponentBase.h" diff --git a/Sources/Tools/MaxComponent/plBipedKiller.cpp b/Sources/Tools/MaxComponent/plBipedKiller.cpp index 19fe193c..3fea8730 100644 --- a/Sources/Tools/MaxComponent/plBipedKiller.cpp +++ b/Sources/Tools/MaxComponent/plBipedKiller.cpp @@ -40,7 +40,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "HeadSpin.h" -#include "hsStlSortUtils.h" #include "plComponent.h" #include "plComponentReg.h" @@ -77,10 +76,6 @@ struct nodeTMInfo // A vector of matrix samples typedef std::vector plSampleVec; -// PLSAMPLEVECMAP -// A map relating bone names to plSampleVecs -typedef std::map plSampleVecMap; - ///////////// // // PROTOTYPES @@ -530,233 +525,3 @@ int LimitTransform(INode* node, Matrix3* nodeTM) */ return false; } - - -/* -////////// -// ARCHIVE -////////// -// Stuff we're not using but that looks kind of handy and which we might use again at some point. - -///////////////////////////////// -///////////////////////////////// -/// SAMPLETREEMOTION -/// Sample motion for all of the non-bip bones in the heirarchy. -/// Need to sample the motion before rearranging the hierarchy and then -/// apply it after rearranging; hence the intermediate storage format. - -// SAMPLETREEMOTION -// Sample all the (non-bip) motion in the whole tree -plSampleVecMap *SampleTreeMotion(INode* node, INode* parent, int sampleRate, Interface *theInterface) -{ - Interval interval = theInterface->GetAnimRange(); - TimeValue start = interval.Start(); // in ticks - TimeValue end = interval.End(); - plSampleVecMap *ourMap = new plSampleVecMap(); - - sampleRate *= GetTicksPerFrame(); // convert sample rate to ticks - - SampleTreeMotionRecurse(node, parent, sampleRate, start, end, ourMap); - - return ourMap; -} - -// SAMPLETREEMOTIONRECURSE -void SampleTreeMotionRecurse(INode * node, INode* parent, int sampleRate, - TimeValue start, TimeValue end, plSampleVecMap *ourMap) -{ - // if it's not a bip, sample the fuck out of it - if(!HasBipController(node)) - { - char *nodeName = node->GetName(); - char *nameCopy = new char[strlen(nodeName) + 1]; - strcpy(nameCopy, nodeName); - - plSampleVec *branch = SampleNodeMotion(node, parent, sampleRate, start, end); - (*ourMap)[nameCopy] = branch; - } - - // whether it's a bip or not, paw through its children - for(int i = 0; i < node->NumberOfChildren(); i++) - { - INode *child = node->GetChildNode(i); - SampleTreeMotionRecurse(child, node, sampleRate, start, end, ourMap); - } -} - -// GETPARTS -void GetParts(int32_t i, std::vector& mat3Array, hsAffineParts* parts) -{ - hsAssert(parts, "nil parts"); - - // decomp matrix - gemAffineParts ap; - hsMatrix44 tXform = plMaxNodeBase::Matrix3ToMatrix44(mat3Array[i]->fMat3); - - decomp_affine(tXform.fMap, &ap); - AP_SET((*parts), ap); -} - -// MAKEROTKEY -Quat MakeRotKey(INode *node, INode *parent, TimeValue t) -{ - AffineParts parts = GetLocalNodeParts(node, parent, t); - - Quat q(parts.q.x, parts.q.y, parts.q.z, parts.q.w); - if( parts.f < 0.f ) - { -// q = Quat(parts.q.x, parts.q.y, parts.q.z, -parts.q.w); - } - else - { -// q=Quat(-parts.q.x, -parts.q.y, -parts.q.z, parts.q.w); - } - - return q; -} - -Quat GetRotKey(int32_t i, std::vector& mat3Array) -{ - Matrix3 m = mat3Array[i]->fMat3; - AffineParts parts; - - decomp_affine(m, &parts); - - Quat q(parts.q.x, parts.q.y, parts.q.z, parts.q.w); - - return q; -} - - -// GETROTKEY -Quat GetRotKey(int32_t i, std::vector& mat3Array, hsAffineParts* parts) -{ - hsAffineParts myParts; - if (!parts) - { - parts=&myParts; - GetParts(i, mat3Array, parts); - } - - Quat q; - if( parts->fF < 0.f ) - { - q = Quat(parts->fQ.fX, parts->fQ.fY, parts->fQ.fZ, -parts->fQ.fW); // ??? why are we inverting W? -#if 0 - if( false) - { - Point3 ax; - float ang; - AngAxisFromQ(q, &ang, ax); - //ang -= M_PI; - ax = -ax; - q = QFromAngAxis(ang, ax); - } -#endif - } - else - { - q=Quat(-parts->fQ.fX, -parts->fQ.fY, -parts->fQ.fZ, parts->fQ.fW); - } - - return q; -} - -// MAKEPOSKEY -Point3 MakePosKey(INode *node, INode *parent, TimeValue t) -{ - AffineParts parts = GetLocalNodeParts(node, parent, t); - - return Point3(parts.t.x, parts.t.y, parts.t.z); -} - - -// GETPOSKEY -Point3 GetPosKey(int32_t i, std::vector& mat3Array, hsAffineParts* parts) -{ - hsAffineParts myParts; - if (!parts) - { - parts=&myParts; - GetParts(i, mat3Array, parts); - } - return Point3(parts->fT.fX, parts->fT.fY, parts->fT.fZ); -} - -// MAKESCALEKEY -ScaleValue MakeScaleKey(INode *node, INode *parent, TimeValue t) -{ - Matrix3 m1 = node->GetNodeTM(t); - hsMatrix44 hsM = plMaxNodeBase::Matrix3ToMatrix44(m1); - gemAffineParts ap; - hsAffineParts hsParts; - - decomp_affine(hsM.fMap, &ap); - AP_SET(hsParts, ap); - - Point3 sAx1; - sAx1=Point3(hsParts.fK.fX, hsParts.fK.fY, hsParts.fK.fZ); - if( hsParts.fF < 0.f ) - { - sAx1=-sAx1; - } - Quat sQ1(hsParts.fU.fX, hsParts.fU.fY, hsParts.fU.fZ, hsParts.fU.fW); - -// return ScaleValue(sAx, sQ); - - AffineParts parts = GetLocalNodeParts(node, parent, t); - - Point3 sAx(parts.k.x, parts.k.y, parts.k.z); - if( parts.f < 0.f ) - { - sAx=-sAx; - } - Quat sQ(parts.u.x, parts.u.y, parts.u.z, parts.u.w); - - return ScaleValue(sAx, sQ); -} - -// GETSCALEKEY -ScaleValue GetScaleKey(int32_t i, std::vector& mat3Array, hsAffineParts* parts) -{ - hsAffineParts myParts; - if (!parts) - { - parts=&myParts; - GetParts(i, mat3Array, parts); - } - - Point3 sAx; - sAx=Point3(parts->fK.fX, parts->fK.fY, parts->fK.fZ); - if( parts->fF < 0.f ) - { - sAx=-sAx; - } - Quat sQ(parts->fU.fX, parts->fU.fY, parts->fU.fZ, parts->fU.fW); - - return ScaleValue(sAx, sQ); -} - - -// GETLOCALNODEPARTS -AffineParts GetLocalNodeParts(INode *node, INode *parent, TimeValue t) -{ - Matrix3 localTM = node->GetNodeTM(t); // world transform of source node - - INode *parent2 = node->GetParentNode(); - // localize it - Matrix3 parentTMX = parent->GetNodeTM(t); - Matrix3 parentTM = parent2->GetNodeTM(t); - - Matrix3 invParent = Inverse(parentTM); - localTM *= invParent; - - AffineParts parts; - - decomp_affine(localTM, &parts); - - return parts; -} - - -*/ \ No newline at end of file diff --git a/Sources/Tools/MaxComponent/plMaxAnimUtils.h b/Sources/Tools/MaxComponent/plMaxAnimUtils.h index 8e687f04..d74aad62 100644 --- a/Sources/Tools/MaxComponent/plMaxAnimUtils.h +++ b/Sources/Tools/MaxComponent/plMaxAnimUtils.h @@ -44,7 +44,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include -#include "hsStlSortUtils.h" #include "plString.h" class plErrorMsg; @@ -88,4 +87,4 @@ void GetSegment(const char *note, float time, SegmentMap *segMap, plErrorMsg *pE bool DoesHaveStopPoints(Animatable *anim); -#endif \ No newline at end of file +#endif diff --git a/Sources/Tools/MaxComponent/plResponderComponent.cpp b/Sources/Tools/MaxComponent/plResponderComponent.cpp index 6629824e..25bcd33a 100644 --- a/Sources/Tools/MaxComponent/plResponderComponent.cpp +++ b/Sources/Tools/MaxComponent/plResponderComponent.cpp @@ -41,7 +41,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "HeadSpin.h" #include "hsResMgr.h" -#include "hsStlSortUtils.h" #include "hsWindows.h" #include @@ -597,7 +596,7 @@ void plResponderProc::ICreateMenu() { fhMenu = CreatePopupMenu(); - std::map menus; + std::map menus; int cmdID = 0; for (int i = 0; i < gResponderCmds.size(); i++) diff --git a/Sources/Tools/MaxExport/Pch.h b/Sources/Tools/MaxExport/Pch.h index bf4e9505..ea01e765 100644 --- a/Sources/Tools/MaxExport/Pch.h +++ b/Sources/Tools/MaxExport/Pch.h @@ -59,7 +59,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsExceptionStack.h" #include "hsExceptions.h" #include "plFile/plFileUtils.h" -#include "hsStlSortUtils.h" #include "hsStream.h" // Windows diff --git a/Sources/Tools/MaxExport/plExportDlg.cpp b/Sources/Tools/MaxExport/plExportDlg.cpp index 0ebd9cb4..f85605e8 100644 --- a/Sources/Tools/MaxExport/plExportDlg.cpp +++ b/Sources/Tools/MaxExport/plExportDlg.cpp @@ -41,7 +41,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "HeadSpin.h" -#include "hsStlSortUtils.h" #include "hsWindows.h" #include diff --git a/Sources/Tools/MaxMain/plMtlCollector.h b/Sources/Tools/MaxMain/plMtlCollector.h index 840a2c5e..573d01d4 100644 --- a/Sources/Tools/MaxMain/plMtlCollector.h +++ b/Sources/Tools/MaxMain/plMtlCollector.h @@ -42,7 +42,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plMtlCollector_h_inc #define plMtlCollector_h_inc -#include "hsStlSortUtils.h" +#include +#include "plString.h" class PBBitmap; class Mtl; @@ -54,7 +55,7 @@ typedef std::set MtlSet; typedef std::set TexSet; typedef std::set LayerSet; typedef std::set PBSet; -typedef std::set TexNameSet; +typedef std::set TexNameSet; class plMtlCollector { diff --git a/Sources/Tools/MaxMain/plResCollector.cpp b/Sources/Tools/MaxMain/plResCollector.cpp index 2e2e93e3..bf84b8fa 100644 --- a/Sources/Tools/MaxMain/plResCollector.cpp +++ b/Sources/Tools/MaxMain/plResCollector.cpp @@ -80,10 +80,10 @@ void plResCollector::Collect() TexNameSet::iterator it = texNames.begin(); for (; it != texNames.end(); it++) { - const char *texName = *it; + plString texName = *it; char outpath[MAX_PATH], name[_MAX_FNAME+_MAX_EXT], ext[_MAX_EXT]; - _splitpath(texName, NULL, NULL, name, ext); + _splitpath(texName.c_str(), NULL, NULL, name, ext); strcat(name, ext); if (bar.Update(name)) @@ -92,7 +92,7 @@ void plResCollector::Collect() strcpy(outpath, path); strcat(outpath, name); - CopyFile(texName, outpath, TRUE); + CopyFile(texName.c_str(), outpath, TRUE); } // Get the filename to save to