Update path.h
Add spaces, fix title case, change some wording
This commit is contained in:
parent
1e70f0b727
commit
4723dd0db9
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
class CPath
|
class CPath
|
||||||
{
|
{
|
||||||
//Enums
|
// Enums
|
||||||
public:
|
public:
|
||||||
|
|
||||||
enum DIR_CURRENT_DIRECTORY { CURRENT_DIRECTORY = 1 };
|
enum DIR_CURRENT_DIRECTORY { CURRENT_DIRECTORY = 1 };
|
||||||
|
@ -15,12 +15,12 @@ public:
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
FIND_ATTRIBUTE_ALLFILES = 0xFFFF, // Search Include all files
|
FIND_ATTRIBUTE_ALLFILES = 0xFFFF, // Search include all files
|
||||||
FIND_ATTRIBUTE_FILES = 0x0000, // File can be read or written to without restriction
|
FIND_ATTRIBUTE_FILES = 0x0000, // File can be read or written to without restriction
|
||||||
FIND_ATTRIBUTE_SUBDIR = 0x0010, // Subdirectories
|
FIND_ATTRIBUTE_SUBDIR = 0x0010, // Subdirectories
|
||||||
};
|
};
|
||||||
|
|
||||||
//Attributes
|
// Attributes
|
||||||
private:
|
private:
|
||||||
std::string m_strPath;
|
std::string m_strPath;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -33,9 +33,9 @@ private:
|
||||||
uint32_t m_dwFindFileAttributes;
|
uint32_t m_dwFindFileAttributes;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//Methods
|
// Methods
|
||||||
|
|
||||||
//Construction / destruction
|
// Construction / destruction
|
||||||
CPath();
|
CPath();
|
||||||
CPath(const CPath& rPath);
|
CPath(const CPath& rPath);
|
||||||
CPath(const char * lpszPath);
|
CPath(const char * lpszPath);
|
||||||
|
@ -51,7 +51,7 @@ public:
|
||||||
#endif
|
#endif
|
||||||
virtual ~CPath();
|
virtual ~CPath();
|
||||||
|
|
||||||
//Operators
|
// Operators
|
||||||
CPath& operator = (const CPath& rPath);
|
CPath& operator = (const CPath& rPath);
|
||||||
CPath& operator = (const char * lpszPath);
|
CPath& operator = (const char * lpszPath);
|
||||||
CPath& operator = (const std::string & strPath);
|
CPath& operator = (const std::string & strPath);
|
||||||
|
@ -60,7 +60,7 @@ public:
|
||||||
operator const char *() const;
|
operator const char *() const;
|
||||||
operator const std::string &() { return m_strPath; }
|
operator const std::string &() { return m_strPath; }
|
||||||
|
|
||||||
//Get path components
|
// Get path components
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
void GetDriveDirectory(std::string & rDriveDirectory) const;
|
void GetDriveDirectory(std::string & rDriveDirectory) const;
|
||||||
std::string GetDriveDirectory(void) const;
|
std::string GetDriveDirectory(void) const;
|
||||||
|
@ -81,11 +81,11 @@ public:
|
||||||
#else
|
#else
|
||||||
void GetComponents(std::string* pDirectory = NULL, std::string* pName = NULL, std::string* pExtension = NULL) const;
|
void GetComponents(std::string* pDirectory = NULL, std::string* pName = NULL, std::string* pExtension = NULL) const;
|
||||||
#endif
|
#endif
|
||||||
//Get other state
|
// Get other state
|
||||||
bool IsEmpty() const { return m_strPath.empty(); }
|
bool IsEmpty() const { return m_strPath.empty(); }
|
||||||
bool IsRelative() const;
|
bool IsRelative() const;
|
||||||
|
|
||||||
//Set path components
|
// Set path components
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
void SetDrive(char chDrive);
|
void SetDrive(char chDrive);
|
||||||
void SetDriveDirectory(const char * lpszDriveDirectory);
|
void SetDriveDirectory(const char * lpszDriveDirectory);
|
||||||
|
@ -103,7 +103,7 @@ public:
|
||||||
#else
|
#else
|
||||||
void SetComponents(const char * lpszDirectory, const char * lpszName, const char * lpszExtension);
|
void SetComponents(const char * lpszDirectory, const char * lpszName, const char * lpszExtension);
|
||||||
#endif
|
#endif
|
||||||
//Set whole path
|
// Set whole path
|
||||||
void Empty() { m_strPath.erase(); }
|
void Empty() { m_strPath.erase(); }
|
||||||
void CurrentDirectory();
|
void CurrentDirectory();
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -113,28 +113,28 @@ public:
|
||||||
void ModuleDirectory(void * hInstance);
|
void ModuleDirectory(void * hInstance);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Directory information
|
// Directory information
|
||||||
bool IsDirectory() const;
|
bool IsDirectory() const;
|
||||||
bool DirectoryExists() const;
|
bool DirectoryExists() const;
|
||||||
|
|
||||||
//File Information
|
// File information
|
||||||
bool IsFile() const { return !IsDirectory(); }
|
bool IsFile() const { return !IsDirectory(); }
|
||||||
bool Exists() const;
|
bool Exists() const;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
bool SelectFile(void * hwndOwner, const char * InitialDir, const char * FileFilter, bool FileMustExist);
|
bool SelectFile(void * hwndOwner, const char * InitialDir, const char * FileFilter, bool FileMustExist);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Directory operations
|
// Directory operations
|
||||||
bool DirectoryCreate(bool bCreateIntermediates = true);
|
bool DirectoryCreate(bool bCreateIntermediates = true);
|
||||||
bool ChangeDirectory();
|
bool ChangeDirectory();
|
||||||
void NormalizePath(CPath BaseDir);
|
void NormalizePath(CPath BaseDir);
|
||||||
|
|
||||||
//File operations
|
// File operations
|
||||||
bool Delete(bool bEvenIfReadOnly = true) const;
|
bool Delete(bool bEvenIfReadOnly = true) const;
|
||||||
bool CopyTo(const char * lpcszTargetFile, bool bOverwrite = true);
|
bool CopyTo(const char * lpcszTargetFile, bool bOverwrite = true);
|
||||||
bool MoveTo(const char * lpcszTargetFile, bool bOverwrite = true);
|
bool MoveTo(const char * lpcszTargetFile, bool bOverwrite = true);
|
||||||
|
|
||||||
//Finders
|
// Finders
|
||||||
bool FindFirst(uint32_t dwAttributes = 0);
|
bool FindFirst(uint32_t dwAttributes = 0);
|
||||||
bool FindNext();
|
bool FindNext();
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ public:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//Setup & Cleanup
|
// Setup and cleanup
|
||||||
inline void Init();
|
inline void Init();
|
||||||
inline void Exit();
|
inline void Exit();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue