From 05f6adbbd90f58346a0bca85793069c387c54b67 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 3 May 2006 20:49:33 +0000 Subject: Removed FilesystemNode::isValid (leaving it up to the porters to decide whether to remove their isValid code or not) svn-id: r22317 --- backends/fs/abstract-fs.h | 1 - backends/fs/fs.cpp | 6 ------ backends/fs/fs.h | 10 ---------- base/main.cpp | 2 +- common/file.cpp | 2 +- 5 files changed, 2 insertions(+), 19 deletions(-) diff --git a/backends/fs/abstract-fs.h b/backends/fs/abstract-fs.h index d6229a992c..da9cef9aab 100644 --- a/backends/fs/abstract-fs.h +++ b/backends/fs/abstract-fs.h @@ -85,7 +85,6 @@ public: virtual ~AbstractFilesystemNode() {} virtual String displayName() const = 0; - virtual bool isValid() const = 0; virtual bool isDirectory() const = 0; virtual String path() const = 0; virtual bool listDir(AbstractFSList &list, ListMode mode) const = 0; diff --git a/backends/fs/fs.cpp b/backends/fs/fs.cpp index 12cdc145ba..f111e78a0f 100644 --- a/backends/fs/fs.cpp +++ b/backends/fs/fs.cpp @@ -121,12 +121,6 @@ Common::String FilesystemNode::displayName() const { return _realNode->displayName(); } -bool FilesystemNode::isValid() const { - if (_realNode == 0) - return false; - return _realNode->isValid(); -} - bool FilesystemNode::isDirectory() const { if (_realNode == 0) return false; diff --git a/backends/fs/fs.h b/backends/fs/fs.h index f2930bd375..f272cb2164 100644 --- a/backends/fs/fs.h +++ b/backends/fs/fs.h @@ -121,16 +121,6 @@ public: */ virtual String displayName() const; - /** - * Is this node valid? Returns true if the file/directory pointed - * to by this node exists, false otherwise. - * - * @todo Maybe rename this to exists() ? Or maybe even distinguish between - * the two? E.g. a path may be non-existant but valid, while another might - * be completely invalid). But do we ever need to make that distinction? - */ - virtual bool isValid() const; - /** * Is this node pointing to a directory? * @todo Currently we assume that a valid node that is not a directory diff --git a/base/main.cpp b/base/main.cpp index e438cec0c8..a3c24ed30c 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -170,7 +170,7 @@ static int runGame(const Plugin *plugin, OSystem &system, const Common::String & if (ConfMan.hasKey("path")) { Common::String path(ConfMan.get("path")); FilesystemNode dir(path); - if (!dir.isValid() || !dir.isDirectory()) { + if (!dir.isDirectory()) { warning("Game directory does not exist (%s)", path.c_str()); return 0; } diff --git a/common/file.cpp b/common/file.cpp index b662ab9c44..cb9836294b 100644 --- a/common/file.cpp +++ b/common/file.cpp @@ -309,7 +309,7 @@ bool File::exists(const String &filename) { // First try to find the file it via a FilesystemNode (in case an absolute // path was passed). But we only use this to filter out directories. FilesystemNode file(filename); - if (file.isValid() && file.isDirectory()) + if (file.isDirectory()) return false; // Next, try to locate the file by *opening* it in read mode. This has -- cgit v1.2.3