secureswitools/swisistools/source/sisxlibrary/siscontents.cpp
branchRCL_3
changeset 62 5cc91383ab1e
parent 0 ba25891c3a9e
child 65 7333d7932ef7
equal deleted inserted replaced
61:cd189dac02f7 62:5cc91383ab1e
    65 	}
    65 	}
    66 
    66 
    67 bool CSISContents::IsSisFile(const std::wstring& aFileName)
    67 bool CSISContents::IsSisFile(const std::wstring& aFileName)
    68 	{
    68 	{
    69 	TSISStream input;
    69 	TSISStream input;
       
    70 	#ifdef __TOOLS2_LINUX__
    70 	std::wstring fileName = FixPathDelimiters(aFileName);
    71 	std::wstring fileName = FixPathDelimiters(aFileName);
       
    72 	#else
       
    73 	std::wstring fileName = aFileName;
       
    74 	#endif
    71 	HANDLE file = ::MakeSISOpenFile(fileName.c_str(),GENERIC_READ,OPEN_EXISTING);
    75 	HANDLE file = ::MakeSISOpenFile(fileName.c_str(),GENERIC_READ,OPEN_EXISTING);
    72 	CSISException::ThrowIf ((INVALID_HANDLE_VALUE == file), 
    76 	CSISException::ThrowIf ((INVALID_HANDLE_VALUE == file), 
    73 							CSISException::EFileProblem, std::wstring (L"cannot open ") + fileName);
    77 							CSISException::EFileProblem, std::wstring (L"cannot open ") + fileName);
    74 	bool success = input.import (file, NULL);
    78 	bool success = input.import (file, NULL);
    75 	::CloseHandle(file);
    79 	::CloseHandle(file);
    97 
   101 
    98 
   102 
    99 void CSISContents::Load (const std::wstring& aFileName, TUint64* size)
   103 void CSISContents::Load (const std::wstring& aFileName, TUint64* size)
   100 	{
   104 	{
   101 	TSISStream input;
   105 	TSISStream input;
       
   106 	#ifdef __TOOLS2_LINUX__
   102 	std::wstring fileName = FixPathDelimiters(aFileName);
   107 	std::wstring fileName = FixPathDelimiters(aFileName);
       
   108 	#else
       
   109 	std::wstring fileName = aFileName;
       
   110 	#endif
   103 	HANDLE file = ::MakeSISOpenFile(fileName.c_str(),GENERIC_READ,OPEN_EXISTING);
   111 	HANDLE file = ::MakeSISOpenFile(fileName.c_str(),GENERIC_READ,OPEN_EXISTING);
   104 	if (INVALID_HANDLE_VALUE == file)
   112 	if (INVALID_HANDLE_VALUE == file)
   105 		{
   113 		{
   106 		SISLogger::Log(L" Error : Cannot open file : ");
   114 		SISLogger::Log(L" Error : Cannot open file : ");
   107 		SISLogger::Log(fileName);
   115 		SISLogger::Log(fileName);