SDC C-Project CF Review 프로그램
LYW
2021-10-15 e5fa774d622d6852fe8e1f033045aed221649108
ReviewHistory/include/akCore/akFileUtil.h
»õ ÆÄÀÏ
@@ -0,0 +1,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;
};