PIDir windows drives support

git-svn-id: svn://db.shs.com.ru/pip@55 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
2015-04-01 06:41:33 +00:00
parent 071fc76ea3
commit d60e7fad2a
8 changed files with 111 additions and 55 deletions

View File

@@ -38,7 +38,7 @@ public:
//! Returns if this directory is exists
bool isExists() const {return PIDir::isExists(path_);}
bool isExists() const {return PIDir::isExists(path());}
//! Returns if path of this directory is absolute
bool isAbsolute() const;
@@ -48,7 +48,7 @@ public:
//! Returns path of this directory
const PIString & path() const {return path_;}
PIString path() const;
//! Returns absolute path of this directory
PIString absolutePath() const;
@@ -60,7 +60,7 @@ public:
PIDir & cleanPath();
//! Returns %PIDir with simplified path of this directory
PIDir cleanedPath() const {PIDir d(path_); d.cleanPath(); return d;}
PIDir cleanedPath() const {PIDir d(path()); d.cleanPath(); return d;}
//! Returns relative to this directory path "path"
PIString relative(const PIString & path) const;
@@ -69,13 +69,14 @@ public:
PIDir & setDir(const PIString & path);
//! Set this directory path as current for application
bool setCurrent() {return PIDir::setCurrent(path_);}
bool setCurrent() {return PIDir::setCurrent(path());}
/** \brief Returns this directory content
* \details Scan this directory and returns all directories
* and files in one list, sorted alphabetically. This list
* contains also "." and ".." members.
* contains also "." and ".." members. There are absolute
* pathes in returned list.
* \attention This function doesn`t scan content of inner
* directories! */
PIVector<PIFile::FileInfo> entries();
@@ -83,13 +84,14 @@ public:
/** \brief Returns all this directory content
* \details Scan this directory recursively and returns all
* directories and files in one list, sorted alphabetically.
* This list doesn`t contains "." and ".." members.
* Files placed after directories in this list */
* This list doesn`t contains "." and ".." members. There
* are absolute pathes in returned list, and
* files placed after directories in this list */
PIVector<PIFile::FileInfo> allEntries();
bool make(bool withParents = true);
bool remove() {return PIDir::remove(path_);}
bool rename(const PIString & new_name) {if (!PIDir::rename(path_, new_name)) return false; path_ = new_name; return true;}
bool remove() {return PIDir::remove(path());}
bool rename(const PIString & new_name) {if (!PIDir::rename(path(), new_name)) return false; setDir(new_name); return true;}
PIDir & cd(const PIString & path);
PIDir & up() {return cd("..");}
@@ -107,7 +109,7 @@ public:
static bool remove(const PIString & path) {return removeDir(path);}
static bool rename(const PIString & path, const PIString & new_name) {return PIDir::renameDir(path, new_name);}
static bool setCurrent(const PIString & path);
static bool setCurrent(const PIDir & dir) {return setCurrent(dir.path_);}
static bool setCurrent(const PIDir & dir) {return setCurrent(dir.path());}
private:
static bool makeDir(const PIString & path);