From 531bcf847ceef2b9eca82e0b3ef8473612889632 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 3 Sep 2008 11:22:51 +0000 Subject: Moved FilesystemNode / FSList to namespace Common; also got rid of some 'typedef Common::String String;' name aliases svn-id: r34302 --- backends/fs/ps2/ps2-fs.cpp | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'backends/fs/ps2/ps2-fs.cpp') 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(); } -- cgit v1.2.3