secureswitools/swisistools/source/interpretsis/main.cpp
changeset 60 245df5276b97
parent 33 8110bf1194d1
--- a/secureswitools/swisistools/source/interpretsis/main.cpp	Tue Jul 06 14:23:31 2010 +0300
+++ b/secureswitools/swisistools/source/interpretsis/main.cpp	Wed Aug 18 09:55:45 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of the License "Eclipse Public License v1.0"
@@ -32,6 +32,22 @@
 #include "dirparse.h"
 #endif //SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
 
+
+#ifndef _WIN32
+#include <ctype.h>
+
+//__ctype_b was removed from glibc. This is a workaround to fix the linking problem
+extern "C"
+    {
+    const unsigned short int** __ctype_b()
+        {
+        return __ctype_b_loc();
+        }
+    }
+
+#endif // _WIN32
+
+
 int main(int argc, const char* argv[])
 	{
 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK	
@@ -54,7 +70,7 @@
 
 		if (options.LogFile().size() > 0)
 			{
-			logFile = new std::wofstream(Ucs2ToUtf8(options.LogFile()).c_str(), std::ios::app);
+			logFile = new std::wofstream(wstring2string(options.LogFile()).c_str(), std::ios::app);
 			Logger::SetStream(*logFile);
 			}
 		else
@@ -131,7 +147,7 @@
     	}
 	catch  (InterpretSisError& e)
 		{
-		LERROR(L"\t" << Utf8ToUcs2(e.what()));
+		LERROR(L"\t" << string2wstring(e.what()));
 		result =  e.GetErrorCode();
 		}
 	catch (CSISException e)
@@ -150,7 +166,7 @@
 #endif
 	catch (std::exception &err)
 		{
-		std::wstring emessage = Utf8ToUcs2( err.what() );
+		std::wstring emessage = string2wstring( err.what() );
 		LERROR( L"Error: " << emessage);
 		result = STD_EXCEPTION;
 		}
@@ -167,7 +183,11 @@
 		BackupDb.append("_backup");
 		if (FileExists(string2wstring(BackupDb)))
 		{	
-			std::string command = "move " + BackupDb + " " + dbpath;
+			#ifdef __TOOLS2_LINUX__
+				std::string command = "mv " + BackupDb + " " + dbpath;
+			#else
+				std::string command = "move " + BackupDb + " " + dbpath;
+			#endif
 			int err = system(command.c_str());
 			if (err != 0)
 				LERROR(L"Failed to Restore src.db ");