SDC C-Project CF Review 프로그램
LYW
2021-07-23 55615eba335d4cbc1f83330dc5078fe073034b7d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#pragma once
 
#include <list>
#include <vector>
#include <algorithm>
 
class CPathInfo
{
public:
    CPathInfo()        { Reset(); }
    ~CPathInfo()    { Reset(); }
    
    void Reset()
    {
        strFilePath    = _T("");
        nCreateDate    = 0;
        nDepth = 0;
    }
    
    CString        strFilePath;
    __int64        nCreateDate;
    int            nDepth;
};
 
typedef std::vector<CPathInfo>                VectorPathInfo;
typedef std::vector<CPathInfo>::iterator    VectorPathInfoIt;
 
typedef std::list<CPathInfo*>                ListPathInfo;
typedef std::list<CPathInfo*>::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;
};