|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0"" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Scanner class used to scan file system by file UID. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 // USER INCLUDES |
|
21 #include "msengfilescanner.h" |
|
22 |
|
23 |
|
24 |
|
25 // ================= MEMBER FUNCTIONS ======================================== |
|
26 |
|
27 // --------------------------------------------------------------------------- |
|
28 // CMsengFileScanner::CMsengFileScanner() |
|
29 // |
|
30 // Constructor |
|
31 // --------------------------------------------------------------------------- |
|
32 CMsengFileScanner::CMsengFileScanner(MMsengScannerObserver& aObserver, |
|
33 CMsengInfoArray& aScanArray, |
|
34 RFs& aFsSession) |
|
35 : CMsengDirectoryScanner(aObserver, aScanArray, aFsSession) |
|
36 { |
|
37 } |
|
38 |
|
39 // --------------------------------------------------------------------------- |
|
40 // CMsengFileScanner::~CMsengFileScanner() |
|
41 // |
|
42 // Destructor |
|
43 // --------------------------------------------------------------------------- |
|
44 |
|
45 CMsengFileScanner::~CMsengFileScanner() |
|
46 { |
|
47 } |
|
48 |
|
49 // --------------------------------------------------------------------------- |
|
50 // CMsengFileScanner::ScanDirectoryL() |
|
51 // |
|
52 // |
|
53 // --------------------------------------------------------------------------- |
|
54 CMsengDirectoryScanner::TScanDirectoryResult CMsengFileScanner::ScanDirectoryL |
|
55 (const TDesC& aDirectory, RFs& /*aFsSession*/) |
|
56 { |
|
57 TBool moveToNextDirectory = ETrue; |
|
58 CDir* results = FindFilesL(aDirectory, moveToNextDirectory); |
|
59 if (results) |
|
60 { |
|
61 CleanupStack::PushL(results); |
|
62 |
|
63 // Go through all files in the list and tell subclass |
|
64 TFileName file; |
|
65 const TInt count = results->Count(); |
|
66 for(TInt i=0; i<count; i++) |
|
67 { |
|
68 const TEntry& entry = (*results)[i]; |
|
69 file = aDirectory; |
|
70 file += entry.iName; |
|
71 |
|
72 // Tell subclass about identified file |
|
73 const TLocationResponse response = HandleLocatedEntryL(file, entry); |
|
74 } |
|
75 CleanupStack::PopAndDestroy(results); |
|
76 } |
|
77 |
|
78 |
|
79 // Should we request that we move onto the next directory in the list |
|
80 TScanDirectoryResult response = EContinueToNextDirectory; |
|
81 if (!moveToNextDirectory) |
|
82 { |
|
83 response = EContinueProcessingCurrentDirectory; |
|
84 } |
|
85 return response; |
|
86 } |
|
87 |
|
88 // End of File |