secureswitools/swisistools/source/interpretsislib/utils_win32.cpp
branchRCL_3
changeset 25 7333d7932ef7
parent 24 5cc91383ab1e
child 26 8b7f4e561641
--- a/secureswitools/swisistools/source/interpretsislib/utils_win32.cpp	Thu Aug 19 10:02:49 2010 +0300
+++ b/secureswitools/swisistools/source/interpretsislib/utils_win32.cpp	Tue Aug 31 15:21:33 2010 +0300
@@ -273,3 +273,46 @@
 
 	return 0;
 }
+/*
+//std::string Utils::wstring2string (const std::wstring& aWide)
+std::string wstring2string (const std::wstring& aWide)
+	{
+	int max = WideCharToMultiByte(CP_OEMCP,0,aWide.c_str(),aWide.length(),0,0,0,0);
+	std::string reply;
+	if (max > 0 )
+		{
+		char* buffer = new char [max];
+		try
+			{
+			WideCharToMultiByte(CP_OEMCP,0,aWide.c_str(),aWide.length(),buffer,max,0,0);
+			reply = std::string (buffer, max);
+			}
+		catch (...)
+			{
+			}
+		delete [] buffer;
+		}
+	return reply;
+	}
+
+//std::wstring Utils::string2wstring (const std::string& aNarrow)
+std::wstring string2wstring (const std::string& aNarrow)
+	{
+	int max = MultiByteToWideChar(CP_OEMCP,0,aNarrow.c_str(),aNarrow.length(),0,0);
+	std::wstring reply;
+	if (max > 0 )
+		{
+		wchar_t* buffer = new wchar_t [max];
+		try
+			{
+			MultiByteToWideChar(CP_OEMCP,0,aNarrow.c_str(),aNarrow.length(),buffer,max);
+			reply = std::wstring (buffer, max);
+			}
+		catch (...)
+			{
+			}
+		delete [] buffer;
+		}
+	return reply;
+	}
+*/