// FileOperTools.h: interface for the CFileOperTools class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_FILEOPERTOOLS_H__BD76520C_2349_4A9E_8A18_6FCF91A97ED2__INCLUDED_) #define AFX_FILEOPERTOOLS_H__BD76520C_2349_4A9E_8A18_6FCF91A97ED2__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 //该类为文件操作类,封装了一些常用的文件操作 class CFileOperTools { public: CFileOperTools(); virtual ~CFileOperTools(); static CFileOperTools* GetInstance(); bool CopyFolder(CString strSrcPath, CString strDstPath); //指定文件是否存在,存在返回true,否则为false bool IsFileExist(CString strFileInfo); bool WriteComLog(const CString& strInfo); bool WriteComLog(unsigned char *pszData,int iDateLen); bool DeleteDirectory(CString strDirPath); bool DeleteFileDirect(CString strFilePath); CString GetDstFilePathFolder(); bool GeneralLogName(); bool DealGeneralLogFunc(); protected: void CloseComLog(); static UINT DealGeneralLogThread(LPVOID lParam); protected: static CFileOperTools* m_pFileOper; FILE* m_pComLog; CRITICAL_SECTION *m_pWriteLogSection; CString m_strGeneralLogName; }; #endif // !defined(AFX_FILEOPERTOOLS_H__BD76520C_2349_4A9E_8A18_6FCF91A97ED2__INCLUDED_)