Initial Cleanup of Path.cpp, remove no longer used functions

This commit is contained in:
Emmet Young 2015-02-16 17:13:37 +11:00
parent b42fcd6434
commit 6a3836d40f
2 changed files with 4 additions and 1626 deletions
Source/Common

File diff suppressed because it is too large Load Diff

View File

@ -35,41 +35,8 @@ class CPath
public:
enum DIR_CURRENT_DIRECTORY { CURRENT_DIRECTORY = 1 };
enum DIR_WINDOWS_DIRECTORY { WINDOWS_DIRECTORY = 2 };
enum DIR_SYSTEM_DIRECTORY { SYSTEM_DIRECTORY = 3 };
enum DIR_SYSTEM32_DIRECTORY { SYSTEM32_DIRECTORY = 4 };
enum DIR_SYSTEM_DRIVER_DIRECTORY { SYSTEM_DRIVER_DIRECTORY = 5 };
enum DIR_SYSTEM_DRIVE_ROOT_DIRECTORY { SYSTEM_DRIVE_ROOT_DIRECTORY = 6 };
enum DIR_MODULE_DIRECTORY { MODULE_DIRECTORY = 7 };
enum DIR_MODULE_FILE { MODULE_FILE = 8 };
enum SpecialDirectoryType
{
TEMP_DIRECTORY,
PROGRAM_FILES_DIRECTORY,
COMMON_FILES_DIRECTORY,
ACCESSORIES_DIRECTORY,
MEDIA_DIRECTORY,
DEVICE_DIRECTORY,
USER_DESKTOP_DIRECTORY,
USER_FAVORITES_DIRECTORY,
USER_FONTS_DIRECTORY,
USER_NETHOOD_DIRECTORY,
USER_DOCUMENTS_DIRECTORY,
USER_RECENT_DIRECTORY,
USER_SENDTO_DIRECTORY,
USER_TEMPLATES_DIRECTORY,
USER_RECYCLE_DIRECTORY,
USER_APPLICATION_DATA_DIRECTORY,
USER_STARTMENU_DIRECTORY,
USER_STARTMENU_STARTUP_DIRECTORY,
USER_STARTMENU_PROGRAMS_DIRECTORY,
COMMON_DESKTOP_DIRECTORY,
COMMON_STARTMENU_DIRECTORY,
COMMON_STARTMENU_STARTUP_DIRECTORY,
COMMON_STARTMENU_PROGRAMS_DIRECTORY,
LAST_SPECIAL
};
enum DIR_MODULE_DIRECTORY { MODULE_DIRECTORY = 2 };
enum DIR_MODULE_FILE { MODULE_FILE = 3 };
enum { _A_ALLFILES = 0xFFFF }; /* Search Include all files */
@ -93,16 +60,8 @@ public:
CPath(const stdstr& strPath);
CPath(const stdstr& strPath, LPCTSTR NameExten);
CPath(const stdstr& strPath, const stdstr& NameExten);
CPath(SpecialDirectoryType sdt);
CPath(SpecialDirectoryType sdt, LPCTSTR NameExten );
CPath(SpecialDirectoryType sdt, const stdstr& NameExten );
CPath(DIR_CURRENT_DIRECTORY sdt, LPCTSTR NameExten = NULL);
CPath(DIR_WINDOWS_DIRECTORY sdt, LPCTSTR NameExten = NULL);
CPath(DIR_SYSTEM_DIRECTORY sdt, LPCTSTR NameExten = NULL );
CPath(DIR_SYSTEM32_DIRECTORY sdt, LPCTSTR NameExten = NULL);
CPath(DIR_SYSTEM_DRIVER_DIRECTORY sdt, LPCTSTR NameExten = NULL);
CPath(DIR_SYSTEM_DRIVE_ROOT_DIRECTORY sdt, LPCTSTR NameExten = NULL);
CPath(DIR_MODULE_DIRECTORY sdt, LPCTSTR NameExten = NULL);
CPath(DIR_MODULE_FILE sdt);
@ -122,8 +81,6 @@ public:
operator stdstr&() { return m_strPath; }
//Get path components
void GetDrive(stdstr& rDrive) const;
stdstr GetDrive(void) const;
void GetDriveDirectory(stdstr& rDriveDirectory) const;
stdstr GetDriveDirectory(void) const;
void GetDirectory(stdstr& rDirectory) const;
@ -137,18 +94,14 @@ public:
void GetCurrentDirectory(stdstr& rDrive) const;
stdstr GetCurrentDirectory(void) const;
void GetFullyQualified(stdstr& rFullyQualified) const;
void GetFullyQualifiedShort(stdstr& rFullyQualifiedShort) const;
void GetComponents(stdstr* pDrive =NULL,
stdstr* pDirectory =NULL,
stdstr* pName =NULL,
stdstr* pExtension =NULL) const;
void GetAsInternetPath(stdstr& Directory) const;
//Get other state
BOOL IsEmpty() const { return m_strPath.empty(); }
BOOL IsRelative() const;
BOOL IsWild() const;
BOOL IsValid() const; // Checks lexical correctness only
//Set path components
void SetDrive(TCHAR chDrive);
@ -168,94 +121,28 @@ public:
//Set whole path
void Empty() { m_strPath.erase(); }
void SpecialDirectory(SpecialDirectoryType sdt);
void MakeRoot();
void CurrentDirectory();
void WindowsDirectory();
void SystemDirectory();
void SystemDriveRootDirectory();
void TempDirectory();
void Module();
void Module(HINSTANCE hInstance);
void ModuleDirectory();
void ModuleDirectory(HINSTANCE hInstance);
void ProgramFilesDirectory(); // C:\Program Files
void CommonFilesDirectory(); // C:\Program Files\Common Files
void AccessoriesDirectory(); // C:\Program Files\Accessories
void MediaDirectory(); // C:\Windows\Media
void DeviceDirectory(); // C:\Windows\Inf
void UserDesktopDirectory();
void UserFavoritesDirectory();
void UserFontsDirectory();
void UserNetworkNeighbourhoodDirectory();
void UserDocumentsDirectory();
void UserRecentDirectory();
void UserSendToDirectory();
void UserTemplatesDirectory();
void UserRecycleBinDirectory();
void UserApplicationDataDirectory();
void UserStartMenuDirectory();
void UserStartMenuStartupDirectory();
void UserStartMenuProgramsDirectory();
void CommonDesktopDirectory();
void CommonStartMenuDirectory();
void CommonStartMenuStartupDirectory();
void CommonStartMenuProgramsDirectory();
void WindowsProfile(); // Win.INI
void SystemProfile(); // System.INI
BOOL CreateTempName(LPCTSTR lpcszPrefix);
BOOL CreateTempDir(LPCTSTR lpcszPrefix, UINT nRetries =100);
BOOL CreateRandomName(BOOL bMustNotExist =TRUE, UINT nRetries =1000);
BOOL CreateSimilarName(BOOL bMustNotExist =TRUE, UINT nRetries =1000);
//Drive Information
UINT GetDriveType() const;
BOOL IsRemovableDrive() const { return GetDriveType()==DRIVE_REMOVABLE; }
BOOL IsCDRomDrive() const { return GetDriveType()==DRIVE_CDROM; }
BOOL IsNetworkDrive() const { return GetDriveType()==DRIVE_REMOTE; }
BOOL IsRAMDrive() const { return GetDriveType()==DRIVE_RAMDISK; }
BOOL IsFixedDrive() const { return GetDriveType()==DRIVE_FIXED; }
ULONG DriveTotalSpaceBytes() const;
ULONG DriveFreeSpaceBytes() const;
ULONG GetDriveClusterSize() const;
BOOL GetDiskInfo(LPDWORD lpSectorsPerCluster,
LPDWORD lpBytesPerSector,
LPDWORD lpFreeClusters,
LPDWORD lpClusters) const;
//Directory information
BOOL IsDirectory() const;
BOOL DirectoryExists() const;
BOOL IsDirectoryEmpty() const;
//File Information
BOOL IsFile() const { return !IsDirectory(); }
BOOL Exists() const;
ULONG GetSize() const;
ULONG GetAttributes() const;
BOOL GetTime(FILETIME *lpCreated, FILETIME *lpAccessed, FILETIME *lpModified) const;
FILETIME GetTimeCreated() const;
FILETIME GetTimeLastModified() const;
FILETIME GetTimeLastAccessed() const;
//Directory operations
BOOL CreateDirectory(BOOL bCreateIntermediates =TRUE);
BOOL RemoveDirectory(BOOL bEvenIfNotEmpty =FALSE);
BOOL RemoveDirectoryContent();
BOOL ChangeDirectory();
//File operations
BOOL Delete(BOOL bEvenIfReadOnly =TRUE) const;
BOOL Rename(LPCTSTR lpszNewPath);
BOOL CopyTo(LPCTSTR lpcszTargetFile, BOOL bOverwrite =TRUE);
BOOL MoveTo(LPCTSTR lpcszTargetFile, BOOL bOverwrite =TRUE);
BOOL SetAttributes(ULONG dwAttributes);
BOOL SetTime(const FILETIME *lpCreated, const FILETIME *lpAccessed, const FILETIME *lpModified);
BOOL SetTimeCreated(const FILETIME *lpCreated);
BOOL SetTimeLastModified(const FILETIME *lpModified);
BOOL SetTimeLastAccessed(const FILETIME *lpAccessed);
//Finders
BOOL FindFirst(ULONG dwAttributes =_A_NORMAL);
@ -267,10 +154,6 @@ public:
private:
BOOL AttributesMatch(ULONG dwTargetAttributes, ULONG dwFileAttributes);
BOOL ShellDirectory(int nShellFolderID);
BOOL ShellDirectory2(int nShellFolderID);
BOOL GetRegistryPath(HKEY hRootKey, LPCTSTR lpcszKeyName, LPCTSTR lpcszValueName, stdstr &strPath);
void cleanPathString(stdstr& rDirectory) const;
void StripLeadingChar(stdstr& rText, TCHAR chLeading) const;