diff options
author | Max Horn | 2006-05-03 20:43:26 +0000 |
---|---|---|
committer | Max Horn | 2006-05-03 20:43:26 +0000 |
commit | d016c353c5f2f87278e244ec6418c87d681925b1 (patch) | |
tree | 33040b385072a3611ce4bc76079ee68128a76a53 /backends/fs/posix | |
parent | 1902673ece88d54ae5ae6b51ef63da6b07477bba (diff) | |
download | scummvm-rg350-d016c353c5f2f87278e244ec6418c87d681925b1.tar.gz scummvm-rg350-d016c353c5f2f87278e244ec6418c87d681925b1.tar.bz2 scummvm-rg350-d016c353c5f2f87278e244ec6418c87d681925b1.zip |
Changed FilesystemNode::listDir to return a bool indicating its success (or failure)
svn-id: r22315
Diffstat (limited to 'backends/fs/posix')
-rw-r--r-- | backends/fs/posix/posix-fs.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/backends/fs/posix/posix-fs.cpp b/backends/fs/posix/posix-fs.cpp index 86ca581fd1..b9278fbb00 100644 --- a/backends/fs/posix/posix-fs.cpp +++ b/backends/fs/posix/posix-fs.cpp @@ -57,7 +57,7 @@ public: virtual bool isDirectory() const { return _isDirectory; } virtual String path() const { return _path; } - virtual AbstractFSList listDir(ListMode mode) const; + virtual bool listDir(AbstractFSList &list, ListMode mode) const; virtual AbstractFilesystemNode *parent() const; virtual AbstractFilesystemNode *child(const String &name) const; }; @@ -136,15 +136,14 @@ POSIXFilesystemNode::POSIXFilesystemNode(const String &p, bool verify) { } } -AbstractFSList POSIXFilesystemNode::listDir(ListMode mode) const { +bool POSIXFilesystemNode::listDir(AbstractFSList &myList, ListMode mode) const { assert(_isDirectory); DIR *dirp = opendir(_path.c_str()); struct dirent *dp; - AbstractFSList myList; if (dirp == NULL) - return myList; + return false; // ... loop over dir entries using readdir while ((dp = readdir(dirp)) != NULL) { @@ -201,7 +200,7 @@ AbstractFSList POSIXFilesystemNode::listDir(ListMode mode) const { myList.push_back(new POSIXFilesystemNode(entry)); } closedir(dirp); - return myList; + return true; } AbstractFilesystemNode *POSIXFilesystemNode::parent() const { |