[Scummvm-cvs-logs] SF.net SVN: scummvm: [22298] scummvm/trunk/backends/fs
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Wed May 3 03:20:03 CEST 2006
Revision: 22298
Author: fingolfin
Date: 2006-05-03 03:19:05 -0700 (Wed, 03 May 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=22298&view=rev
Log Message:
-----------
Moved static methods getRoot / getNodeForPath from class FilesystemNode to class AbstractFilesystemNode
Modified Paths:
--------------
scummvm/trunk/backends/fs/abstract-fs.h
scummvm/trunk/backends/fs/amigaos4/amigaos4-fs.cpp
scummvm/trunk/backends/fs/fs.cpp
scummvm/trunk/backends/fs/fs.h
scummvm/trunk/backends/fs/morphos/abox-fs.cpp
scummvm/trunk/backends/fs/palmos/palmos-fs.cpp
scummvm/trunk/backends/fs/posix/posix-fs.cpp
scummvm/trunk/backends/fs/ps2/ps2-fs.cpp
scummvm/trunk/backends/fs/symbian/symbian-fs.cpp
scummvm/trunk/backends/fs/windows/windows-fs.cpp
Modified: scummvm/trunk/backends/fs/abstract-fs.h
===================================================================
--- scummvm/trunk/backends/fs/abstract-fs.h 2006-05-03 10:14:05 UTC (rev 22297)
+++ scummvm/trunk/backends/fs/abstract-fs.h 2006-05-03 10:19:05 UTC (rev 22298)
@@ -59,6 +59,29 @@
*/
static FilesystemNode wrap(AbstractFilesystemNode *node);
+ /**
+ * Returns a special node representing the FS root. The starting point for
+ * any file system browsing.
+ * On Unix, this will be simply the node for / (the root directory).
+ * On Windows, it will be a special node which "contains" all drives (C:, D:, E:).
+ */
+ static AbstractFilesystemNode *getRoot();
+
+ /**
+ * Construct a node based on a path; the path is in the same format as it
+ * would be for calls to fopen().
+ *
+ * I.e. getNodeForPath(oldNode.path()) should create a new node identical to oldNode.
+ *
+ * @TODO: This is of course a place where non-portable code easily will sneak
+ * in, because the format of the path used here is not well-defined.
+ * So we really should reconsider this API and try to come up with
+ * something which is more portable but still flexible enough for our
+ * purposes.
+ */
+ static AbstractFilesystemNode *getNodeForPath(const String &path);
+
+
public:
virtual ~AbstractFilesystemNode() {}
Modified: scummvm/trunk/backends/fs/amigaos4/amigaos4-fs.cpp
===================================================================
--- scummvm/trunk/backends/fs/amigaos4/amigaos4-fs.cpp 2006-05-03 10:14:05 UTC (rev 22297)
+++ scummvm/trunk/backends/fs/amigaos4/amigaos4-fs.cpp 2006-05-03 10:19:05 UTC (rev 22298)
@@ -75,11 +75,11 @@
virtual AbstractFilesystemNode *child(const String &name) const;
};
-AbstractFilesystemNode *FilesystemNode::getRoot() {
+AbstractFilesystemNode *AbstractFilesystemNode::getRoot() {
return new AmigaOSFilesystemNode();
}
-AbstractFilesystemNode *FilesystemNode::getNodeForPath(const String &path) {
+AbstractFilesystemNode *AbstractFilesystemNode::getNodeForPath(const String &path) {
return new AmigaOSFilesystemNode(path);
}
Modified: scummvm/trunk/backends/fs/fs.cpp
===================================================================
--- scummvm/trunk/backends/fs/fs.cpp 2006-05-03 10:14:05 UTC (rev 22297)
+++ scummvm/trunk/backends/fs/fs.cpp 2006-05-03 10:19:05 UTC (rev 22298)
@@ -41,7 +41,7 @@
FilesystemNode::FilesystemNode() {
if (_rootNode == 0) {
- _rootNode = getRoot();
+ _rootNode = AbstractFilesystemNode::getRoot();
_rootRefCount = new int(1);
}
_realNode = _rootNode;
@@ -56,7 +56,7 @@
}
FilesystemNode::FilesystemNode(const Common::String &p) {
- _realNode = getNodeForPath(p);
+ _realNode = AbstractFilesystemNode::getNodeForPath(p);
_refCount = new int(1);
}
Modified: scummvm/trunk/backends/fs/fs.h
===================================================================
--- scummvm/trunk/backends/fs/fs.h 2006-05-03 10:14:05 UTC (rev 22297)
+++ scummvm/trunk/backends/fs/fs.h 2006-05-03 10:19:05 UTC (rev 22298)
@@ -77,29 +77,6 @@
FilesystemNode(AbstractFilesystemNode *realNode);
- /**
- * Returns a special node representing the FS root. The starting point for
- * any file system browsing.
- * On Unix, this will be simply the node for / (the root directory).
- * On Windows, it will be a special node which "contains" all drives (C:, D:, E:).
- */
- static AbstractFilesystemNode *getRoot();
-
- /**
- * Construct a node based on a path; the path is in the same format as it
- * would be for calls to fopen().
- *
- * I.e. getNodeForPath(oldNode.path()) should create a new node identical to oldNode.
- *
- * @TODO: This is of course a place where non-portable code easily will sneak
- * in, because the format of the path used here is not well-defined.
- * So we really should reconsider this API and try to come up with
- * something which is more portable but still flexible enough for our
- * purposes.
- */
- static AbstractFilesystemNode *getNodeForPath(const String &path);
-
-
public:
/**
* Flag to tell listDir() which kind of files to list.
Modified: scummvm/trunk/backends/fs/morphos/abox-fs.cpp
===================================================================
--- scummvm/trunk/backends/fs/morphos/abox-fs.cpp 2006-05-03 10:14:05 UTC (rev 22297)
+++ scummvm/trunk/backends/fs/morphos/abox-fs.cpp 2006-05-03 10:19:05 UTC (rev 22298)
@@ -58,7 +58,7 @@
};
-AbstractFilesystemNode *FilesystemNode::getRoot()
+AbstractFilesystemNode *AbstractFilesystemNode::getRoot()
{
return new ABoxFilesystemNode();
}
Modified: scummvm/trunk/backends/fs/palmos/palmos-fs.cpp
===================================================================
--- scummvm/trunk/backends/fs/palmos/palmos-fs.cpp 2006-05-03 10:14:05 UTC (rev 22297)
+++ scummvm/trunk/backends/fs/palmos/palmos-fs.cpp 2006-05-03 10:19:05 UTC (rev 22298)
@@ -78,11 +78,11 @@
list.push_back(wrap(new PalmOSFilesystemNode(entry)));
}
-AbstractFilesystemNode *FilesystemNode::getRoot() {
+AbstractFilesystemNode *AbstractFilesystemNode::getRoot() {
return new PalmOSFilesystemNode();
}
-AbstractFilesystemNode *FilesystemNode::getNodeForPath(const String &path) {
+AbstractFilesystemNode *AbstractFilesystemNode::getNodeForPath(const String &path) {
return new PalmOSFilesystemNode(path);
}
Modified: scummvm/trunk/backends/fs/posix/posix-fs.cpp
===================================================================
--- scummvm/trunk/backends/fs/posix/posix-fs.cpp 2006-05-03 10:14:05 UTC (rev 22297)
+++ scummvm/trunk/backends/fs/posix/posix-fs.cpp 2006-05-03 10:19:05 UTC (rev 22298)
@@ -74,11 +74,11 @@
return cur + 1;
}
-AbstractFilesystemNode *FilesystemNode::getRoot() {
+AbstractFilesystemNode *AbstractFilesystemNode::getRoot() {
return new POSIXFilesystemNode();
}
-AbstractFilesystemNode *FilesystemNode::getNodeForPath(const String &path) {
+AbstractFilesystemNode *AbstractFilesystemNode::getNodeForPath(const String &path) {
return new POSIXFilesystemNode(path, true);
}
Modified: scummvm/trunk/backends/fs/ps2/ps2-fs.cpp
===================================================================
--- scummvm/trunk/backends/fs/ps2/ps2-fs.cpp 2006-05-03 10:14:05 UTC (rev 22297)
+++ scummvm/trunk/backends/fs/ps2/ps2-fs.cpp 2006-05-03 10:19:05 UTC (rev 22298)
@@ -52,11 +52,11 @@
virtual AbstractFilesystemNode *clone() const { return new Ps2FilesystemNode(this); }
};
-AbstractFilesystemNode *FilesystemNode::getRoot(void) {
+AbstractFilesystemNode *AbstractFilesystemNode::getRoot(void) {
return new Ps2FilesystemNode();
}
-AbstractFilesystemNode *FilesystemNode::getNodeForPath(const String &path) {
+AbstractFilesystemNode *AbstractFilesystemNode::getNodeForPath(const String &path) {
return new Ps2FilesystemNode(path);
}
Modified: scummvm/trunk/backends/fs/symbian/symbian-fs.cpp
===================================================================
--- scummvm/trunk/backends/fs/symbian/symbian-fs.cpp 2006-05-03 10:14:05 UTC (rev 22297)
+++ scummvm/trunk/backends/fs/symbian/symbian-fs.cpp 2006-05-03 10:19:05 UTC (rev 22298)
@@ -69,11 +69,11 @@
return cur + 1;
}
-AbstractFilesystemNode *FilesystemNode::getRoot() {
+AbstractFilesystemNode *AbstractFilesystemNode::getRoot() {
return new SymbianFilesystemNode(true);
}
-AbstractFilesystemNode *FilesystemNode::getNodeForPath(const String &path) {
+AbstractFilesystemNode *AbstractFilesystemNode::getNodeForPath(const String &path) {
return new SymbianFilesystemNode(path);
}
Modified: scummvm/trunk/backends/fs/windows/windows-fs.cpp
===================================================================
--- scummvm/trunk/backends/fs/windows/windows-fs.cpp 2006-05-03 10:14:05 UTC (rev 22297)
+++ scummvm/trunk/backends/fs/windows/windows-fs.cpp 2006-05-03 10:19:05 UTC (rev 22298)
@@ -120,11 +120,11 @@
list.push_back(wrap(new WindowsFilesystemNode(entry)));
}
-AbstractFilesystemNode *FilesystemNode::getRoot() {
+AbstractFilesystemNode *AbstractFilesystemNode::getRoot() {
return new WindowsFilesystemNode();
}
-AbstractFilesystemNode *FilesystemNode::getNodeForPath(const String &path) {
+AbstractFilesystemNode *AbstractFilesystemNode::getNodeForPath(const String &path) {
return new WindowsFilesystemNode(path);
}
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