diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/archive.cpp | 20 | ||||
-rw-r--r-- | common/archive.h | 36 |
2 files changed, 7 insertions, 49 deletions
diff --git a/common/archive.cpp b/common/archive.cpp index 6b8357d576..2c6e10ec01 100644 --- a/common/archive.cpp +++ b/common/archive.cpp @@ -299,7 +299,7 @@ SeekableReadStream *SearchSet::openFile(const String &name) { 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,23 +307,7 @@ void SearchManager::addDirectory(const String &name, const String &directory) { } void SearchManager::addDirectoryRecursive(const String &name, const String &directory, int depth) { - _searchSet.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); + add(name, SharedPtr<FSDirectory>(new FSDirectory(directory, depth))); } diff --git a/common/archive.h b/common/archive.h index c418eae063..f3f121e717 100644 --- a/common/archive.h +++ b/common/archive.h @@ -204,50 +204,24 @@ public: }; - - -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. */ |