diff options
-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(); |