diff options
author | Max Horn | 2006-05-12 21:01:50 +0000 |
---|---|---|
committer | Max Horn | 2006-05-12 21:01:50 +0000 |
commit | 726c05be966a2e7f80ad9400914f9258d4ef5348 (patch) | |
tree | 5a7262a4e8839e7e4b00e25245706dc44ff099c9 /backends/psp | |
parent | b5556c50fed0dcae072a2f68ab8b572b9dc6b2cb (diff) | |
download | scummvm-rg350-726c05be966a2e7f80ad9400914f9258d4ef5348.tar.gz scummvm-rg350-726c05be966a2e7f80ad9400914f9258d4ef5348.tar.bz2 scummvm-rg350-726c05be966a2e7f80ad9400914f9258d4ef5348.zip |
Make some tweaks to the GP32 and PSP FS code (trying to at least partially bring them up to speed with the FS code changes). Note: If those files were inside backends/fs/, they wouldn't be overlooked as easily when making FS changes...
svn-id: r22420
Diffstat (limited to 'backends/psp')
-rw-r--r-- | backends/psp/psp_fs.cpp | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/backends/psp/psp_fs.cpp b/backends/psp/psp_fs.cpp index 219ad78f64..3e2182914c 100644 --- a/backends/psp/psp_fs.cpp +++ b/backends/psp/psp_fs.cpp @@ -25,6 +25,7 @@ #ifdef __PSP__ #include "base/engine.h" +#include "backends/fs/abstract-fs.h" #include "backends/fs/fs.h" #include <stdio.h> #include <stdlib.h> @@ -44,14 +45,13 @@ protected: public: PSPFilesystemNode(); PSPFilesystemNode(const String &path); - PSPFilesystemNode(const PSPFilesystemNode *node); virtual String displayName() const { return _displayName; } virtual bool isValid() const { return _isValid; } virtual bool isDirectory() const { return _isDirectory; } virtual String path() const { return _path; } - virtual FSList listDir(ListMode) const; + virtual bool listDir(AbstractFSList &list, ListMode mode) const; virtual AbstractFilesystemNode *parent() const; }; @@ -76,25 +76,16 @@ PSPFilesystemNode::PSPFilesystemNode(const Common::String &p) } -PSPFilesystemNode::PSPFilesystemNode(const PSPFilesystemNode *node) { - _displayName = node->_displayName; - _isDirectory = node->_isDirectory; - _isValid = node->_isValid; - _isPseudoRoot = node->_isPseudoRoot; - _path = node->_path; -} - AbstractFilesystemNode *FilesystemNode::getNodeForPath(const String &path) { return new PSPFilesystemNode(path); } -FSList PSPFilesystemNode::listDir(ListMode mode) const { +bool PSPFilesystemNode::listDir(AbstractFSList &myList, ListMode mode) const { assert(_isDirectory); int dfd; - FSList myList; dfd = sceIoDopen(_path.c_str()); if (dfd > 0) { @@ -122,12 +113,13 @@ FSList PSPFilesystemNode::listDir(ListMode mode) const { (mode == kListDirectoriesOnly && !entry._isDirectory)) continue; - myList.push_back(wrap(new PSPFilesystemNode(&entry))); + myList.push_back(new PSPFilesystemNode(entry)); } - sceIoDclose(dfd); + sceIoDclose(dfd); + return true; + } else { + return false; } - - return myList; } const char *lastPathComponent(const Common::String &str) { |