diff options
author | David Corrales | 2007-06-17 17:17:38 +0000 |
---|---|---|
committer | David Corrales | 2007-06-17 17:17:38 +0000 |
commit | 8ebf479bc5db8cf4996cc0820269aaf04139b940 (patch) | |
tree | 6a698da9142fee9fb07d6dbd4ac0d36e47787a56 /backends/fs/posix | |
parent | fe4ee4740d76b0aee2032814095f1d2b81dbde14 (diff) | |
download | scummvm-rg350-8ebf479bc5db8cf4996cc0820269aaf04139b940.tar.gz scummvm-rg350-8ebf479bc5db8cf4996cc0820269aaf04139b940.tar.bz2 scummvm-rg350-8ebf479bc5db8cf4996cc0820269aaf04139b940.zip |
Added a new parameter to the getChildren function, which allows including hidden files in the results.
svn-id: r27514
Diffstat (limited to 'backends/fs/posix')
-rw-r--r-- | backends/fs/posix/posix-fs.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/backends/fs/posix/posix-fs.cpp b/backends/fs/posix/posix-fs.cpp index fb5c9dc5d7..c976830402 100644 --- a/backends/fs/posix/posix-fs.cpp +++ b/backends/fs/posix/posix-fs.cpp @@ -71,7 +71,7 @@ public: virtual bool isWritable() const { return access(_path.c_str(), W_OK) == 0; } virtual AbstractFilesystemNode *getChild(const String &n) const; - virtual bool getChildren(AbstractFSList &list, ListMode mode) const; + virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const; virtual AbstractFilesystemNode *getParent() const; private: @@ -162,7 +162,7 @@ AbstractFilesystemNode *POSIXFilesystemNode::getChild(const String &n) const { return new POSIXFilesystemNode(newPath, true); } -bool POSIXFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode) const { +bool POSIXFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, bool hidden) const { assert(_isDirectory); DIR *dirp = opendir(_path.c_str()); @@ -173,8 +173,8 @@ bool POSIXFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode) con // loop over dir entries using readdir while ((dp = readdir(dirp)) != NULL) { - // Skip 'invisible' files - if (dp->d_name[0] == '.') + // Skip 'invisible' files if necessary + if (dp->d_name[0] == '.' && !hidden) continue; String newPath(_path); |