123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- #pragma once
- #include <boost/scope_exit.hpp>
- #include <boost/noncopyable.hpp>
- #include <wtypes.h>
- #include <afxstr.h>
- #include "otsdataconst.h"
- namespace OTSTools {
- using namespace OTSDATA;
- class __declspec(dllexport) COTSFileSys : private boost::noncopyable
- {
- public:
- COTSFileSys();
- ~COTSFileSys();
- // check if the file exists or not
- static BOOL Exists(LPCTSTR a_sPath);
- // check if the given string is valid file name or not
- static BOOL IsValidFileName(LPCTSTR a_sFileName);
- // copy a file
- static BOOL CopyAFile(LPCTSTR a_strSourceFile, LPCTSTR a_strTargetFile, const BOOL a_bOverwrite = FALSE);
- // move a file
- static BOOL MoveAFile(LPCTSTR a_strSourceFile, LPCTSTR a_strTargetFile, const BOOL a_bOverwrite = TRUE);
- // delete a file.
- static BOOL DeleteAFile(LPCTSTR a_strFileName);
- // delete all files in the folder
- static BOOL DeleteAllFiles(LPCTSTR a_strFolder, LPCTSTR a_sFilter = nullptr);
- // creates a folder.
- static BOOL CreateFolder(LPCTSTR a_strFolder);
- // deletes a folder and contents recursively.
- static BOOL DeleteFolder(LPCTSTR a_strFolder);
- // check if this is an existing folder
- static BOOL IsFolder(LPCTSTR a_strFolder);
- // check if the file or folder is read only
- static BOOL IsReadOnly(LPCTSTR a_strPathName);
- // sets the read only flag for a file or a folder
- static BOOL SetReadOnly(LPCTSTR a_strPathName, BOOL a_bReadOnly = TRUE);
- // get system common data folder pathname
- static CString GetOSCommonDataPathName();
-
- // get company system data pathname
- static CString GetSysDataPathName();
-
- // get company log path
- static CString GetLogPathName();
-
- // get software pack system data path
- static CString GetOTSPackSysDataPathName(OTS_SOFT_PACKAGE_ID a_nPackId);
-
- // get software pack program data path
- static CString GetOTSPackProgDataPathName(OTS_SOFT_PACKAGE_ID a_nPackId);
- // get software pack measure preference file path name
- static CString GetOTSPackMeasurePrefFilePathName(OTS_SOFT_PACKAGE_ID a_nPackId);
- // get software pack measure preference file path name
- static CString GetOTSPackReportPrefFilePathName(OTS_SOFT_PACKAGE_ID a_nPackId);
- // get system STD lib file path name
- static CString GetOTSPackSysSTDLibFilePathName(OTS_SOFT_PACKAGE_ID a_nPackId);
- };
- }
|