chxavdirectoryreader.h
上传用户:dangjiwu
上传日期:2013-07-19
资源大小:42019k
文件大小:2k
源码类别:
Symbian
开发平台:
Visual C++
- /*****************************************************************************
- * chxavdirectoryreader.h
- * ----------------------
- *
- * Synopsis:
- * Epoc specific helper class to extract files and folders from a directory.
- *
- * _LIT(KDocuments, ("\documents\");
- * epDirectoryReader reader(iEikonEnv->FsSession());
- * reader.SetToPath(KDocuments);
- * const CDir* pFiles = reader.GetFiles();
- * // now use CDir to get file info
- *
- * Target:
- * Symbian OS
- *
- *
- * (c) 1995-2003 RealNetworks, Inc. Patents pending. All rights reserved.
- *
- *****************************************************************************/
- #ifndef _chxavdirectoryreader_h_
- #define _chxavdirectoryreader_h_
- // Symbian includes...
- #include <coemain.h>
- // forward decl
- class RFs;
- class CDir;
- // class CHXAvDirectoryReader
- class CHXAvDirectoryReader
- {
- public:
- CHXAvDirectoryReader(RFs& rfs = CCoeEnv::Static()->FsSession());
- virtual ~CHXAvDirectoryReader();
- bool SetToPath(const TDesC& path);
- bool SetToChild(const TDesC& dir);
- bool SetToParent();
- const CDir* GetFiles() const;
- const CDir* GetDirs() const;
- TInt GetLastError() const;
- void SetSortFlags(TInt sortFlags);
- void SetAttrFilter(TInt attr);
- TInt GetSortFlags() const;
- TInt GetAttrFilter() const;
- private:
- CDir* m_pFileEntries;
- CDir* m_pDirEntries;
- TInt m_lastError;
- TFileName m_path;
- TInt m_sortFlags;
- TInt m_attributes;
- RFs& m_rfs;
- };
- inline
- TInt CHXAvDirectoryReader::GetLastError() const
- {
- return m_lastError;
- }
- inline
- const CDir* CHXAvDirectoryReader::GetFiles() const
- {
- return m_pFileEntries;
- }
- inline
- const CDir* CHXAvDirectoryReader::GetDirs() const
- {
- return m_pDirEntries;
- }
- inline
- void CHXAvDirectoryReader::SetSortFlags(TInt sortFlags)
- {
- m_sortFlags = sortFlags;
- }
- inline
- void CHXAvDirectoryReader::SetAttrFilter(TInt attr)
- {
- m_attributes = attr;
- }
- inline
- TInt CHXAvDirectoryReader::GetSortFlags() const
- {
- return m_sortFlags;
- }
- inline
- TInt CHXAvDirectoryReader::GetAttrFilter() const
- {
- return m_attributes;
- }
- #endif // _chxavdirectoryreader_h_