equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2008-2010 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". |
21 @file |
21 @file |
22 */ |
22 */ |
23 |
23 |
24 #include "adornedutilities.h" |
24 #include "adornedutilities.h" |
25 #include "log.h" |
25 #include "log.h" |
|
26 #include "cleanuputils.h" |
26 |
27 |
27 _LIT(KAdornedWildCharString, "{????????}"); |
28 _LIT(KAdornedWildCharString, "{????????}"); |
28 const TInt Swi::FileNameUnadornedPartLength = 10; |
29 const TInt Swi::FileNameUnadornedPartLength = 10; |
29 |
30 |
30 void Swi::GetUnadornedFileName(const TDesC& aAdornedFilename, TDes& aUnadornedFilename) |
31 void Swi::GetUnadornedFileName(const TDesC& aAdornedFilename, TDes& aUnadornedFilename) |
73 return ret; |
74 return ret; |
74 } |
75 } |
75 |
76 |
76 void Swi::FindAllAdornedVariantsL(RFs& aFs, const TDesC& aSearchNameWild, const TDesC& aSearchPath, RPointerArray<HBufC>& aAdornedFileNamesFound) |
77 void Swi::FindAllAdornedVariantsL(RFs& aFs, const TDesC& aSearchNameWild, const TDesC& aSearchPath, RPointerArray<HBufC>& aAdornedFileNamesFound) |
77 { |
78 { |
|
79 CleanupResetAndDestroyPushL(aAdornedFileNamesFound); |
78 TFindFile finder(aFs); |
80 TFindFile finder(aFs); |
79 CDir* dirList=0; |
81 CDir* dirList=0; |
80 TBool matchFound = (finder.FindWildByDir( aSearchNameWild, aSearchPath, *&dirList) == KErrNone); |
82 TBool matchFound = (finder.FindWildByDir( aSearchNameWild, aSearchPath, *&dirList) == KErrNone); |
81 CleanupStack::PushL(dirList); |
83 CleanupStack::PushL(dirList); |
82 |
84 |
102 dirList = 0; |
104 dirList = 0; |
103 matchFound = (finder.FindWild(dirList) == KErrNone); |
105 matchFound = (finder.FindWild(dirList) == KErrNone); |
104 CleanupStack::PushL(dirList); |
106 CleanupStack::PushL(dirList); |
105 } |
107 } |
106 CleanupStack::PopAndDestroy(dirList); |
108 CleanupStack::PopAndDestroy(dirList); |
|
109 CleanupStack::Pop(&aAdornedFileNamesFound); |
107 } |
110 } |
108 |
111 |
109 void Swi::GenerateSearchNameWildL(const TDesC& aFileName, TDes& aSearchNameWild) |
112 void Swi::GenerateSearchNameWildL(const TDesC& aFileName, TDes& aSearchNameWild) |
110 { |
113 { |
111 RBuf unadornedFileName; |
114 RBuf unadornedFileName; |