diff options
author | Max Horn | 2008-11-21 19:14:23 +0000 |
---|---|---|
committer | Max Horn | 2008-11-21 19:14:23 +0000 |
commit | 44d37a14a9bef80d2ca931298b8df1e508ffb94d (patch) | |
tree | 83fa7aac42cd0a1d6e355116e4c955513d7a3060 /common | |
parent | 858de9b9382942a604b367baf1dae0b72855fde4 (diff) | |
download | scummvm-rg350-44d37a14a9bef80d2ca931298b8df1e508ffb94d.tar.gz scummvm-rg350-44d37a14a9bef80d2ca931298b8df1e508ffb94d.tar.bz2 scummvm-rg350-44d37a14a9bef80d2ca931298b8df1e508ffb94d.zip |
Removed FSNode::lookupFile
svn-id: r35142
Diffstat (limited to 'common')
-rw-r--r-- | common/fs.cpp | 38 | ||||
-rw-r--r-- | common/fs.h | 19 |
2 files changed, 0 insertions, 57 deletions
diff --git a/common/fs.cpp b/common/fs.cpp index c1ef26e42d..497e961680 100644 --- a/common/fs.cpp +++ b/common/fs.cpp @@ -135,44 +135,6 @@ bool FSNode::isWritable() const { return _realNode->isWritable(); } -bool FSNode::lookupFile(FSList &results, const Common::String &p, bool hidden, bool exhaustive, int depth) const { - if (!isDirectory()) - return false; - - FSList children; - FSList subdirs; - Common::String pattern = p; - - pattern.toUppercase(); - - // First match all files on this level - getChildren(children, FSNode::kListAll, hidden); - for (FSList::iterator entry = children.begin(); entry != children.end(); ++entry) { - if (entry->isDirectory()) { - if (depth != 0) - subdirs.push_back(*entry); - } else { - Common::String filename = entry->getName(); - filename.toUppercase(); - if (filename.matchString(pattern)) { - results.push_back(*entry); - - if (!exhaustive) - return true; // Abort on first match if no exhaustive search was requested - } - } - } - - // Now scan all subdirs - for (FSList::iterator child = subdirs.begin(); child != subdirs.end(); ++child) { - child->lookupFile(results, pattern, hidden, exhaustive, depth - 1); - if (!exhaustive && !results.empty()) - return true; // Abort on first match if no exhaustive search was requested - } - - return !results.empty(); -} - Common::SeekableReadStream *FSNode::openForReading() const { if (_realNode == 0) return 0; diff --git a/common/fs.h b/common/fs.h index e2db955c87..310d24c4c5 100644 --- a/common/fs.h +++ b/common/fs.h @@ -206,25 +206,6 @@ public: virtual bool isWritable() const; /** - * Searches recursively for files matching the specified pattern inside this directory and - * all its subdirectories. It is safe to call this method for non-directories, in this case - * it will just return false. - * - * The files in each directory are scanned first. Other than that, a depth first search - * is performed. - * - * @param results List to put the matches in. - * @param pattern Pattern of the files to look for. - * @param hidden Whether to search hidden files or not. - * @param exhaustive Whether to continue searching after one match has been found. - * @param depth How many levels to search through (-1 = search all subdirs, 0 = only the current one) - * - * @return true if matches could be found, false otherwise. - */ - virtual bool lookupFile(FSList &results, const Common::String &pattern, bool hidden, bool exhaustive, int depth = -1) const; - - - /** * Creates a SeekableReadStream instance corresponding to the file * referred by this node. This assumes that the node actually refers * to a readable file. If this is not the case, 0 is returned. |