LAPTOP-SNT8I5JK\Boounion
2024-11-13 5471abe440f1b449293a3c93b3a638396682617a
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// BLFolderScheduling.h: interface for the CBLFolderScheduling class.
//
//////////////////////////////////////////////////////////////////////
 
#if !defined(AFX_BLFOLDERSCHEDULING_H__2C8D9E82_222F_41FD_A78D_C17563334CA1__INCLUDED_)
#define AFX_BLFOLDERSCHEDULING_H__2C8D9E82_222F_41FD_A78D_C17563334CA1__INCLUDED_
 
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
 
#define TARGETTYPE_FOLDER        1
#define TARGETTYPE_FILE            2
 
struct SSubPathInfo
{
    CString        s_strItemPath;
    CString        s_strItemName;
    long        s_nCreateDate;
    int            s_nItemType;
 
    SSubPathInfo()
    {
        Reset();
    }
    void Reset()
    {
        s_strItemPath = _T("");
        s_strItemName = _T("");
        s_nCreateDate = 0;
        s_nItemType = 0;
    }
    
    // º¹»ç »ý¼ºÀÚ.
    SSubPathInfo(const SSubPathInfo& rhs)
    {
        if(this != &rhs)
        {
            s_strItemPath = rhs.s_strItemPath;
            s_strItemName = rhs.s_strItemName;
            s_nCreateDate = rhs.s_nCreateDate;
            s_nItemType = rhs.s_nItemType;
        }
    }
 
    // ´ëÀÔ¿¬»êÀÚ ¿À¹ö·Îµù.
    SSubPathInfo& operator=(const SSubPathInfo& rhs)
    {
        if(this != &rhs)
        {
            s_strItemPath = rhs.s_strItemPath;
            s_strItemName = rhs.s_strItemName;
            s_nCreateDate = rhs.s_nCreateDate;
            s_nItemType = rhs.s_nItemType;
        }
        return *this;
    }
};
 
class AFX_EXT_CLASS CBLFolderScheduling  
{
public:
    CBLFolderScheduling();
    CBLFolderScheduling(CString strPath);
    CBLFolderScheduling(CString strPath, int nTargetType);
    virtual ~CBLFolderScheduling();
 
    BOOL SetRemainDelete(CString strPath, int nTargetType, int nRemainItemCount);
    BOOL CommitSchedule();
    void ResetSchedule();
 
protected:
    
    BOOL SearchSubItem(const CString &strMainPath, BOOL bIsAscending);
    BOOL SortSubItem(BOOL bIsAscending);    // ¿À¸§Â÷¼ø TRUE, ³»¸²Â÷¼ø FALSE
    BOOL DeleteFolder(const CString &strFolder);
 
    // °ü¸®¸¦ ÇÒ ÃÖ»óÀ§ °æ·Î.
    CString                m_strMainPath;
    BOOL                m_bTargetFolder;
    BOOL                m_bTargetFile;
    BOOL                m_bIsAscending;
 
    // ÀϺθ¸ ³²±â°í »èÁ¦.
    int                    m_nRemainItemCount;
 
    // °ü¸® ´ë»ó Á¤º¸
    SSubPathInfo*        m_pPathInfo;
    int                    m_nSubItemCount;
};
 
#endif // !defined(AFX_BLFOLDERSCHEDULING_H__2C8D9E82_222F_41FD_A78D_C17563334CA1__INCLUDED_)