os/security/contentmgmt/referencedrmagent/contentiterator/FileContentIterator.cpp
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.
23 #include "contentIterator.h"
24 #include "virtualpath.h"
27 #include "EmbeddedObject.h"
28 #include "FileContentIterator.h"
29 #include "FileContentIteratorBase.h"
31 using namespace ContentAccess;
33 CFileContentIterator* CFileContentIterator::NewL(const TDesC& aPath, TBool aRecursive, const TDesC8& aMimeType)
35 CFileContentIterator* self = new (ELeave) CFileContentIterator();
36 CleanupStack::PushL(self);
37 self->ConstructL(aPath, aRecursive, aMimeType);
38 CleanupStack::Pop(self);
42 void CFileContentIterator::ConstructL(const TDesC& aPath, TBool aRecursive, const TDesC8& aMimeType)
44 if(aPath.Length() == 0)
46 User::Leave(KErrPathNotFound);
49 iPath = aPath.AllocL();
50 iRecursive = aRecursive;
51 iMimeType = aMimeType.AllocL();
53 iManager = CManager::NewL();
55 // Find the first content object
56 iSubIterator = CFileContentIteratorBase::NewL(*iManager, *iPath, iRecursive, *iMimeType);
59 CFileContentIterator::CFileContentIterator()
63 CFileContentIterator::~CFileContentIterator()
72 const TDesC& CFileContentIterator::FileName() const
74 return iSubIterator->FileName();
77 const TDesC& CFileContentIterator::UniqueId() const
79 return iSubIterator->UniqueId();
82 const TDesC& CFileContentIterator::Name() const
84 return iSubIterator->Name();
87 const TDesC8& CFileContentIterator::MimeType() const
89 return iSubIterator->MimeType();
92 TInt CFileContentIterator::Next()
94 return iSubIterator->Next();