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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Wed Sep 17 20:59:10 CEST 2008


Revision: 34598
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34598&view=rev
Author:   fingolfin
Date:     2008-09-17 18:59:09 +0000 (Wed, 17 Sep 2008)

Log Message:
-----------
Simplified & fixed SearchManager

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

Modified: scummvm/trunk/common/archive.cpp
===================================================================
--- scummvm/trunk/common/archive.cpp	2008-09-17 18:56:54 UTC (rev 34597)
+++ scummvm/trunk/common/archive.cpp	2008-09-17 18:59:09 UTC (rev 34598)
@@ -299,7 +299,7 @@
 DECLARE_SINGLETON(SearchManager);
 
 void SearchManager::addArchive(const String &name, ArchivePtr archive) {
-	_searchSet.add(name, archive);
+	add(name, archive);
 }
 
 void SearchManager::addDirectory(const String &name, const String &directory) {
@@ -307,24 +307,8 @@
 }
 
 void SearchManager::addDirectoryRecursive(const String &name, const String &directory, int depth) {
-	_searchSet.add(name, SharedPtr<FSDirectory>(new FSDirectory(directory, depth)));
+	add(name, SharedPtr<FSDirectory>(new FSDirectory(directory, depth)));
 }
 
-void SearchManager::remove(const String &name) {
-	_searchSet.remove(name);
-}
 
-void SearchManager::clear() {
-	_searchSet.clear();
-}
-
-bool SearchManager::hasFile(const String &name) {
-	return _searchSet.hasFile(name);
-}
-
-SeekableReadStream *SearchManager::openFile(const String &name) {
-	return _searchSet.openFile(name);
-}
-
-
 } // namespace Common

Modified: scummvm/trunk/common/archive.h
===================================================================
--- scummvm/trunk/common/archive.h	2008-09-17 18:56:54 UTC (rev 34597)
+++ scummvm/trunk/common/archive.h	2008-09-17 18:59:09 UTC (rev 34598)
@@ -204,50 +204,24 @@
 };
 
 
-
-
-class SearchManager : public Singleton<SearchManager>, public Archive {
-
-	SearchSet	_searchSet;
-
+class SearchManager : public Singleton<SearchManager>, public SearchSet {
 public:
 	/**
-	 *	Add an existing Archive. This is meant to support searching in system-specific
-	 *  archives, namely the MACOSX/IPHONE bundles.
+	 * Add an existing Archive. This is meant to support searching in system-specific
+	 * archives, namely the MACOSX/IPHONE bundles.
 	 */
 	void addArchive(const String &name, ArchivePtr archive);
 
 	/**
-	 *	Create and add a FSDirectory by name
+	 * Create and add a FSDirectory by name
 	 */
 	void addDirectory(const String &name, const String &directory);
 
 	/**
-	 *	Create and add a FSDirectory and its subdirectories by name
+	 * Create and add a FSDirectory and its subdirectories by name
 	 */
 	void addDirectoryRecursive(const String &name, const String &directory, int depth = 4);
 
-	/**
-	 *	Remove an archive from the pool.
-	 */
-	void remove(const String &name);
-
-	/**
-	 *	Clears the archive
-	 */
-	void clear();
-
-
-	virtual bool hasFile(const String &name);
-	virtual int getAllNames(StringList &list) {
-		return matchPattern(list, "*");
-	}
-
-	/**
-	 * Implements openFile from Archive base class. The current policy is
-	 * opening the first file encountered that matches the name.
-	 */
-	virtual SeekableReadStream *openFile(const String &name);
 };
 
 /** Shortcut for accessing the search manager. */


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