| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- #pragma once
- #include "otsdataconst.h"
- // COTSFileSys command target
- namespace OTSMODEL {
- 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 GetCompanySysDataPathName();
-
- // get company log path
- static CString GetCompanyLogPathName();
-
- // 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);
- };
- }
|