#pragma once #include #include #include class CPathInfo { public: CPathInfo() { Reset(); } ~CPathInfo() { Reset(); } void Reset() { strFilePath = _T(""); nCreateDate = 0; nDepth = 0; } CString strFilePath; __int64 nCreateDate; int nDepth; }; typedef std::vector VectorPathInfo; typedef std::vector::iterator VectorPathInfoIt; typedef std::list ListPathInfo; typedef std::list::iterator ListPathInfoIt; class AFX_EXT_CLASS CFolderManager { public: CFolderManager(); CFolderManager(const CString& strMainPath, UINT nRemainCount); ~CFolderManager(); void DeleteOldFiles(); void SetFolderInfo(const CString& strMainPath, UINT nRemainCount); private: void Reset(); void DeleteFileProcess(); void DeleteFolderProcess(); BOOL SearchPathInfo(const CString& strParentPath, int nDepth, int& nFileCount); CString m_strMainPath; UINT m_nRemainCount; VectorPathInfo m_vectorFileInfo; VectorPathInfo m_vectorFolderInfo; // ListPathInfo m_listFolderInfo; __int64 m_nLastCreateDate; };