summaryrefslogtreecommitdiff
path: root/plugins/CommonLibs/CString.h
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2012-06-16 17:42:08 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2012-06-16 17:42:08 +0000
commit5975b2d0903bd5df128d55e20cd27d7c13b4e46c (patch)
tree6696492511c591fa8bf3b65a64864245caa3e7c2 /plugins/CommonLibs/CString.h
parent8617d7e00546f892c9084f7c382648b23d8bbb63 (diff)
another portion of "#ifdef Unicode" removal
git-svn-id: http://svn.miranda-ng.org/main/trunk@448 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/CommonLibs/CString.h')
-rw-r--r--plugins/CommonLibs/CString.h71
1 files changed, 15 insertions, 56 deletions
diff --git a/plugins/CommonLibs/CString.h b/plugins/CommonLibs/CString.h
index ed2540c511..fb956f6e4e 100644
--- a/plugins/CommonLibs/CString.h
+++ b/plugins/CommonLibs/CString.h
@@ -109,7 +109,7 @@ typedef TString<WCHAR> WCString;
__inline CString TCHAR2ANSI(TCString Str)
{
-#ifdef _UNICODE
+
if (Str == NULL)
{
return CString();
@@ -123,15 +123,13 @@ __inline CString TCHAR2ANSI(TCString Str)
AStr.ReleaseBuffer(Str.GetLen());
}
return AStr;
-#else
- return Str;
-#endif
+
}
__inline TCString ANSI2TCHAR(CString Str)
{
-#ifdef _UNICODE
+
if (Str == NULL)
{
return TCString();
@@ -146,64 +144,30 @@ __inline TCString ANSI2TCHAR(CString Str)
TStr.ReleaseBuffer(Len - 1);
}
return TStr;
-#else
- return Str;
-#endif
+
}
__inline WCString TCHAR2WCHAR(TCString Str)
{
-#ifdef _UNICODE
+
return Str;
-#else
- if (Str == NULL)
- {
- return WCString();
- }
- WCString WStr;
- int Len = MultiByteToWideChar(CP_ACP, 0, Str, -1, NULL, 0);
- if (!MultiByteToWideChar(CP_ACP, 0, Str, -1, WStr.GetBuffer(Len), Len))
- {
- WStr.ReleaseBuffer(0);
- } else
- {
- WStr.ReleaseBuffer(Len - 1);
- }
- return WStr;
-#endif
+
}
__inline TCString WCHAR2TCHAR(WCString Str)
{
-#ifdef _UNICODE
+
return Str;
-#else
- if (Str == NULL)
- {
- return TCString();
- }
- CString AStr;
- if (!WideCharToMultiByte(CP_ACP, 0, Str, -1, AStr.GetBuffer(Str.GetLen() + 1), Str.GetLen() + 1, NULL, NULL))
- {
- AStr.ReleaseBuffer(0);
- } else
- {
- AStr.ReleaseBuffer(Str.GetLen());
- }
- return AStr;
-#endif
+
}
-#ifdef _UNICODE
+
#define WCHAR2ANSI TCHAR2ANSI
#define ANSI2WCHAR ANSI2TCHAR
-#else
-#define WCHAR2ANSI WCHAR2TCHAR
-#define ANSI2WCHAR TCHAR2WCHAR
-#endif
+
#ifdef CHARARRAY_CONVERT
@@ -247,7 +211,7 @@ __inline CHARARRAY ANSI2WCHAR_ARRAY(CHARARRAY &c)
return Result;
}
-#ifdef _UNICODE // utf8 conversion doesn't work on win95
+
__inline CHARARRAY WCHAR2UTF8(WCString Str)
{
CHARARRAY Result;
@@ -262,7 +226,7 @@ __inline CHARARRAY WCHAR2UTF8(WCString Str)
}
return Result;
}
-#endif
+
#endif // CHARARRAY_CONVERT
@@ -308,11 +272,8 @@ private:
wchar_t *p;
};
-#ifdef _UNICODE
+
#define UTF8Decode UTF8DecodeW
-#else
-#define UTF8Decode UTF8DecodeA
-#endif
/*class mallocStrA
@@ -339,9 +300,7 @@ private:
wchar_t *p;
};
-#ifdef _UNICODE
+
#define mallocStr mallocStrW
-#else
-#define mallocStr mallocStrA
-#endif
+
*/ \ No newline at end of file