diff -r ae54820ef82c -r 245df5276b97 secureswitools/swisistools/source/rscparser/dirparse.cpp --- a/secureswitools/swisistools/source/rscparser/dirparse.cpp Tue Jul 06 14:23:31 2010 +0300 +++ b/secureswitools/swisistools/source/rscparser/dirparse.cpp Wed Aug 18 09:55:45 2010 +0300 @@ -310,9 +310,17 @@ componentData.iLocale = aLocale; componentData.iServiceUid = aServUid; - componentData.iOpaqueData = aStrValue; - aAppOpaqueData.iOpaqueDataType.push_back(componentData); + /* + * Under LINUX : The OpaqueData which is read from the resource file will be in UTF-16 format contained + * in a std::wstring. So, we need to convert it back to UTF-32 format which is the format + * of LINUX specific std::wstring. + * + * Under WINDOWS : Nothing needs to be done and this is taken care of by XercesStringToWString() + * which is platform specific. + */ + componentData.iOpaqueData = XercesStringToWString(reinterpret_cast(aStrValue.c_str())); + aAppOpaqueData.iOpaqueDataType.push_back(componentData); } /** @@ -326,10 +334,18 @@ aParamList->IsFlagSet(CParameterList::EFlagsDisableZDriveChecksSet) ) { + #ifdef __LINUX__ + return wstring2string(aParamList->SystemDrivePath()) + "/sys/install/scr/scr.db"; + #else return wstring2string(aParamList->SystemDrivePath()) + "\\sys\\install\\scr\\scr.db"; + #endif } + #ifdef __LINUX__ + return wstring2string(aParamList->RomDrivePath()) + "/sys/install/scr/provisioned/scr.db"; + #else return wstring2string(aParamList->RomDrivePath()) + "\\sys\\install\\scr\\provisioned\\scr.db"; + #endif } /** @@ -340,13 +356,27 @@ XmlDetails::TScrPreProvisionDetail aScrPreProvisionDetail) { CXmlGenerator xmlGenerator; - char* tmpFileName = tmpnam(NULL); + + #ifndef __TOOLS2_LINUX__ + char* tmpFileName = tmpnam(NULL); + #else + char tmpFileName[] = "/tmp/interpretsis_preprovision_XXXXXX"; + int temp_fd; + temp_fd=mkstemp(tmpFileName); + fclose(fdopen(temp_fd,"w")); + #endif + std::wstring filename(string2wstring(tmpFileName)); int isRomApplication = 1; xmlGenerator.WritePreProvisionDetails(filename , aScrPreProvisionDetail, isRomApplication); + #ifdef __LINUX__ + std::string executable = "scrtool"; + #else std::string executable = "scrtool.exe"; + #endif + std::string command; command = executable + " -d " + GetDbPath(aParamList) + " -p " + tmpFileName; @@ -517,13 +547,21 @@ { size_t found; std::string folder; + #ifdef __LINUX__ + found=aFileName.find("private/10003a3f/"); + #else found=aFileName.find("private\\10003a3f\\"); + #endif if( found != string::npos ) folder = aFileName.substr(0,found); else { + #ifdef __LINUX__ + std::string errMsg= "Failed : Resource File Path should contain /private/10003a3f/"; + #else std::string errMsg= "Failed : Resource File Path should contain \\private\\10003a3f\\"; + #endif throw CResourceFileException(errMsg); } @@ -606,7 +644,11 @@ else { aFilePath = aParamList->RomDrivePath(); + #ifdef __LINUX__ + aFilePath.append(L"/private/10003a3f/apps"); + #else aFilePath.append(L"\\private\\10003a3f\\apps"); + #endif } int iCount = 0; @@ -625,9 +667,14 @@ { iCount++; std::string fName; - fName = Ucs2ToUtf8( *curr ); + fName = wstring2string( *curr ); std::string FilePath = wstring2string(aFilePath); + #ifdef __LINUX__ + FilePath.append("/"); + #else FilePath.append("\\"); + #endif + FilePath.append(fName); std::cout<<"Parsing - "<