aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/fs/abstract-fs-factory.cpp (renamed from backends/fs/fs-factory-maker.cpp)2
-rw-r--r--backends/fs/abstract-fs-factory.h8
-rw-r--r--backends/fs/dc/dc-fs.cpp2
-rw-r--r--backends/fs/gp32/gp32-fs.cpp4
-rw-r--r--backends/fs/palmos/palmos-fs.cpp2
-rw-r--r--backends/fs/posix/posix-fs.cpp2
-rw-r--r--backends/fs/psp/psp_fs.cpp2
-rw-r--r--backends/fs/symbian/symbian-fs.cpp2
-rw-r--r--backends/fs/windows/windows-fs.cpp2
-rw-r--r--backends/module.mk6
-rw-r--r--common/fs.cpp9
11 files changed, 24 insertions, 17 deletions
diff --git a/backends/fs/fs-factory-maker.cpp b/backends/fs/abstract-fs-factory.cpp
index 045f30cb28..6126d82737 100644
--- a/backends/fs/fs-factory-maker.cpp
+++ b/backends/fs/abstract-fs-factory.cpp
@@ -60,7 +60,7 @@
*
* @return AbstractFilesystemFactory* The specific factory for the current architecture.
*/
-static AbstractFilesystemFactory *makeFSFactory() {
+AbstractFilesystemFactory *AbstractFilesystemFactory::makeFSFactory() {
#if defined(__amigaos4__)
return &AmigaOSFilesystemFactory::instance();
#elif defined(__DC__)
diff --git a/backends/fs/abstract-fs-factory.h b/backends/fs/abstract-fs-factory.h
index c826ef2745..79ec3f7520 100644
--- a/backends/fs/abstract-fs-factory.h
+++ b/backends/fs/abstract-fs-factory.h
@@ -25,6 +25,7 @@
#ifndef ABSTRACT_FILESYSTEM_FACTORY_H
#define ABSTRACT_FILESYSTEM_FACTORY_H
+#include "common/stdafx.h"
#include "common/str.h"
#include "backends/fs/abstract-fs.h"
@@ -68,6 +69,13 @@ public:
* On Windows, it will be a special node which "contains" all drives (C:, D:, E:).
*/
virtual AbstractFilesystemNode *makeRootFileNode() const = 0;
+
+
+ /**
+ * Meta-factory method which returns a concrete AbstractFilesystemFactory
+ * instance depending on the current architecture.
+ */
+ static AbstractFilesystemFactory *makeFSFactory();
};
#endif /*ABSTRACT_FILESYSTEM_FACTORY_H*/
diff --git a/backends/fs/dc/dc-fs.cpp b/backends/fs/dc/dc-fs.cpp
index bae13d37e7..0b204dc309 100644
--- a/backends/fs/dc/dc-fs.cpp
+++ b/backends/fs/dc/dc-fs.cpp
@@ -81,7 +81,7 @@ public:
* @param str String containing the path.
* @return Pointer to the first char of the last component inside str.
*/
-static const char *lastPathComponent(const Common::String &str) {
+const char *lastPathComponent(const Common::String &str) {
const char *start = str.c_str();
const char *cur = start + str.size() - 2;
diff --git a/backends/fs/gp32/gp32-fs.cpp b/backends/fs/gp32/gp32-fs.cpp
index a4af5d4fbe..1585bd22f1 100644
--- a/backends/fs/gp32/gp32-fs.cpp
+++ b/backends/fs/gp32/gp32-fs.cpp
@@ -82,7 +82,7 @@ const char gpRootPath[] = "gp:\\";
* @param str Path to obtain the last component from.
* @return Pointer to the first char of the last component inside str.
*/
-static const char *lastPathComponent(const Common::String &str) {
+const char *lastPathComponent(const Common::String &str) {
const char *start = str.c_str();
const char *cur = start + str.size() - 2;
@@ -214,7 +214,7 @@ bool GP32FilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, bool
//listDir += "/";
while (GpDirEnumList(listDir.c_str(), startIdx++, 1, &dirEntry, &read) == SM_OK) {
- if (dirEntry.name[0] == '.')
+da if (dirEntry.name[0] == '.')
continue;
entry._displayName = dirEntry.name;
diff --git a/backends/fs/palmos/palmos-fs.cpp b/backends/fs/palmos/palmos-fs.cpp
index 508dff428b..d44958254d 100644
--- a/backends/fs/palmos/palmos-fs.cpp
+++ b/backends/fs/palmos/palmos-fs.cpp
@@ -92,7 +92,7 @@ private:
* @param str String containing the path.
* @return Pointer to the first char of the last component inside str.
*/
-static const char *lastPathComponent(const Common::String &str) {
+const char *lastPathComponent(const Common::String &str) {
const char *start = str.c_str();
const char *cur = start + str.size() - 2;
diff --git a/backends/fs/posix/posix-fs.cpp b/backends/fs/posix/posix-fs.cpp
index 2e01c551d9..5871d1ef42 100644
--- a/backends/fs/posix/posix-fs.cpp
+++ b/backends/fs/posix/posix-fs.cpp
@@ -91,7 +91,7 @@ private:
* @param str String containing the path.
* @return Pointer to the first char of the last component inside str.
*/
-static const char *lastPathComponent(const Common::String &str) {
+const char *lastPathComponent(const Common::String &str) {
const char *start = str.c_str();
const char *cur = start + str.size() - 2;
diff --git a/backends/fs/psp/psp_fs.cpp b/backends/fs/psp/psp_fs.cpp
index 019b13e9e6..04f24a98cc 100644
--- a/backends/fs/psp/psp_fs.cpp
+++ b/backends/fs/psp/psp_fs.cpp
@@ -82,7 +82,7 @@ public:
* @param str String containing the path.
* @return Pointer to the first char of the last component inside str.
*/
-static const char *lastPathComponent(const Common::String &str) {
+const char *lastPathComponent(const Common::String &str) {
const char *start = str.c_str();
const char *cur = start + str.size() - 2;
diff --git a/backends/fs/symbian/symbian-fs.cpp b/backends/fs/symbian/symbian-fs.cpp
index d3b39f192c..e8a9553927 100644
--- a/backends/fs/symbian/symbian-fs.cpp
+++ b/backends/fs/symbian/symbian-fs.cpp
@@ -83,7 +83,7 @@ public:
* @param str Path to obtain the last component from.
* @return Pointer to the first char of the last component inside str.
*/
-static const char *lastPathComponent(const Common::String &str) {
+const char *lastPathComponent(const Common::String &str) {
const char *start = str.c_str();
const char *cur = start + str.size() - 2;
diff --git a/backends/fs/windows/windows-fs.cpp b/backends/fs/windows/windows-fs.cpp
index 995264f110..da9fc59c35 100644
--- a/backends/fs/windows/windows-fs.cpp
+++ b/backends/fs/windows/windows-fs.cpp
@@ -124,7 +124,7 @@ private:
* @param str Path to obtain the last component from.
* @return Pointer to the first char of the last component inside str.
*/
-static const char *lastPathComponent(const Common::String &str) {
+const char *lastPathComponent(const Common::String &str) {
const char *start = str.c_str();
const char *cur = start + str.size() - 2;
diff --git a/backends/module.mk b/backends/module.mk
index 1803a6b945..1eaeb953a9 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -2,11 +2,7 @@ MODULE := backends
MODULE_OBJS := \
events/default/default-events.o \
- fs/posix/posix-fs.o \
- fs/morphos/abox-fs.o \
- fs/windows/windows-fs.o \
- fs/amigaos4/amigaos4-fs.o \
- fs/dc/dc-fs.o \
+ fs/abstract-fs-factory.o \
midi/alsa.o \
midi/coreaudio.o \
midi/coremidi.o \
diff --git a/common/fs.cpp b/common/fs.cpp
index 86cdfe41d6..d395686be3 100644
--- a/common/fs.cpp
+++ b/common/fs.cpp
@@ -25,9 +25,9 @@
#include "common/stdafx.h"
#include "common/util.h"
#include "backends/fs/abstract-fs.h"
-#include "backends/fs/fs-factory-maker.cpp"
+#include "backends/fs/abstract-fs-factory.h"
-/*
+/**
* Simple DOS-style pattern matching function (understands * and ? like used in DOS).
* Taken from exult/files/listfiles.cc
*/
@@ -82,7 +82,7 @@ FilesystemNode::FilesystemNode(const FilesystemNode &node) {
}
FilesystemNode::FilesystemNode(const Common::String &p) {
- AbstractFilesystemFactory *factory = makeFSFactory();
+ AbstractFilesystemFactory *factory = AbstractFilesystemFactory::makeFSFactory();
if (p.empty() || p == ".")
_realNode = factory->makeCurrentDirectoryFileNode();
@@ -234,6 +234,9 @@ bool FilesystemNode::lookupFile(FSList &results, FilesystemNode &dir, Common::St
return ((matches > 0) ? true : false);
}
+// HACK HACK HACK
+extern const char *lastPathComponent(const Common::String &str);
+
int FilesystemNode::lookupFileRec(FSList &results, FilesystemNode &dir, Common::String &filename, bool hidden, bool exhaustive) const
{
FSList entries;