aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
Diffstat (limited to 'backends')
-rw-r--r--backends/fs/abstract-fs.h17
-rw-r--r--backends/fs/amigaos4/amigaos4-fs.cpp32
-rw-r--r--backends/fs/ds/ds-fs-factory.cpp2
-rw-r--r--backends/fs/ds/ds-fs-factory.h4
-rw-r--r--backends/fs/ds/ds-fs.cpp34
-rw-r--r--backends/fs/ds/ds-fs.h8
-rw-r--r--backends/fs/palmos/palmos-fs-factory.cpp2
-rw-r--r--backends/fs/palmos/palmos-fs-factory.h4
-rw-r--r--backends/fs/palmos/palmos-fs.cpp30
-rw-r--r--backends/fs/posix/posix-fs.cpp4
-rw-r--r--backends/fs/ps2/ps2-fs-factory.cpp2
-rw-r--r--backends/fs/ps2/ps2-fs-factory.h4
-rw-r--r--backends/fs/ps2/ps2-fs.cpp40
-rw-r--r--backends/fs/psp/psp-fs-factory.cpp2
-rw-r--r--backends/fs/psp/psp-fs-factory.h4
-rw-r--r--backends/fs/psp/psp-fs.cpp24
-rw-r--r--backends/fs/symbian/symbian-fs.cpp30
-rw-r--r--backends/fs/wii/wii-fs-factory.cpp2
-rw-r--r--backends/fs/wii/wii-fs-factory.h4
-rw-r--r--backends/fs/wii/wii-fs.cpp30
-rw-r--r--backends/fs/windows/windows-fs.cpp34
-rw-r--r--backends/platform/dc/dc-fs.cpp28
-rw-r--r--backends/platform/dc/selector.cpp12
-rw-r--r--backends/platform/iphone/osys_iphone.cpp6
-rw-r--r--backends/platform/sdl/sdl.cpp4
-rw-r--r--backends/platform/wince/CELauncherDialog.cpp12
-rw-r--r--backends/platform/wince/CELauncherDialog.h2
-rw-r--r--backends/saves/default/default-saves.cpp20
-rw-r--r--backends/saves/default/default-saves.h2
29 files changed, 192 insertions, 207 deletions
diff --git a/backends/fs/abstract-fs.h b/backends/fs/abstract-fs.h
index 73fae24373..a2a1aa8ac3 100644
--- a/backends/fs/abstract-fs.h
+++ b/backends/fs/abstract-fs.h
@@ -43,22 +43,21 @@ typedef Common::Array<AbstractFilesystemNode *> AbstractFSList;
*/
class AbstractFilesystemNode {
protected:
- friend class FilesystemNode;
- typedef Common::String String;
- typedef FilesystemNode::ListMode ListMode;
+ friend class Common::FilesystemNode;
+ typedef Common::FilesystemNode::ListMode ListMode;
/**
- * Returns the child node with the given name. If no child with this name
- * exists, returns 0. When called on a non-directory node, it should
- * handle this gracefully by returning 0.
+ * Returns the child node with the given name. When called on a non-directory
+ * node, it should handle this gracefully by returning 0.
+ * When called with a name not matching any of the files/dirs contained in this
+ * directory, a valid node shold be returned, which returns 'false' upon calling
+ * the exists() method. The idea is that this node can then still can be used to
+ * create a new file via the openForWriting() method.
*
* Example:
* Calling getChild() for a node with path "/foo/bar" using name="file.txt",
* would produce a new node with "/foo/bar/file.txt" as path.
*
- * @note This function will append a separator char (\ or /) to the end of the
- * path if needed.
- *
* @note Handling calls on non-dir nodes gracefully makes it possible to
* switch to a lazy type detection scheme in the future.
*
diff --git a/backends/fs/amigaos4/amigaos4-fs.cpp b/backends/fs/amigaos4/amigaos4-fs.cpp
index 5bf57ddf34..4f6bce39b3 100644
--- a/backends/fs/amigaos4/amigaos4-fs.cpp
+++ b/backends/fs/amigaos4/amigaos4-fs.cpp
@@ -52,8 +52,8 @@ const uint32 kExAllBufferSize = 40960; // TODO: is this okay for sure?
class AmigaOSFilesystemNode : public AbstractFilesystemNode {
protected:
BPTR _pFileLock;
- String _sDisplayName;
- String _sPath;
+ Common::String _sDisplayName;
+ Common::String _sPath;
bool _bIsDirectory;
bool _bIsValid;
@@ -74,9 +74,9 @@ public:
/**
* Creates a AmigaOSFilesystemNode for a given path.
*
- * @param path String with the path the new node should point to.
+ * @param path Common::String with the path the new node should point to.
*/
- AmigaOSFilesystemNode(const String &p);
+ AmigaOSFilesystemNode(const Common::String &p);
/**
* FIXME: document this constructor.
@@ -96,14 +96,14 @@ public:
virtual ~AmigaOSFilesystemNode();
virtual bool exists() const;
- virtual String getDisplayName() const { return _sDisplayName; };
- virtual String getName() const { return _sDisplayName; };
- virtual String getPath() const { return _sPath; };
+ virtual Common::String getDisplayName() const { return _sDisplayName; };
+ virtual Common::String getName() const { return _sDisplayName; };
+ virtual Common::String getPath() const { return _sPath; };
virtual bool isDirectory() const { return _bIsDirectory; };
virtual bool isReadable() const;
virtual bool isWritable() const;
- virtual AbstractFilesystemNode *getChild(const String &n) const;
+ virtual AbstractFilesystemNode *getChild(const Common::String &n) const;
virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
virtual AbstractFilesystemNode *getParent() const;
@@ -116,7 +116,7 @@ public:
/**
* Returns the last component of a given path.
*
- * @param str String containing the path.
+ * @param str Common::String containing the path.
* @return Pointer to the first char of the last component inside str.
*/
const char *lastPathComponent(const Common::String &str) {
@@ -148,7 +148,7 @@ AmigaOSFilesystemNode::AmigaOSFilesystemNode() {
LEAVE();
}
-AmigaOSFilesystemNode::AmigaOSFilesystemNode(const String &p) {
+AmigaOSFilesystemNode::AmigaOSFilesystemNode(const Common::String &p) {
ENTER();
int len = 0, offset = p.size();
@@ -299,14 +299,14 @@ bool AmigaOSFilesystemNode::exists() const {
return nodeExists;
}
-AbstractFilesystemNode *AmigaOSFilesystemNode::getChild(const String &n) const {
+AbstractFilesystemNode *AmigaOSFilesystemNode::getChild(const Common::String &n) const {
ENTER();
if (!_bIsDirectory) {
debug(6, "Not a directory");
return 0;
}
- String newPath(_sPath);
+ Common::String newPath(_sPath);
if (_sPath.lastChar() != '/')
newPath += '/';
@@ -368,10 +368,10 @@ bool AmigaOSFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b
struct ExAllData *ead = data;
do {
- if ((mode == FilesystemNode::kListAll) ||
- (EAD_IS_DRAWER(ead) && (mode == FilesystemNode::kListDirectoriesOnly)) ||
- (EAD_IS_FILE(ead) && (mode == FilesystemNode::kListFilesOnly))) {
- String full_path = _sPath;
+ if ((mode == Common::FilesystemNode::kListAll) ||
+ (EAD_IS_DRAWER(ead) && (mode == Common::FilesystemNode::kListDirectoriesOnly)) ||
+ (EAD_IS_FILE(ead) && (mode == Common::FilesystemNode::kListFilesOnly))) {
+ Common::String full_path = _sPath;
full_path += (char*)ead->ed_Name;
BPTR lock = IDOS->Lock((STRPTR)full_path.c_str(), SHARED_LOCK);
diff --git a/backends/fs/ds/ds-fs-factory.cpp b/backends/fs/ds/ds-fs-factory.cpp
index 2eae2f2403..5c8c3f45f8 100644
--- a/backends/fs/ds/ds-fs-factory.cpp
+++ b/backends/fs/ds/ds-fs-factory.cpp
@@ -45,7 +45,7 @@ AbstractFilesystemNode *DSFilesystemFactory::makeCurrentDirectoryFileNode() cons
}
}
-AbstractFilesystemNode *DSFilesystemFactory::makeFileNodePath(const String &path) const {
+AbstractFilesystemNode *DSFilesystemFactory::makeFileNodePath(const Common::String &path) const {
if (DS::isGBAMPAvailable()) {
return new DS::GBAMPFileSystemNode(path);
} else {
diff --git a/backends/fs/ds/ds-fs-factory.h b/backends/fs/ds/ds-fs-factory.h
index bff21a309d..67e0076b78 100644
--- a/backends/fs/ds/ds-fs-factory.h
+++ b/backends/fs/ds/ds-fs-factory.h
@@ -35,11 +35,9 @@
*/
class DSFilesystemFactory : public FilesystemFactory, public Common::Singleton<DSFilesystemFactory> {
public:
- typedef Common::String String;
-
virtual AbstractFilesystemNode *makeRootFileNode() const;
virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const;
- virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const;
+ virtual AbstractFilesystemNode *makeFileNodePath(const Common::String &path) const;
protected:
DSFilesystemFactory() {};
diff --git a/backends/fs/ds/ds-fs.cpp b/backends/fs/ds/ds-fs.cpp
index d206941ab9..db6a63cad7 100644
--- a/backends/fs/ds/ds-fs.cpp
+++ b/backends/fs/ds/ds-fs.cpp
@@ -55,7 +55,7 @@ DSFileSystemNode::DSFileSystemNode() {
}
}
-DSFileSystemNode::DSFileSystemNode(const String& path) {
+DSFileSystemNode::DSFileSystemNode(const Common::String& path) {
// consolePrintf("--%s ",path.c_str());
char disp[128];
@@ -70,7 +70,7 @@ DSFileSystemNode::DSFileSystemNode(const String& path) {
strcpy(disp, pathStr + lastSlash + 1);
- _displayName = String(disp);
+ _displayName = Common::String(disp);
_path = path;
// _isValid = true;
// _isDirectory = false;
@@ -98,7 +98,7 @@ DSFileSystemNode::DSFileSystemNode(const String& path) {
// consolePrintf("%s - Found: %d, Dir: %d\n", pathStr, _isValid, _isDirectory);
}
-DSFileSystemNode::DSFileSystemNode(const String& path, bool isDir) {
+DSFileSystemNode::DSFileSystemNode(const Common::String& path, bool isDir) {
// consolePrintf("--%s ",path.c_str());
char disp[128];
@@ -112,7 +112,7 @@ DSFileSystemNode::DSFileSystemNode(const String& path, bool isDir) {
strcpy(disp, pathStr + lastSlash + 1);
- _displayName = String(disp);
+ _displayName = Common::String(disp);
_path = path;
_isValid = true;
_isDirectory = isDir;
@@ -167,10 +167,10 @@ bool DSFileSystemNode::getChildren(AbstractFSList &dirList, ListMode mode, bool
_zipFile->getFileName(n);
// consolePrintf("file: %s\n", n);
- if ( (_zipFile->isDirectory() && ((mode == FilesystemNode::kListDirectoriesOnly) || (mode == FilesystemNode::kListAll)) )
- || (!_zipFile->isDirectory() && ((mode == FilesystemNode::kListFilesOnly) || (mode == FilesystemNode::kListAll)) ) )
+ if ( (_zipFile->isDirectory() && ((mode == Common::FilesystemNode::kListDirectoriesOnly) || (mode == Common::FilesystemNode::kListAll)) )
+ || (!_zipFile->isDirectory() && ((mode == Common::FilesystemNode::kListFilesOnly) || (mode == Common::FilesystemNode::kListAll)) ) )
{
- DSFileSystemNode* dsfsn = new DSFileSystemNode("ds:/" + String(n), _zipFile->isDirectory());
+ DSFileSystemNode* dsfsn = new DSFileSystemNode("ds:/" + Common::String(n), _zipFile->isDirectory());
dsfsn->_isDirectory = _zipFile->isDirectory();
dirList.push_back((dsfsn));
}
@@ -195,7 +195,7 @@ AbstractFilesystemNode* DSFileSystemNode::getParent() const {
}
}
- p = new DSFileSystemNode(String(path, lastSlash));
+ p = new DSFileSystemNode(Common::String(path, lastSlash));
((DSFileSystemNode *) (p))->_isDirectory = true;
} else {
p = new DSFileSystemNode();
@@ -216,7 +216,7 @@ GBAMPFileSystemNode::GBAMPFileSystemNode() {
_path = "mp:/";
}
-GBAMPFileSystemNode::GBAMPFileSystemNode(const String& path) {
+GBAMPFileSystemNode::GBAMPFileSystemNode(const Common::String& path) {
// consolePrintf("'%s'",path.c_str());
char disp[128];
@@ -245,13 +245,13 @@ GBAMPFileSystemNode::GBAMPFileSystemNode(const String& path) {
}
// consolePrintf("Path: %s (%d)\n", check, success);
- _displayName = String(disp);
+ _displayName = Common::String(disp);
_path = path;
_isValid = success == FT_FILE;
_isDirectory = success == FT_DIR;
}
-GBAMPFileSystemNode::GBAMPFileSystemNode(const String& path, bool isDirectory) {
+GBAMPFileSystemNode::GBAMPFileSystemNode(const Common::String& path, bool isDirectory) {
// consolePrintf("'%s'",path.c_str());
char disp[128];
@@ -265,7 +265,7 @@ GBAMPFileSystemNode::GBAMPFileSystemNode(const String& path, bool isDirectory) {
strcpy(disp, pathStr + lastSlash + 1);
- _displayName = String(disp);
+ _displayName = Common::String(disp);
_path = path;
_isValid = true;
_isDirectory = isDirectory;
@@ -313,8 +313,8 @@ bool GBAMPFileSystemNode::getChildren(AbstractFSList& dirList, ListMode mode, bo
while (entryType != TYPE_NO_MORE) {
- if ( ((entryType == TYPE_DIR) && ((mode == FilesystemNode::kListDirectoriesOnly) || (mode == FilesystemNode::kListAll)))
- || ((entryType == TYPE_FILE) && ((mode == FilesystemNode::kListFilesOnly) || (mode == FilesystemNode::kListAll))) ) {
+ if ( ((entryType == TYPE_DIR) && ((mode == Common::FilesystemNode::kListDirectoriesOnly) || (mode == Common::FilesystemNode::kListAll)))
+ || ((entryType == TYPE_FILE) && ((mode == Common::FilesystemNode::kListFilesOnly) || (mode == Common::FilesystemNode::kListAll))) ) {
GBAMPFileSystemNode* dsfsn;
consolePrintf("Fname: %s\n", fname);
@@ -322,9 +322,9 @@ bool GBAMPFileSystemNode::getChildren(AbstractFSList& dirList, ListMode mode, bo
if (strcmp(fname, ".") && strcmp(fname, "..")) {
if (!strcmp(path, "/")) {
- dsfsn = new GBAMPFileSystemNode("mp:" + String(path) + String(fname), entryType == TYPE_DIR);
+ dsfsn = new GBAMPFileSystemNode("mp:" + Common::String(path) + Common::String(fname), entryType == TYPE_DIR);
} else {
- dsfsn = new GBAMPFileSystemNode("mp:" + String(path) + String("/") + String(fname), entryType == TYPE_DIR);
+ dsfsn = new GBAMPFileSystemNode("mp:" + Common::String(path) + Common::String("/") + Common::String(fname), entryType == TYPE_DIR);
}
// dsfsn->_isDirectory = entryType == DIR;
@@ -358,7 +358,7 @@ AbstractFilesystemNode* GBAMPFileSystemNode::getParent() const {
}
}
- p = new GBAMPFileSystemNode(String(path, lastSlash));
+ p = new GBAMPFileSystemNode(Common::String(path, lastSlash));
p->_isDirectory = true;
} else {
p = new GBAMPFileSystemNode();
diff --git a/backends/fs/ds/ds-fs.h b/backends/fs/ds/ds-fs.h
index 9ac453aca9..2856ec4903 100644
--- a/backends/fs/ds/ds-fs.h
+++ b/backends/fs/ds/ds-fs.h
@@ -41,8 +41,6 @@ namespace DS {
*/
class DSFileSystemNode : public AbstractFilesystemNode {
protected:
- typedef class Common::String String;
-
static ZipFile* _zipFile;
String _displayName;
@@ -89,7 +87,7 @@ public:
*/
virtual AbstractFilesystemNode *clone() const { return new DSFileSystemNode(this); }
virtual AbstractFilesystemNode *getChild(const Common::String& name) const;
- virtual bool getChildren(AbstractFSList &list, ListMode mode = FilesystemNode::kListDirectoriesOnly, bool hidden = false) const;
+ virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
virtual AbstractFilesystemNode *getParent() const;
/**
@@ -107,8 +105,6 @@ public:
*/
class GBAMPFileSystemNode : public AbstractFilesystemNode {
protected:
- typedef class Common::String String;
-
String _displayName;
String _path;
bool _isDirectory;
@@ -153,7 +149,7 @@ public:
*/
virtual AbstractFilesystemNode *clone() const { return new GBAMPFileSystemNode(this); }
virtual AbstractFilesystemNode *getChild(const Common::String& name) const;
- virtual bool getChildren(AbstractFSList &list, ListMode mode = FilesystemNode::kListDirectoriesOnly, bool hidden = false) const;
+ virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
virtual AbstractFilesystemNode *getParent() const;
};
diff --git a/backends/fs/palmos/palmos-fs-factory.cpp b/backends/fs/palmos/palmos-fs-factory.cpp
index 8699a9788b..bbc1639897 100644
--- a/backends/fs/palmos/palmos-fs-factory.cpp
+++ b/backends/fs/palmos/palmos-fs-factory.cpp
@@ -36,7 +36,7 @@ AbstractFilesystemNode *PalmOSFilesystemFactory::makeCurrentDirectoryFileNode()
return new PalmOSFilesystemNode();
}
-AbstractFilesystemNode *PalmOSFilesystemFactory::makeFileNodePath(const String &path) const {
+AbstractFilesystemNode *PalmOSFilesystemFactory::makeFileNodePath(const Common::String &path) const {
return new PalmOSFilesystemNode(path);
}
#endif
diff --git a/backends/fs/palmos/palmos-fs-factory.h b/backends/fs/palmos/palmos-fs-factory.h
index 3ea8b5fe47..f778aa89ef 100644
--- a/backends/fs/palmos/palmos-fs-factory.h
+++ b/backends/fs/palmos/palmos-fs-factory.h
@@ -35,11 +35,9 @@
*/
class PalmOSFilesystemFactory : public FilesystemFactory, public Common::Singleton<PalmOSFilesystemFactory> {
public:
- typedef Common::String String;
-
virtual AbstractFilesystemNode *makeRootFileNode() const;
virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const;
- virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const;
+ virtual AbstractFilesystemNode *makeFileNodePath(const Common::String &path) const;
protected:
PalmOSFilesystemFactory() {};
diff --git a/backends/fs/palmos/palmos-fs.cpp b/backends/fs/palmos/palmos-fs.cpp
index 69d9f350f5..522d7682cc 100644
--- a/backends/fs/palmos/palmos-fs.cpp
+++ b/backends/fs/palmos/palmos-fs.cpp
@@ -36,8 +36,8 @@
*/
class PalmOSFilesystemNode : public AbstractFilesystemNode {
protected:
- String _displayName;
- String _path;
+ Common::String _displayName;
+ Common::String _path;
bool _isDirectory;
bool _isValid;
bool _isPseudoRoot;
@@ -51,19 +51,19 @@ public:
/**
* Creates a POSIXFilesystemNode for a given path.
*
- * @param path String with the path the new node should point to.
+ * @param path Common::String with the path the new node should point to.
*/
- PalmOSFilesystemNode(const String &p);
+ PalmOSFilesystemNode(const Common::String &p);
virtual bool exists() const { return _isValid; }
- virtual String getDisplayName() const { return _displayName; }
- virtual String getName() const { return _displayName; }
- virtual String getPath() const { return _path; }
+ virtual Common::String getDisplayName() const { return _displayName; }
+ virtual Common::String getName() const { return _displayName; }
+ virtual Common::String getPath() const { return _path; }
virtual bool isDirectory() const { return _isDirectory; }
virtual bool isReadable() const { return true; } //FIXME: this is just a stub
virtual bool isWritable() const { return true; } //FIXME: this is just a stub
- virtual AbstractFilesystemNode *getChild(const String &n) const;
+ virtual AbstractFilesystemNode *getChild(const Common::String &n) const;
virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
virtual AbstractFilesystemNode *getParent() const;
@@ -74,7 +74,7 @@ private:
*
* @param list List to put the file entry node in.
* @param mode Mode to use while adding the file entry to the list.
- * @param base String with the directory being listed.
+ * @param base Common::String with the directory being listed.
* @param find_data Describes a file that the FindFirstFile, FindFirstFileEx, or FindNextFile functions find.
*/
static void addFile(AbstractFSList &list, ListMode mode, const Char *base, FileInfoType* find_data);
@@ -86,8 +86,8 @@ void PalmOSFilesystemNode::addFile(AbstractFSList &list, ListMode mode, const ch
isDir = (find_data->attributes & vfsFileAttrDirectory);
- if ((!isDir && mode == FilesystemNode::kListDirectoriesOnly) ||
- (isDir && mode == FilesystemNode::kListFilesOnly))
+ if ((!isDir && mode == Common::FilesystemNode::kListDirectoriesOnly) ||
+ (isDir && mode == Common::FilesystemNode::kListFilesOnly))
return;
entry._isDirectory = isDir;
@@ -112,7 +112,7 @@ PalmOSFilesystemNode::PalmOSFilesystemNode() {
_isPseudoRoot = false;
}
-PalmOSFilesystemNode::PalmOSFilesystemNode(const String &p) {
+PalmOSFilesystemNode::PalmOSFilesystemNode(const Common::String &p) {
_path = p;
_displayName = lastPathComponent(_path, '/');
@@ -135,10 +135,10 @@ PalmOSFilesystemNode::PalmOSFilesystemNode(const String &p) {
_isPseudoRoot = false;
}
-AbstractFilesystemNode *PalmOSFilesystemNode::getChild(const String &n) const {
+AbstractFilesystemNode *PalmOSFilesystemNode::getChild(const Common::String &n) const {
assert(_isDirectory);
- String newPath(_path);
+ Common::String newPath(_path);
if (_path.lastChar() != '/')
newPath += '/';
newPath += n;
@@ -194,7 +194,7 @@ AbstractFilesystemNode *PalmOSFilesystemNode::getParent() const {
const char *end = lastPathComponent(_path, '/');
p = new PalmOSFilesystemNode();
- p->_path = String(start, end - start);
+ p->_path = Common::String(start, end - start);
p->_isValid = true;
p->_isDirectory = true;
p->_displayName = lastPathComponent(p->_path, '/');
diff --git a/backends/fs/posix/posix-fs.cpp b/backends/fs/posix/posix-fs.cpp
index 44723c8e6e..992d54456b 100644
--- a/backends/fs/posix/posix-fs.cpp
+++ b/backends/fs/posix/posix-fs.cpp
@@ -202,8 +202,8 @@ bool POSIXFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, boo
continue;
// Honor the chosen mode
- if ((mode == FilesystemNode::kListFilesOnly && entry._isDirectory) ||
- (mode == FilesystemNode::kListDirectoriesOnly && !entry._isDirectory))
+ if ((mode == Common::FilesystemNode::kListFilesOnly && entry._isDirectory) ||
+ (mode == Common::FilesystemNode::kListDirectoriesOnly && !entry._isDirectory))
continue;
myList.push_back(new POSIXFilesystemNode(entry));
diff --git a/backends/fs/ps2/ps2-fs-factory.cpp b/backends/fs/ps2/ps2-fs-factory.cpp
index ce3b4a5eaf..e96671ee0a 100644
--- a/backends/fs/ps2/ps2-fs-factory.cpp
+++ b/backends/fs/ps2/ps2-fs-factory.cpp
@@ -36,7 +36,7 @@ AbstractFilesystemNode *Ps2FilesystemFactory::makeCurrentDirectoryFileNode() con
return new Ps2FilesystemNode();
}
-AbstractFilesystemNode *Ps2FilesystemFactory::makeFileNodePath(const String &path) const {
+AbstractFilesystemNode *Ps2FilesystemFactory::makeFileNodePath(const Common::String &path) const {
// return new Ps2FilesystemNode(path);
Ps2FilesystemNode *nf = new Ps2FilesystemNode(path, true);
diff --git a/backends/fs/ps2/ps2-fs-factory.h b/backends/fs/ps2/ps2-fs-factory.h
index 416024c905..432cf467c3 100644
--- a/backends/fs/ps2/ps2-fs-factory.h
+++ b/backends/fs/ps2/ps2-fs-factory.h
@@ -35,11 +35,9 @@
*/
class Ps2FilesystemFactory : public FilesystemFactory, public Common::Singleton<Ps2FilesystemFactory> {
public:
- typedef Common::String String;
-
virtual AbstractFilesystemNode *makeRootFileNode() const;
virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const;
- virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const;
+ virtual AbstractFilesystemNode *makeFileNodePath(const Common::String &path) const;
protected:
Ps2FilesystemFactory() {};
diff --git a/backends/fs/ps2/ps2-fs.cpp b/backends/fs/ps2/ps2-fs.cpp
index b0f1ddbafb..65ea86826c 100644
--- a/backends/fs/ps2/ps2-fs.cpp
+++ b/backends/fs/ps2/ps2-fs.cpp
@@ -47,8 +47,8 @@ class Ps2FilesystemNode : public AbstractFilesystemNode {
friend class Ps2FilesystemFactory;
protected:
- String _displayName;
- String _path;
+ Common::String _displayName;
+ Common::String _path;
bool _isDirectory;
bool _isRoot;
@@ -65,10 +65,10 @@ public:
/**
* Creates a PS2FilesystemNode for a given path.
*
- * @param path String with the path the new node should point to.
+ * @param path Common::String with the path the new node should point to.
*/
- Ps2FilesystemNode(const String &path);
- Ps2FilesystemNode(const String &path, bool verify);
+ Ps2FilesystemNode(const Common::String &path);
+ Ps2FilesystemNode(const Common::String &path, bool verify);
/**
* Copy constructor.
@@ -77,9 +77,9 @@ public:
virtual bool exists(void) const;
- virtual String getDisplayName() const { return _displayName; }
- virtual String getName() const { return _displayName; }
- virtual String getPath() const { return _path; }
+ virtual Common::String getDisplayName() const { return _displayName; }
+ virtual Common::String getName() const { return _displayName; }
+ virtual Common::String getPath() const { return _path; }
virtual bool isDirectory() const {
return _isDirectory;
@@ -95,7 +95,7 @@ public:
}
virtual AbstractFilesystemNode *clone() const { return new Ps2FilesystemNode(this); }
- virtual AbstractFilesystemNode *getChild(const String &n) const;
+ virtual AbstractFilesystemNode *getChild(const Common::String &n) const;
virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
virtual AbstractFilesystemNode *getParent() const;
};
@@ -107,12 +107,12 @@ Ps2FilesystemNode::Ps2FilesystemNode() {
_path = "";
}
-Ps2FilesystemNode::Ps2FilesystemNode(const String &path) {
+Ps2FilesystemNode::Ps2FilesystemNode(const Common::String &path) {
_path = path;
_isDirectory = true;
if (strcmp(path.c_str(), "") == 0) {
_isRoot = true;
- _displayName = String("PlayStation 2");
+ _displayName = Common::String("PlayStation 2");
} else {
_isRoot = false;
const char *dsplName = NULL, *pos = path.c_str();
@@ -120,18 +120,18 @@ Ps2FilesystemNode::Ps2FilesystemNode(const String &path) {
if (*pos++ == '/')
dsplName = pos;
if (dsplName)
- _displayName = String(dsplName);
+ _displayName = Common::String(dsplName);
else
_displayName = getDeviceDescription(path.c_str());
}
}
-Ps2FilesystemNode::Ps2FilesystemNode(const String &path, bool verify) {
+Ps2FilesystemNode::Ps2FilesystemNode(const Common::String &path, bool verify) {
_path = path;
if (strcmp(path.c_str(), "") == 0) {
_isRoot = true; /* root is always a dir*/
- _displayName = String("PlayStation 2");
+ _displayName = Common::String("PlayStation 2");
_isDirectory = true;
} else {
_isRoot = false;
@@ -141,7 +141,7 @@ Ps2FilesystemNode::Ps2FilesystemNode(const String &path, bool verify) {
dsplName = pos;
if (dsplName) {
- _displayName = String(dsplName);
+ _displayName = Common::String(dsplName);
if (verify)
_isDirectory = getDirectoryFlag(path.c_str());
else
@@ -206,7 +206,7 @@ bool Ps2FilesystemNode::getDirectoryFlag(const char *path) {
return false;
}
-AbstractFilesystemNode *Ps2FilesystemNode::getChild(const String &n) const {
+AbstractFilesystemNode *Ps2FilesystemNode::getChild(const Common::String &n) const {
if (!_isDirectory)
return NULL;
@@ -284,9 +284,9 @@ bool Ps2FilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hi
while ((dreadRes = fio.dread(fd, &dirent)) > 0) {
if (dirent.name[0] == '.')
continue; // ignore '.' and '..'
- if (((mode == FilesystemNode::kListDirectoriesOnly) && (dirent.stat.mode & FIO_S_IFDIR)) ||
- ((mode == FilesystemNode::kListFilesOnly) && !(dirent.stat.mode & FIO_S_IFDIR)) ||
- (mode == FilesystemNode::kListAll)) {
+ if (((mode == Common::FilesystemNode::kListDirectoriesOnly) && (dirent.stat.mode & FIO_S_IFDIR)) ||
+ ((mode == Common::FilesystemNode::kListFilesOnly) && !(dirent.stat.mode & FIO_S_IFDIR)) ||
+ (mode == Common::FilesystemNode::kListAll)) {
dirEntry._isDirectory = (bool)(dirent.stat.mode & FIO_S_IFDIR);
dirEntry._isRoot = false;
@@ -322,7 +322,7 @@ AbstractFilesystemNode *Ps2FilesystemNode::getParent() const {
}
if (slash)
- return new Ps2FilesystemNode(String(_path.c_str(), slash - _path.c_str()));
+ return new Ps2FilesystemNode(Common::String(_path.c_str(), slash - _path.c_str()));
else
return new Ps2FilesystemNode();
}
diff --git a/backends/fs/psp/psp-fs-factory.cpp b/backends/fs/psp/psp-fs-factory.cpp
index 87f0e0f587..a38462f02a 100644
--- a/backends/fs/psp/psp-fs-factory.cpp
+++ b/backends/fs/psp/psp-fs-factory.cpp
@@ -36,7 +36,7 @@ AbstractFilesystemNode *PSPFilesystemFactory::makeCurrentDirectoryFileNode() con
return new PSPFilesystemNode();
}
-AbstractFilesystemNode *PSPFilesystemFactory::makeFileNodePath(const String &path) const {
+AbstractFilesystemNode *PSPFilesystemFactory::makeFileNodePath(const Common::String &path) const {
return new PSPFilesystemNode(path, true);
}
#endif
diff --git a/backends/fs/psp/psp-fs-factory.h b/backends/fs/psp/psp-fs-factory.h
index ffa934755f..abf03d288e 100644
--- a/backends/fs/psp/psp-fs-factory.h
+++ b/backends/fs/psp/psp-fs-factory.h
@@ -35,11 +35,9 @@
*/
class PSPFilesystemFactory : public FilesystemFactory, public Common::Singleton<PSPFilesystemFactory> {
public:
- typedef Common::String String;
-
virtual AbstractFilesystemNode *makeRootFileNode() const;
virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const;
- virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const;
+ virtual AbstractFilesystemNode *makeFileNodePath(const Common::String &path) const;
protected:
PSPFilesystemFactory() {};
diff --git a/backends/fs/psp/psp-fs.cpp b/backends/fs/psp/psp-fs.cpp
index aa3e253782..e5d66d7350 100644
--- a/backends/fs/psp/psp-fs.cpp
+++ b/backends/fs/psp/psp-fs.cpp
@@ -39,8 +39,8 @@
*/
class PSPFilesystemNode : public AbstractFilesystemNode {
protected:
- String _displayName;
- String _path;
+ Common::String _displayName;
+ Common::String _path;
bool _isDirectory;
bool _isValid;
@@ -53,20 +53,20 @@ public:
/**
* Creates a PSPFilesystemNode for a given path.
*
- * @param path String with the path the new node should point to.
+ * @param path Common::String with the path the new node should point to.
* @param verify true if the isValid and isDirectory flags should be verified during the construction.
*/
PSPFilesystemNode(const Common::String &p, bool verify);
virtual bool exists() const { return access(_path.c_str(), F_OK) == 0; }
- virtual String getDisplayName() const { return _displayName; }
- virtual String getName() const { return _displayName; }
- virtual String getPath() const { return _path; }
+ virtual Common::String getDisplayName() const { return _displayName; }
+ virtual Common::String getName() const { return _displayName; }
+ virtual Common::String getPath() const { return _path; }
virtual bool isDirectory() const { return _isDirectory; }
virtual bool isReadable() const { return access(_path.c_str(), R_OK) == 0; }
virtual bool isWritable() const { return access(_path.c_str(), W_OK) == 0; }
- virtual AbstractFilesystemNode *getChild(const String &n) const;
+ virtual AbstractFilesystemNode *getChild(const Common::String &n) const;
virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
virtual AbstractFilesystemNode *getParent() const;
};
@@ -93,12 +93,12 @@ PSPFilesystemNode::PSPFilesystemNode(const Common::String &p, bool verify) {
}
}
-AbstractFilesystemNode *PSPFilesystemNode::getChild(const String &n) const {
+AbstractFilesystemNode *PSPFilesystemNode::getChild(const Common::String &n) const {
// FIXME: Pretty lame implementation! We do no error checking to speak
// of, do not check if this is a special node, etc.
assert(_isDirectory);
- String newPath(_path);
+ Common::String newPath(_path);
if (_path.lastChar() != '/')
newPath += '/';
newPath += n;
@@ -133,8 +133,8 @@ bool PSPFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, bool
entry._path += "/";
// Honor the chosen mode
- if ((mode == FilesystemNode::kListFilesOnly && entry._isDirectory) ||
- (mode == FilesystemNode::kListDirectoriesOnly && !entry._isDirectory))
+ if ((mode == Common::FilesystemNode::kListFilesOnly && entry._isDirectory) ||
+ (mode == Common::FilesystemNode::kListDirectoriesOnly && !entry._isDirectory))
continue;
myList.push_back(new PSPFilesystemNode(entry));
@@ -154,7 +154,7 @@ AbstractFilesystemNode *PSPFilesystemNode::getParent() const {
const char *start = _path.c_str();
const char *end = lastPathComponent(_path, '/');
- return new PSPFilesystemNode(String(start, end - start), false);
+ return new PSPFilesystemNode(Common::String(start, end - start), false);
}
#endif //#ifdef __PSP__
diff --git a/backends/fs/symbian/symbian-fs.cpp b/backends/fs/symbian/symbian-fs.cpp
index af963dda0c..a59f06b9eb 100644
--- a/backends/fs/symbian/symbian-fs.cpp
+++ b/backends/fs/symbian/symbian-fs.cpp
@@ -38,8 +38,8 @@
*/
class SymbianFilesystemNode : public AbstractFilesystemNode {
protected:
- String _displayName;
- String _path;
+ Common::String _displayName;
+ Common::String _path;
bool _isDirectory;
bool _isValid;
bool _isPseudoRoot;
@@ -55,9 +55,9 @@ public:
/**
* Creates a SymbianFilesystemNode for a given path.
*
- * @param path String with the path the new node should point to.
+ * @param path Common::String with the path the new node should point to.
*/
- SymbianFilesystemNode(const String &path);
+ SymbianFilesystemNode(const Common::String &path);
virtual bool exists() const {
TFileName fname;
@@ -66,14 +66,14 @@ public:
TBool fileExists = BaflUtils::FileExists(static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession(), fname);
return fileExists;
}
- virtual String getDisplayName() const { return _displayName; }
- virtual String getName() const { return _displayName; }
- virtual String getPath() const { return _path; }
+ virtual Common::String getDisplayName() const { return _displayName; }
+ virtual Common::String getName() const { return _displayName; }
+ virtual Common::String getPath() const { return _path; }
virtual bool isDirectory() const { return _isDirectory; }
virtual bool isReadable() const { return access(_path.c_str(), R_OK) == 0; } //FIXME: this is just a stub
virtual bool isWritable() const { return access(_path.c_str(), W_OK) == 0; } //FIXME: this is just a stub
- virtual AbstractFilesystemNode *getChild(const String &n) const;
+ virtual AbstractFilesystemNode *getChild(const Common::String &n) const;
virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
virtual AbstractFilesystemNode *getParent() const;
};
@@ -81,7 +81,7 @@ public:
/**
* Fixes the path by changing all slashes to backslashes.
*
- * @param path String with the path to be fixed.
+ * @param path Common::String with the path to be fixed.
*/
static void fixFilePath(Common::String& aPath){
TInt len = aPath.size();
@@ -102,7 +102,7 @@ SymbianFilesystemNode::SymbianFilesystemNode(bool aIsRoot) {
}
-SymbianFilesystemNode::SymbianFilesystemNode(const String &path) {
+SymbianFilesystemNode::SymbianFilesystemNode(const Common::String &path) {
if (path.size() == 0)
_isPseudoRoot = true;
else
@@ -128,9 +128,9 @@ SymbianFilesystemNode::SymbianFilesystemNode(const String &path) {
}
}
-AbstractFilesystemNode *SymbianFilesystemNode::getChild(const String &n) const {
+AbstractFilesystemNode *SymbianFilesystemNode::getChild(const Common::String &n) const {
assert(_isDirectory);
- String newPath(_path);
+ Common::String newPath(_path);
if (_path.lastChar() != '\\')
newPath += '\\';
@@ -210,8 +210,8 @@ bool SymbianFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b
entry._isDirectory = fileentry.IsDir();
// Honor the chosen mode
- if ((mode == FilesystemNode::kListFilesOnly && entry._isDirectory) ||
- (mode == FilesystemNode::kListDirectoriesOnly && !entry._isDirectory))
+ if ((mode == Common::FilesystemNode::kListFilesOnly && entry._isDirectory) ||
+ (mode == Common::FilesystemNode::kListDirectoriesOnly && !entry._isDirectory))
continue;
if (entry._isDirectory)
@@ -235,7 +235,7 @@ AbstractFilesystemNode *SymbianFilesystemNode::getParent() const {
const char *start = _path.c_str();
const char *end = lastPathComponent(_path, '\\');
- p->_path = String(start, end - start);
+ p->_path = Common::String(start, end - start);
p->_isValid = true;
p->_isDirectory = true;
p->_displayName = lastPathComponent(p->_path, '\\');
diff --git a/backends/fs/wii/wii-fs-factory.cpp b/backends/fs/wii/wii-fs-factory.cpp
index 9839858dd5..69086a95f1 100644
--- a/backends/fs/wii/wii-fs-factory.cpp
+++ b/backends/fs/wii/wii-fs-factory.cpp
@@ -42,7 +42,7 @@ AbstractFilesystemNode *WiiFilesystemFactory::makeCurrentDirectoryFileNode() con
return new WiiFilesystemNode();
}
-AbstractFilesystemNode *WiiFilesystemFactory::makeFileNodePath(const String &path) const {
+AbstractFilesystemNode *WiiFilesystemFactory::makeFileNodePath(const Common::String &path) const {
return new WiiFilesystemNode(path, true);
}
#endif
diff --git a/backends/fs/wii/wii-fs-factory.h b/backends/fs/wii/wii-fs-factory.h
index 24badee330..36867a392c 100644
--- a/backends/fs/wii/wii-fs-factory.h
+++ b/backends/fs/wii/wii-fs-factory.h
@@ -33,11 +33,9 @@
*/
class WiiFilesystemFactory : public FilesystemFactory, public Common::Singleton<WiiFilesystemFactory> {
public:
- typedef Common::String String;
-
virtual AbstractFilesystemNode *makeRootFileNode() const;
virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const;
- virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const;
+ virtual AbstractFilesystemNode *makeFileNodePath(const Common::String &path) const;
protected:
WiiFilesystemFactory() {};
diff --git a/backends/fs/wii/wii-fs.cpp b/backends/fs/wii/wii-fs.cpp
index 4272ffb380..0d489d3a99 100644
--- a/backends/fs/wii/wii-fs.cpp
+++ b/backends/fs/wii/wii-fs.cpp
@@ -37,8 +37,8 @@
*/
class WiiFilesystemNode : public AbstractFilesystemNode {
protected:
- String _displayName;
- String _path;
+ Common::String _displayName;
+ Common::String _path;
bool _isDirectory, _isReadable, _isWritable;
public:
@@ -50,20 +50,20 @@ public:
/**
* Creates a WiiFilesystemNode for a given path.
*
- * @param path String with the path the new node should point to.
+ * @param path Common::String with the path the new node should point to.
* @param verify true if the isValid and isDirectory flags should be verified during the construction.
*/
- WiiFilesystemNode(const String &path, bool verify);
+ WiiFilesystemNode(const Common::String &path, bool verify);
virtual bool exists() const;
- virtual String getDisplayName() const { return _displayName; }
- virtual String getName() const { return _displayName; }
- virtual String getPath() const { return _path; }
+ virtual Common::String getDisplayName() const { return _displayName; }
+ virtual Common::String getName() const { return _displayName; }
+ virtual Common::String getPath() const { return _path; }
virtual bool isDirectory() const { return _isDirectory; }
virtual bool isReadable() const { return _isReadable; }
virtual bool isWritable() const { return _isWritable; }
- virtual AbstractFilesystemNode *getChild(const String &n) const;
+ virtual AbstractFilesystemNode *getChild(const Common::String &n) const;
virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
virtual AbstractFilesystemNode *getParent() const;
@@ -94,7 +94,7 @@ WiiFilesystemNode::WiiFilesystemNode() {
setFlags();
}
-WiiFilesystemNode::WiiFilesystemNode(const String &p, bool verify) {
+WiiFilesystemNode::WiiFilesystemNode(const Common::String &p, bool verify) {
assert(p.size() > 0);
_path = p;
@@ -110,10 +110,10 @@ bool WiiFilesystemNode::exists() const {
return stat(_path.c_str (), &st) == 0;
}
-AbstractFilesystemNode *WiiFilesystemNode::getChild(const String &n) const {
+AbstractFilesystemNode *WiiFilesystemNode::getChild(const Common::String &n) const {
assert(_isDirectory);
- String newPath(_path);
+ Common::String newPath(_path);
if (newPath.lastChar() != '/')
newPath += '/';
newPath += n;
@@ -136,15 +136,15 @@ bool WiiFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, bool
if (strcmp(filename, ".") == 0 || strcmp(filename, "..") == 0)
continue;
- String newPath(_path);
+ Common::String newPath(_path);
if (newPath.lastChar() != '/')
newPath += '/';
newPath += filename;
bool isDir = S_ISDIR(st.st_mode);
- if ((mode == FilesystemNode::kListFilesOnly && isDir) ||
- (mode == FilesystemNode::kListDirectoriesOnly && !isDir))
+ if ((mode == Common::FilesystemNode::kListFilesOnly && isDir) ||
+ (mode == Common::FilesystemNode::kListDirectoriesOnly && !isDir))
continue;
if (isDir)
@@ -165,7 +165,7 @@ AbstractFilesystemNode *WiiFilesystemNode::getParent() const {
const char *start = _path.c_str();
const char *end = lastPathComponent(_path, '/');
- return new WiiFilesystemNode(String(start, end - start), true);
+ return new WiiFilesystemNode(Common::String(start, end - start), true);
}
#endif //#if defined(__WII__)
diff --git a/backends/fs/windows/windows-fs.cpp b/backends/fs/windows/windows-fs.cpp
index afcae0f294..5d8c2f009c 100644
--- a/backends/fs/windows/windows-fs.cpp
+++ b/backends/fs/windows/windows-fs.cpp
@@ -58,8 +58,8 @@
*/
class WindowsFilesystemNode : public AbstractFilesystemNode {
protected:
- String _displayName;
- String _path;
+ Common::String _displayName;
+ Common::String _path;
bool _isDirectory;
bool _isPseudoRoot;
bool _isValid;
@@ -81,20 +81,20 @@ public:
* path=c:\foo\bar.txt, currentDir=true -> current directory
* path=NULL, currentDir=true -> current directory
*
- * @param path String with the path the new node should point to.
+ * @param path Common::String with the path the new node should point to.
* @param currentDir if true, the path parameter will be ignored and the resulting node will point to the current directory.
*/
- WindowsFilesystemNode(const String &path, const bool currentDir);
+ WindowsFilesystemNode(const Common::String &path, const bool currentDir);
virtual bool exists() const { return _access(_path.c_str(), F_OK) == 0; }
- virtual String getDisplayName() const { return _displayName; }
- virtual String getName() const { return _displayName; }
- virtual String getPath() const { return _path; }
+ virtual Common::String getDisplayName() const { return _displayName; }
+ virtual Common::String getName() const { return _displayName; }
+ virtual Common::String getPath() const { return _path; }
virtual bool isDirectory() const { return _isDirectory; }
virtual bool isReadable() const { return _access(_path.c_str(), R_OK) == 0; }
virtual bool isWritable() const { return _access(_path.c_str(), W_OK) == 0; }
- virtual AbstractFilesystemNode *getChild(const String &n) const;
+ virtual AbstractFilesystemNode *getChild(const Common::String &n) const;
virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
virtual AbstractFilesystemNode *getParent() const;
@@ -105,7 +105,7 @@ private:
*
* @param list List to put the file entry node in.
* @param mode Mode to use while adding the file entry to the list.
- * @param base String with the directory being listed.
+ * @param base Common::String with the directory being listed.
* @param find_data Describes a file that the FindFirstFile, FindFirstFileEx, or FindNextFile functions find.
*/
static void addFile(AbstractFSList &list, ListMode mode, const char *base, WIN32_FIND_DATA* find_data);
@@ -113,7 +113,7 @@ private:
/**
* Converts a Unicode string to Ascii format.
*
- * @param str String to convert from Unicode to Ascii.
+ * @param str Common::String to convert from Unicode to Ascii.
* @return str in Ascii format.
*/
static char *toAscii(TCHAR *str);
@@ -121,7 +121,7 @@ private:
/**
* Converts an Ascii string to Unicode format.
*
- * @param str String to convert from Ascii to Unicode.
+ * @param str Common::String to convert from Ascii to Unicode.
* @return str in Unicode format.
*/
static const TCHAR* toUnicode(const char *str);
@@ -138,8 +138,8 @@ void WindowsFilesystemNode::addFile(AbstractFSList &list, ListMode mode, const c
isDirectory = (find_data->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ? true : false);
- if ((!isDirectory && mode == FilesystemNode::kListDirectoriesOnly) ||
- (isDirectory && mode == FilesystemNode::kListFilesOnly))
+ if ((!isDirectory && mode == Common::FilesystemNode::kListDirectoriesOnly) ||
+ (isDirectory && mode == Common::FilesystemNode::kListFilesOnly))
return;
entry._isDirectory = isDirectory;
@@ -190,7 +190,7 @@ WindowsFilesystemNode::WindowsFilesystemNode() {
#endif
}
-WindowsFilesystemNode::WindowsFilesystemNode(const String &p, const bool currentDir) {
+WindowsFilesystemNode::WindowsFilesystemNode(const Common::String &p, const bool currentDir) {
if (currentDir) {
char path[MAX_PATH];
GetCurrentDirectory(MAX_PATH, path);
@@ -219,10 +219,10 @@ WindowsFilesystemNode::WindowsFilesystemNode(const String &p, const bool current
_isPseudoRoot = false;
}
-AbstractFilesystemNode *WindowsFilesystemNode::getChild(const String &n) const {
+AbstractFilesystemNode *WindowsFilesystemNode::getChild(const Common::String &n) const {
assert(_isDirectory);
- String newPath(_path);
+ Common::String newPath(_path);
if (_path.lastChar() != '\\')
newPath += '\\';
newPath += n;
@@ -293,7 +293,7 @@ AbstractFilesystemNode *WindowsFilesystemNode::getParent() const {
const char *end = lastPathComponent(_path, '\\');
p = new WindowsFilesystemNode();
- p->_path = String(start, end - start);
+ p->_path = Common::String(start, end - start);
p->_isValid = true;
p->_isDirectory = true;
p->_displayName = lastPathComponent(p->_path, '\\');
diff --git a/backends/platform/dc/dc-fs.cpp b/backends/platform/dc/dc-fs.cpp
index 0da77e317e..c1b31d4815 100644
--- a/backends/platform/dc/dc-fs.cpp
+++ b/backends/platform/dc/dc-fs.cpp
@@ -36,19 +36,19 @@
*/
class RoninCDFileNode : public AbstractFilesystemNode {
protected:
- String _path;
+ Common::String _path;
public:
- RoninCDFileNode(const String &path) : _path(path) {};
+ RoninCDFileNode(const Common::String &path) : _path(path) {};
virtual bool exists() const { return true; }
- virtual String getName() const { return lastPathComponent(_path, '/'); }
- virtual String getPath() const { return _path; }
+ virtual Common::String getName() const { return lastPathComponent(_path, '/'); }
+ virtual Common::String getPath() const { return _path; }
virtual bool isDirectory() const { return false; }
virtual bool isReadable() const { return true; }
virtual bool isWritable() const { return false; }
- virtual AbstractFilesystemNode *getChild(const String &n) const { return NULL; }
+ virtual AbstractFilesystemNode *getChild(const Common::String &n) const { return NULL; }
virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const { return false; }
virtual AbstractFilesystemNode *getParent() const;
@@ -58,17 +58,17 @@ public:
/* A directory */
class RoninCDDirectoryNode : public RoninCDFileNode {
public:
- RoninCDDirectoryNode(const String &path) : RoninCDFileNode(path) {};
+ RoninCDDirectoryNode(const Common::String &path) : RoninCDFileNode(path) {};
virtual bool isDirectory() const { return true; }
- virtual AbstractFilesystemNode *getChild(const String &n) const;
+ virtual AbstractFilesystemNode *getChild(const Common::String &n) const;
virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
};
/* A file/directory which does not exist */
class RoninCDNonexistingNode : public RoninCDFileNode {
public:
- RoninCDNonexistingNode(const String &path) : RoninCDFileNode(path) {};
+ RoninCDNonexistingNode(const Common::String &path) : RoninCDFileNode(path) {};
virtual bool exists() const { return false; }
virtual bool isReadable() const { return false; }
@@ -90,8 +90,8 @@ AbstractFilesystemNode *RoninCDFileNode::makeFileNodePath(const Common::String &
}
}
-AbstractFilesystemNode *RoninCDDirectoryNode::getChild(const String &n) const {
- String newPath(_path);
+AbstractFilesystemNode *RoninCDDirectoryNode::getChild(const Common::String &n) const {
+ Common::String newPath(_path);
if (_path.lastChar() != '/')
newPath += '/';
newPath += n;
@@ -109,20 +109,20 @@ bool RoninCDDirectoryNode::getChildren(AbstractFSList &myList, ListMode mode, bo
// ... loop over dir entries using readdir
while ((dp = readdir(dirp)) != NULL) {
- String newPath(_path);
+ Common::String newPath(_path);
if (newPath.lastChar() != '/')
newPath += '/';
newPath += dp->d_name;
if (dp->d_size < 0) {
// Honor the chosen mode
- if (mode == FilesystemNode::kListFilesOnly)
+ if (mode == Common::FilesystemNode::kListFilesOnly)
continue;
myList.push_back(new RoninCDDirectoryNode(newPath+"/"));
} else {
// Honor the chosen mode
- if (mode == FilesystemNode::kListDirectoriesOnly)
+ if (mode == Common::FilesystemNode::kListDirectoriesOnly)
continue;
myList.push_back(new RoninCDFileNode(newPath));
@@ -140,7 +140,7 @@ AbstractFilesystemNode *RoninCDFileNode::getParent() const {
const char *start = _path.c_str();
const char *end = lastPathComponent(_path, '/');
- return new RoninCDDirectoryNode(String(start, end - start));
+ return new RoninCDDirectoryNode(Common::String(start, end - start));
}
AbstractFilesystemNode *OSystem_Dreamcast::makeRootFileNode() const {
diff --git a/backends/platform/dc/selector.cpp b/backends/platform/dc/selector.cpp
index 91c851506f..a4a53e0f65 100644
--- a/backends/platform/dc/selector.cpp
+++ b/backends/platform/dc/selector.cpp
@@ -146,12 +146,12 @@ struct Dir
{
char name[252];
char deficon[256];
- FilesystemNode node;
+ Common::FilesystemNode node;
};
static Game the_game;
-static bool isIcon(const FilesystemNode &entry)
+static bool isIcon(const Common::FilesystemNode &entry)
{
int l = entry.getDisplayName().size();
if (l>4 && !strcasecmp(entry.getDisplayName().c_str()+l-4, ".ICO"))
@@ -198,14 +198,14 @@ static int findGames(Game *games, int max)
{
Dir *dirs = new Dir[MAX_DIR];
int curr_game = 0, curr_dir = 0, num_dirs = 1;
- dirs[0].node = FilesystemNode("");
+ dirs[0].node = Common::FilesystemNode("");
while (curr_game < max && curr_dir < num_dirs) {
strncpy(dirs[curr_dir].name, dirs[curr_dir].node.getPath().c_str(), 252);
dirs[curr_dir].name[251] = '\0';
dirs[curr_dir].deficon[0] = '\0';
- FSList files, fslist;
- dirs[curr_dir++].node.getChildren(fslist, FilesystemNode::kListAll);
- for (FSList::const_iterator entry = fslist.begin(); entry != fslist.end();
+ Common::FSList files, fslist;
+ dirs[curr_dir++].node.getChildren(fslist, Common::FilesystemNode::kListAll);
+ for (Common::FSList::const_iterator entry = fslist.begin(); entry != fslist.end();
++entry) {
if (entry->isDirectory()) {
if (num_dirs < MAX_DIR && strcasecmp(entry->getDisplayName().c_str(),
diff --git a/backends/platform/iphone/osys_iphone.cpp b/backends/platform/iphone/osys_iphone.cpp
index 3d5571cf3a..be42ee1f33 100644
--- a/backends/platform/iphone/osys_iphone.cpp
+++ b/backends/platform/iphone/osys_iphone.cpp
@@ -1199,11 +1199,11 @@ const char* OSystem_IPHONE::getConfigPath() {
void OSystem_IPHONE::migrateApp() {
// Migrate to the new 1.1.3 directory structure, if needed.
- FilesystemNode file("/var/mobile");
+ Common::FilesystemNode file("/var/mobile");
if (file.exists() && file.isDirectory()) {
// We have 1.1.3 or above.
s_is113OrHigher = true;
- file = FilesystemNode(SCUMMVM_ROOT_PATH);
+ file = Common::FilesystemNode(SCUMMVM_ROOT_PATH);
if (!file.exists()) {
system("mkdir " SCUMMVM_ROOT_PATH);
system("mkdir " SCUMMVM_SAVE_PATH);
@@ -1211,7 +1211,7 @@ void OSystem_IPHONE::migrateApp() {
// Copy over the prefs file
system("cp " SCUMMVM_OLD_PREFS_PATH " " SCUMMVM_PREFS_PATH);
- file = FilesystemNode(SCUMMVM_OLD_SAVE_PATH);
+ file = Common::FilesystemNode(SCUMMVM_OLD_SAVE_PATH);
// Copy over old savegames to the new directory.
if (file.exists() && file.isDirectory())
system("cp " SCUMMVM_OLD_SAVE_PATH "/* " SCUMMVM_SAVE_PATH "/");
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 9abaa3c6fb..6554483eda 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -338,12 +338,12 @@ static Common::String getDefaultConfigFileName() {
}
Common::SeekableReadStream *OSystem_SDL::openConfigFileForReading() {
- FilesystemNode file(getDefaultConfigFileName());
+ Common::FilesystemNode file(getDefaultConfigFileName());
return file.openForReading();
}
Common::WriteStream *OSystem_SDL::openConfigFileForWriting() {
- FilesystemNode file(getDefaultConfigFileName());
+ Common::FilesystemNode file(getDefaultConfigFileName());
return file.openForWriting();
}
diff --git a/backends/platform/wince/CELauncherDialog.cpp b/backends/platform/wince/CELauncherDialog.cpp
index edfdad84b3..7e306be114 100644
--- a/backends/platform/wince/CELauncherDialog.cpp
+++ b/backends/platform/wince/CELauncherDialog.cpp
@@ -72,10 +72,10 @@ void CELauncherDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 d
}
}
-void CELauncherDialog::automaticScanDirectory(const FilesystemNode &node) {
+void CELauncherDialog::automaticScanDirectory(const Common::FilesystemNode &node) {
// First check if we have a recognized game in the current directory
- FSList files;
- node.getChildren(files, FilesystemNode::kListFilesOnly);
+ Common::FSList files;
+ node.getChildren(files, Common::FilesystemNode::kListFilesOnly);
// detect
GameList candidates(EngineMan.detectGames(files));
// insert
@@ -85,9 +85,9 @@ void CELauncherDialog::automaticScanDirectory(const FilesystemNode &node) {
addGameToConf(result);
}
// Then recurse on the subdirectories
- FSList dirs;
- node.getChildren(dirs, FilesystemNode::kListDirectoriesOnly);
- for (FSList::const_iterator currentDir = dirs.begin(); currentDir != dirs.end(); ++currentDir)
+ Common::FSList dirs;
+ node.getChildren(dirs, Common::FilesystemNode::kListDirectoriesOnly);
+ for (Common::FSList::const_iterator currentDir = dirs.begin(); currentDir != dirs.end(); ++currentDir)
automaticScanDirectory(*currentDir);
}
diff --git a/backends/platform/wince/CELauncherDialog.h b/backends/platform/wince/CELauncherDialog.h
index 55d177bcb8..a5f3fd0d43 100644
--- a/backends/platform/wince/CELauncherDialog.h
+++ b/backends/platform/wince/CELauncherDialog.h
@@ -36,7 +36,7 @@ public:
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
protected:
void addGame();
- void automaticScanDirectory(const FilesystemNode &node);
+ void automaticScanDirectory(const Common::FilesystemNode &node);
};
typedef GUI::LauncherDialog GUILauncherDialog;
diff --git a/backends/saves/default/default-saves.cpp b/backends/saves/default/default-saves.cpp
index dc5e8adca7..c4c6f128a8 100644
--- a/backends/saves/default/default-saves.cpp
+++ b/backends/saves/default/default-saves.cpp
@@ -78,13 +78,13 @@ DefaultSaveFileManager::DefaultSaveFileManager(const Common::String &defaultSave
Common::StringList DefaultSaveFileManager::listSavefiles(const char *pattern) {
- FilesystemNode savePath(getSavePath());
- FSList savefiles;
+ Common::FilesystemNode savePath(getSavePath());
+ Common::FSList savefiles;
Common::StringList results;
Common::String search(pattern);
if (savePath.lookupFile(savefiles, search, false, true, 0)) {
- for (FSList::const_iterator file = savefiles.begin(); file != savefiles.end(); ++file) {
+ for (Common::FSList::const_iterator file = savefiles.begin(); file != savefiles.end(); ++file) {
results.push_back(file->getName());
}
}
@@ -92,7 +92,7 @@ Common::StringList DefaultSaveFileManager::listSavefiles(const char *pattern) {
return results;
}
-void DefaultSaveFileManager::checkPath(const FilesystemNode &dir) {
+void DefaultSaveFileManager::checkPath(const Common::FilesystemNode &dir) {
const Common::String path = dir.getPath();
clearError();
@@ -173,11 +173,11 @@ void DefaultSaveFileManager::checkPath(const FilesystemNode &dir) {
Common::InSaveFile *DefaultSaveFileManager::openForLoading(const char *filename) {
// Ensure that the savepath is valid. If not, generate an appropriate error.
- FilesystemNode savePath(getSavePath());
+ Common::FilesystemNode savePath(getSavePath());
checkPath(savePath);
if (getError() == SFM_NO_ERROR) {
- FilesystemNode file = savePath.getChild(filename);
+ Common::FilesystemNode file = savePath.getChild(filename);
// Open the file for reading
Common::SeekableReadStream *sf = file.openForReading();
@@ -190,11 +190,11 @@ Common::InSaveFile *DefaultSaveFileManager::openForLoading(const char *filename)
Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const char *filename) {
// Ensure that the savepath is valid. If not, generate an appropriate error.
- FilesystemNode savePath(getSavePath());
+ Common::FilesystemNode savePath(getSavePath());
checkPath(savePath);
if (getError() == SFM_NO_ERROR) {
- FilesystemNode file = savePath.getChild(filename);
+ Common::FilesystemNode file = savePath.getChild(filename);
// Open the file for saving
Common::WriteStream *sf = file.openForWriting();
@@ -208,8 +208,8 @@ Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const char *filename)
bool DefaultSaveFileManager::removeSavefile(const char *filename) {
clearError();
- FilesystemNode savePath(getSavePath());
- FilesystemNode file = savePath.getChild(filename);
+ Common::FilesystemNode savePath(getSavePath());
+ Common::FilesystemNode file = savePath.getChild(filename);
// TODO: Add new method FilesystemNode::remove()
if (remove(file.getPath().c_str()) != 0) {
diff --git a/backends/saves/default/default-saves.h b/backends/saves/default/default-saves.h
index a08af9e978..c02ce588c2 100644
--- a/backends/saves/default/default-saves.h
+++ b/backends/saves/default/default-saves.h
@@ -55,7 +55,7 @@ protected:
* Checks the given path for read access, existence, etc.
* Sets the internal error and error message accordingly.
*/
- void checkPath(const FilesystemNode &dir);
+ void checkPath(const Common::FilesystemNode &dir);
};
#endif