os/security/contentmgmt/referencedrmagent/contentiterator/FileContentIteratorBase.h
Update contrib.
2 * Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
26 #ifndef __FILECONTENTITERATORBASE_H__
27 #define __FILECONTENTITERATORBASE_H__
31 #include "StreamablePtrArray.h"
32 #include "ContentIteratorInterface.h"
33 #include <caf/virtualpathptr.h>
37 namespace ContentAccess
41 class CEmbeddedObject;
43 /** Internal class used to recursively iterate over all files in a path and then
44 iterate into all content objects inside each file
49 NONSHARABLE_CLASS(CFileContentIteratorBase) : public MContentIterator
52 virtual ~CFileContentIteratorBase();
55 virtual const TDesC& FileName() const;
56 virtual const TDesC& UniqueId() const;
57 virtual const TDesC& Name() const;
58 virtual const TDesC8& MimeType() const;
62 // Only ever created by CFileContentIterator
63 friend class CFileContentIterator;
65 /** Create a content iterator for a particular path in the file system
66 @param aPath The path to search under
67 @param aRecursive Whether to explore sub-directories under the given path
68 @param aMimeType The mime type to search for. Finds content objects of any mime types if this parameter is omitted
69 @leave KErrNotFound If no suitable content objects were found inside the given path
71 static CFileContentIteratorBase* NewL(CManager &aManager, const TDesC& aPath, TBool aRecursive, const TDesC8& aMimeType = KNullDesC8);
73 CFileContentIteratorBase(CManager& aManager, const TDesC& aPath, TBool aRecursive, const TDesC8& aMimeType);
76 // Construction parameters
80 const TDesC8& iMimeType;
82 MContentIterator* iSubIterator;
84 // Index into the directory list
88 // List of files and directories inside (iPath)
89 CDir* iCurrentDirectoryList;
90 CDir* iCurrentFileList;
92 // Used to store the path of the subdirectory we are exploring