diff options
author | Johannes Schickel | 2008-09-06 22:09:34 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-09-06 22:09:34 +0000 |
commit | 093431e88d7e886c9b08f024d79a7de386e982f0 (patch) | |
tree | bde839356c3a1468da535ff8458346e22950b157 /common | |
parent | 6bfa3e274a882dc0ac0b8362b225ae3234f4830b (diff) | |
download | scummvm-rg350-093431e88d7e886c9b08f024d79a7de386e982f0.tar.gz scummvm-rg350-093431e88d7e886c9b08f024d79a7de386e982f0.tar.bz2 scummvm-rg350-093431e88d7e886c9b08f024d79a7de386e982f0.zip |
Added hasArchive to SearchSet.
svn-id: r34397
Diffstat (limited to 'common')
-rw-r--r-- | common/archive.cpp | 4 | ||||
-rw-r--r-- | common/archive.h | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/common/archive.cpp b/common/archive.cpp index 91ed49c5c2..44e3e701be 100644 --- a/common/archive.cpp +++ b/common/archive.cpp @@ -225,6 +225,10 @@ void SearchSet::remove(const String& name) { } } +bool SearchSet::hasArchive(const String &name) const { + return (find(name) != _list.end()); +} + void SearchSet::clear() { _list.clear(); } diff --git a/common/archive.h b/common/archive.h index e543462332..ac68a7f33d 100644 --- a/common/archive.h +++ b/common/archive.h @@ -165,16 +165,21 @@ class SearchSet : public Archive { public: /** - * Add a new Archive to the searchable set. + * Add a new archive to the searchable set. */ void add(const String& name, ArchivePtr archive, uint priority = 0); /** - * Remove an Archive from the searchable set. + * Remove an archive from the searchable set. */ void remove(const String& name); /** + * Check if a given archive name is already present. + */ + bool hasArchive(const String &name) const; + + /** * Empties the searchable set. */ void clear(); |