|
1 /* |
|
2 * Copyright (c) 2004-2009 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 the License "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 * |
|
16 */ |
|
17 |
|
18 |
|
19 /** |
|
20 @file |
|
21 @internalComponent |
|
22 @released |
|
23 */ |
|
24 |
|
25 |
|
26 #ifndef __CAF_FILECONTENTITERATOR_H__ |
|
27 #define __CAF_FILECONTENTITERATOR_H__ |
|
28 |
|
29 #include <e32base.h> |
|
30 |
|
31 #include "streamableptrarray.h" |
|
32 #include <caf/virtualpathptr.h> |
|
33 #include "ContentIteratorInterface.h" |
|
34 |
|
35 namespace ContentAccess |
|
36 { |
|
37 class CManager; |
|
38 class CFileContentIteratorBase; |
|
39 |
|
40 /** Recursively iterates over all files and then into each file to determine the content |
|
41 objects inside |
|
42 |
|
43 @internalComponent |
|
44 @released |
|
45 */ |
|
46 NONSHARABLE_CLASS(CFileContentIterator): public MContentIterator |
|
47 { |
|
48 public: |
|
49 /** Create a content iterator for a particular path in the file system |
|
50 @param aPath The path to search under |
|
51 @param aRecursive Whether to explore sub-directories under the given path |
|
52 @param aMimeType The mime type to search for. Finds content objects of any mime types if this parameter is omitted |
|
53 @leave KErrNotFound If no suitable content objects were found inside the given path |
|
54 */ |
|
55 static CFileContentIterator* NewL(const TDesC& aPath, TBool aRecursive, const TDesC8& aMimeType); |
|
56 |
|
57 virtual ~CFileContentIterator(); |
|
58 |
|
59 // MContentIterator |
|
60 virtual const TDesC& FileName() const; |
|
61 virtual const TDesC& UniqueId() const; |
|
62 virtual const TDesC& Name() const; |
|
63 virtual const TDesC8& MimeType() const; |
|
64 virtual TInt Next(); |
|
65 |
|
66 |
|
67 private: |
|
68 CFileContentIterator(); |
|
69 void ConstructL(const TDesC& aPath, TBool aRecursive, const TDesC8& aMimeType); |
|
70 |
|
71 // Manager for doing GetDir() |
|
72 CManager* iManager; |
|
73 |
|
74 // Construction Parameters |
|
75 HBufC* iPath; |
|
76 TBool iRecursive; |
|
77 HBufC8* iMimeType; |
|
78 |
|
79 CFileContentIteratorBase* iSubIterator; |
|
80 }; |
|
81 |
|
82 } |
|
83 |
|
84 #endif |