From db2157d1b1154e20f27631305c1be8d2fe1eb6af Mon Sep 17 00:00:00 2001 From: janwas Date: Fri, 7 Nov 2003 01:31:32 +0000 Subject: [PATCH] no message This was SVN commit r48. --- source/ps/CStr.cpp | 16 ++++++++-------- source/ps/CStr.h | 21 +++++++++++++++++++++ 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/source/ps/CStr.cpp b/source/ps/CStr.cpp index 322e984b65..b9753ccc21 100755 --- a/source/ps/CStr.cpp +++ b/source/ps/CStr.cpp @@ -11,7 +11,7 @@ CStr::CStr(const CStr &Str) m_String = Str.m_String; } -CStr::CStr(LPCTSTR String) +CStr::CStr(const TCHAR* String) { // Creates CStr from C-Style TCHAR string m_String = String; @@ -58,14 +58,14 @@ CStr::CStr(_ulong Number) CStr::CStr(_float Number) { // Creates CStr from a float - _stprintf(m_ConversionBuffer, FLOAT_CONVERSION, Number); + _tsprintf(m_ConversionBuffer, FLOAT_CONVERSION, Number); m_String = m_ConversionBuffer; } CStr::CStr(_double Number) { // Creates CStr from a double - _stprintf(m_ConversionBuffer, FLOAT_CONVERSION, Number); + _tsprintf(m_ConversionBuffer, FLOAT_CONVERSION, Number); m_String = m_ConversionBuffer; } @@ -261,7 +261,7 @@ CStr &CStr::operator=(const CStr &Str) return *this; } -CStr &CStr::operator=(LPCTSTR String) +CStr &CStr::operator=(const TCHAR* String) { m_String = String; return *this; @@ -300,14 +300,14 @@ CStr &CStr::operator=(_ulong Number) CStr &CStr::operator=(_float Number) { - _stprintf(m_ConversionBuffer, FLOAT_CONVERSION, Number); + _tsprintf(m_ConversionBuffer, FLOAT_CONVERSION, Number); m_String = m_ConversionBuffer; return *this; } CStr &CStr::operator=(_double Number) { - _stprintf(m_ConversionBuffer, FLOAT_CONVERSION, Number); + _tsprintf(m_ConversionBuffer, FLOAT_CONVERSION, Number); m_String = m_ConversionBuffer; return *this; } @@ -355,7 +355,7 @@ CStr CStr::operator+(CStr &Str) return NewStr; } -CStr::operator LPCTSTR() +CStr::operator const TCHAR*() { return m_String.c_str(); } @@ -386,6 +386,6 @@ TCHAR &CStr::operator[](_ulong n) ostream &operator<<(ostream &os, CStr &Str) { - os << (LPCTSTR)Str; + os << (const TCHAR*)Str; return os; } \ No newline at end of file diff --git a/source/ps/CStr.h b/source/ps/CStr.h index 2e85b071b5..c4dc230b5a 100755 --- a/source/ps/CStr.h +++ b/source/ps/CStr.h @@ -47,13 +47,34 @@ typedef wstring tstring; #define _tcout wcout #define _tstod wcstod typedef wchar_t TCHAR; +#define _ttoi _wtoi +#define _ttol _wtol +#define _itot _itow +#define _ultot _itow #define _T(t) L ## t + +#define _totlower towlower +#define _istspace iswspace +#define _tsprintf wsprintf +#define _ultot _ultow +#define _ltot _ltow + #else + typedef string tstring; #define _tcout cout #define _tstod strtod +#define _ttoi atoi +#define _ttol atol +#define _itot _itoa typedef char TCHAR; #define _T(t) t +#define _istspace isspace +#define _tsprintf sprintf +#define _totlower tolower +#define _ultot _ultoa +#define _ltot _ltoa + #endif