[Scummvm-cvs-logs] SF.net SVN: scummvm:[35142] scummvm/trunk/common

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Fri Nov 21 20:14:23 CET 2008


Revision: 35142
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35142&view=rev
Author:   fingolfin
Date:     2008-11-21 19:14:23 +0000 (Fri, 21 Nov 2008)

Log Message:
-----------
Removed FSNode::lookupFile

Modified Paths:
--------------
    scummvm/trunk/common/fs.cpp
    scummvm/trunk/common/fs.h

Modified: scummvm/trunk/common/fs.cpp
===================================================================
--- scummvm/trunk/common/fs.cpp	2008-11-21 17:49:19 UTC (rev 35141)
+++ scummvm/trunk/common/fs.cpp	2008-11-21 19:14:23 UTC (rev 35142)
@@ -135,44 +135,6 @@
 	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;

Modified: scummvm/trunk/common/fs.h
===================================================================
--- scummvm/trunk/common/fs.h	2008-11-21 17:49:19 UTC (rev 35141)
+++ scummvm/trunk/common/fs.h	2008-11-21 19:14:23 UTC (rev 35142)
@@ -206,25 +206,6 @@
 	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.


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list