00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00014
00021 #if !defined(ZIPARCHIVE_DIRENUMERATOR_DOT_H)
00022 #define ZIPARCHIVE_DIRENUMERATOR_DOT_H
00023
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #pragma warning( push )
00027 #pragma warning (disable : 4100) // unreferenced formal parameter
00028 #if defined ZIP_HAS_DLL
00029 #pragma warning( disable : 4251 ) // needs to have dll-interface to be used by clients of class
00030 #endif
00031 #endif
00032
00033 #include "ZipString.h"
00034 #include "ZipPathComponent.h"
00035 #include "FileFilter.h"
00036
00040 namespace ZipArchiveLib
00041 {
00046 class ZIP_API CDirEnumerator
00047 {
00048 LPCTSTR m_lpszDirectory;
00049 LPCTSTR m_lpszFileNameMask;
00050 bool m_bRecursive;
00051 CZipString m_szCurrentDirectory;
00052 protected:
00068 CDirEnumerator(LPCTSTR lpszDirectory, bool bRecursive = true)
00069 {
00070 CZipString dir(lpszDirectory);
00071 if (dir.IsEmpty())
00072 m_lpszDirectory = _T(".");
00073 else
00074 m_lpszDirectory = lpszDirectory;
00075 m_bRecursive = bRecursive;
00076 }
00077
00096 virtual bool Process(LPCTSTR lpszPath, const CFileInfo& info) = 0;
00097
00104 virtual void OnEnumerationBegin(){}
00105
00116 virtual void OnEnumerationEnd(bool bResult){}
00117
00126 virtual void EnterDirectory(){}
00127
00136 virtual void ExitDirectory(){}
00137
00138 public:
00139
00149 LPCTSTR GetDirectory() const {return m_lpszDirectory;}
00150
00161 bool IsRecursive() const {return m_bRecursive;}
00162
00169 LPCTSTR GetCurrentDirectory() const {return m_szCurrentDirectory;}
00170
00184 bool Start(CFileFilter& filter);
00185
00186 virtual ~CDirEnumerator(){}
00187 private:
00188 static bool IsDots(LPCTSTR lpszName);
00189 };
00190
00191 }
00192
00193 #if _MSC_VER > 1000
00194 #pragma warning( pop )
00195 #endif
00196
00197 #endif
00198