[Scummvm-cvs-logs] SF.net SVN: scummvm: [22420] scummvm/trunk/backends/psp
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Fri May 12 14:47:41 CEST 2006
Revision: 22420
Author: fingolfin
Date: 2006-05-12 14:01:50 -0700 (Fri, 12 May 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=22420&view=rev
Log Message:
-----------
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...
Modified Paths:
--------------
scummvm/trunk/backends/gp32/gp-fs.cpp
scummvm/trunk/backends/psp/psp_fs.cpp
Modified: scummvm/trunk/backends/gp32/gp-fs.cpp
===================================================================
--- scummvm/trunk/backends/gp32/gp-fs.cpp 2006-05-12 20:55:53 UTC (rev 22419)
+++ scummvm/trunk/backends/gp32/gp-fs.cpp 2006-05-12 21:01:50 UTC (rev 22420)
@@ -25,6 +25,7 @@
#include "stdafx.h"
+#include "backends/fs/abstract-fs.h"
#include "backends/fs/fs.h"
class GP32FilesystemNode : public AbstractFilesystemNode {
@@ -36,7 +37,6 @@
public:
GP32FilesystemNode(void);
- GP32FilesystemNode(const GP32FilesystemNode *node);
GP32FilesystemNode(const String &path);
virtual String displayName() const { return _displayName; }
@@ -44,9 +44,8 @@
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;
- virtual AbstractFilesystemNode *clone() const { return new GP32FilesystemNode(this); }
};
AbstractFilesystemNode *FilesystemNode::getRoot(void) {
@@ -82,19 +81,11 @@
_isDirectory = true;
}
-GP32FilesystemNode::GP32FilesystemNode(const GP32FilesystemNode *node) {
- _displayName = node->_displayName;
- _isDirectory = node->_isDirectory;
- _path = node->_path;
- _isRoot = node->_isRoot;
-}
-
-FSList GP32FilesystemNode::listDir(ListMode mode) const {
+bool GP32FilesystemNode::listDir(AbstractFSList &myList, ListMode mode) const {
assert(_isDirectory);
GPDIRENTRY dirEntry;
uint32 read;
- FSList myList;
if (mode == AbstractFilesystemNode::kListAll)
LP("listDir(kListAll)");
@@ -124,12 +115,12 @@
if (entry._isDirectory)
entry._path += "\\";
- myList.push_back(wrap(new GP32FilesystemNode(&entry)));
+ myList.push_back(new GP32FilesystemNode(entry));
}
BP("Dir... %s", listDir.c_str());
- return myList;
+ return true;
}
/*
AbstractFilesystemNode *GP32FilesystemNode::parent() const {
Modified: scummvm/trunk/backends/psp/psp_fs.cpp
===================================================================
--- scummvm/trunk/backends/psp/psp_fs.cpp 2006-05-12 20:55:53 UTC (rev 22419)
+++ scummvm/trunk/backends/psp/psp_fs.cpp 2006-05-12 21:01:50 UTC (rev 22420)
@@ -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 @@
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 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 @@
(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) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list