secureswitools/swisistools/source/interpretsislib/adornedutilities.cpp
branchRCL_3
changeset 81 42552535c1ac
parent 62 5cc91383ab1e
equal deleted inserted replaced
73:79647526f98c 81:42552535c1ac
     1 /*
     1 /*
     2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Eclipse Public License v1.0"
     5 * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    54 			}
    54 			}
    55 		}
    55 		}
    56 	}
    56 	}
    57 }
    57 }
    58 
    58 
    59 #ifndef __TOOLS2_LINUX__
       
    60 bool IsAdornedVariationOf(const std::wstring& aFileName1, const std::wstring& aFileName2)
    59 bool IsAdornedVariationOf(const std::wstring& aFileName1, const std::wstring& aFileName2)
    61 #else
       
    62 bool IsAdornedVariationOf(const std::wstring& aFileName1, const std::wstring& aFileName2, const std::wstring& aDrivePath)
       
    63 #endif
       
    64 {
    60 {
    65 	std::wstring unadornedFileName1;
    61 	std::wstring unadornedFileName1;
    66 	GetUnadornedFileName(aFileName1,unadornedFileName1);
    62 	GetUnadornedFileName(aFileName1,unadornedFileName1);
    67 
    63 
    68 	std::wstring unadornedFileName2;
    64 	std::wstring unadornedFileName2;
    69 	GetUnadornedFileName(aFileName2,unadornedFileName2);
    65 	GetUnadornedFileName(aFileName2,unadornedFileName2);
    70 
       
    71 	#ifdef __TOOLS2_LINUX__
       
    72 	ConvertToLocalPath( unadornedFileName1, aDrivePath );
       
    73 	ConvertToLocalPath( unadornedFileName2, aDrivePath );
       
    74 	#endif
       
    75 
    66 
    76   	// Check whether filename2 is a variant of filename1
    67   	// Check whether filename2 is a variant of filename1
    77   	// e.g: d:\sys\bin\DummyDll{000A0001}.dll is considered a variant of c:\sys\bin\DummyDll.dll 
    68   	// e.g: d:\sys\bin\DummyDll{000A0001}.dll is considered a variant of c:\sys\bin\DummyDll.dll 
    78   	// because they both break down to \sys\bin\DummyDll.dll
    69   	// because they both break down to \sys\bin\DummyDll.dll
    79 	std::wstring fileName1Path(StringUtils::Path(unadornedFileName1));
    70 	std::wstring fileName1Path(StringUtils::Path(unadornedFileName1));
    80 	std::wstring fileName1NameAndExt(StringUtils::NameAndExt(unadornedFileName1));
    71 	std::wstring fileName1NameAndExt(StringUtils::NameAndExt(unadornedFileName1));
    81 
    72 
    82 	std::wstring fileName2Path(StringUtils::Path(unadornedFileName2));
    73 	std::wstring fileName2Path(StringUtils::Path(unadornedFileName2));
    83 	std::wstring fileName2NameAndExt(StringUtils::NameAndExt(unadornedFileName2));
    74 	std::wstring fileName2NameAndExt(StringUtils::NameAndExt(unadornedFileName2));
    84 
    75 
    85 	return ( !wcscmp(fileName1Path.c_str(), fileName2Path.c_str()) && !wcscmp(fileName1NameAndExt.c_str(), fileName2NameAndExt.c_str()) );
    76 	return ((fileName1Path == fileName2Path) && (fileName1NameAndExt == fileName2NameAndExt));
    86 }
    77 }
    87 	
    78 	
    88 void FindAllAdornedVariants(const std::wstring& aSearchNameWild, const std::wstring& aSearchPath, std::list<std::wstring>& aAdornedFileNamesFound, const DrivesMap& aDriveMap)
    79 void FindAllAdornedVariants(const std::wstring& aSearchNameWild, const std::wstring& aSearchPath, std::list<std::wstring>& aAdornedFileNamesFound, const DrivesMap& aDriveMap)
    89 {
    80 {
    90 	DrivesMap::const_iterator it = aDriveMap.begin();
    81 	DrivesMap::const_iterator it = aDriveMap.begin();