SDC C-Project CF Review 프로그램
LYW
2022-04-01 9c13bc5af33d28bb217995597f88fe863db42442
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
#pragma once
 
 
#include "akCoreLinker.h"
 
#include <vector>
#include <io.h>
 
 
using namespace std;
typedef vector<_finddatai64_t> VECFINDDATA;
 
class AKCORE_DLLSPEC CakFileUtil
{
public:
    CakFileUtil(void);
    virtual ~CakFileUtil(void);
 
    //ºÐ¼®°á°ú ÃʱâÈ­
    void clear();
 
    //ÆÄÀϠã±â
    void FindFile(char* pTargetPathName, bool bFindSubDir = true);
    //ÆÄÀÌ À̸§ º¯°æ
    void RenameFile(char* pTargetPathName, char* pNewFileName, bool bFindSubDir = true);
    void RenameFile(char* pTargetPathName, char* pFindWord, char* pReplaceWord, bool bFindSubDir = true);
    //ÆÄÀÏ»èÁ¦
    void DeleteFiles( char* pTargetPathName, bool bFindSubDir /*= true*/ );
 
    //Æú´õ Ã£±â
    void FindFolder(char* pTargetPath, bool bFindSubDir = true);
    //Æú´õ À̸§ º¯°æ
    void RenameFolder(char* pTargetPath, char* pNewFolderName, bool bFindSubDir = true);
    void RenameFolder(char* pTargetPath, char* pFindWord, char* pReplaceWord, bool bFindSubDir = true);
    //Æú´õ »èÁ¦
    static    void DeleteFolder( char* pTargetPath, bool bFindSubDir /*= true*/ );
 
    //¸¶Áö¸· ¿¡·¯ Á¤º¸
    int getLastError(){return m_nLastError;};
 
    //ºÐ¼® °á°ú ¾ò±â
    VECFINDDATA* getFindData(){return &m_vecFinds;};
    int getFindSubDirCount(){return m_nFindSubCount;};
    VECFINDDATA* getProcessData(){return &m_vecProcess;};
    _finddatai64_t* getFindData(char* pName);
    char* getProcessPath(){return m_nProcessPath;};
 
    //Æú´õ°£ º¹»ç ÅÂÇö[2016/4/5]
    static int CopyFolder(char* strSrc, char* strDest, bool bSubDir = true);
    static int MoveFolder(char* strSrc, char* strDest, bool bSubDir = true);
 
    static void MakeDirectory(char* pPath);
 
    //ÀϹݱâ´ÉÇÔ¼ö
    static char* getFileName(char* pPathFileName);
    static char* getFileExt(char* pPathFileName);
    static void getPath(char* strDest, int nDestSize, const char* strSource);
    static int getLastPath(char* strDest, int nDestSize, char* strSource);
    static char* getLastPath(char* pPath);
 
 
    //°æ·ÎÁ¤¸® º¯°æ(ex. ./aaa/bb/./bbb/../ -> ./aaa/bb/)
    static void changeAbsolutePath(char* pPathFileName);
 
    static int isNetworkPath(char* pPath);//³×Ƽ¿öÅ© °æ·Î°¡ ¸Â´Ù¸é ³¡ºÎºÐ °æ·Î¸¦ ¹ÝȯÇÑ´Ù. ÅÂÇö[2016/4/8]
protected:
    void FindFileSubDir(char* pTargetPath, char* pWildcard);
    //void DeleteFolderSubDir(char* pTargetPath);
    void makeAbPathWildcard(char* pTargetPath, char* pNewPath, int nNewPathSize, char* pWildcard, int nWildcardSize); //Àý´ë °æ·Î »ý¼º°ú ¿ÍÀϵå Ä«µå¸¦ ºÐ¸® Çϴ ¿ªÇÒ
    void FindFolderSubDir(const char* pTargetPath, const char* pWildcard);
    void makeAbPathWildcardFolder(char* pTargetPath, char* pNewPath, int nNewPathSize, char* pWildcard, int nWildcardSize); //Àý´ë °æ·Î »ý¼º°ú ¿ÍÀϵå Ä«µå¸¦ ºÐ¸® Çϴ ¿ªÇÒ(Æú´õ·Î ±¸¼ºµÇ¾úÀ» °æ¿ì)
 
protected:
    char m_nProcessPath[512];
    VECFINDDATA m_vecFinds;
    VECFINDDATA m_vecProcess;
    int m_nLastError;
    int m_nFindSubCount;
};