diff --git a/simgear/package/Package.cxx b/simgear/package/Package.cxx index 17772f94..f802f6b3 100644 --- a/simgear/package/Package.cxx +++ b/simgear/package/Package.cxx @@ -268,6 +268,11 @@ string_set Package::tags() const { return m_tags; } + +bool Package::hasTag(const std::string& tag) const +{ + return m_tags.find(tag) != m_tags.end(); +} SGPropertyNode* Package::properties() const { diff --git a/simgear/package/Package.hxx b/simgear/package/Package.hxx index 544ffb5c..0c5daa6c 100644 --- a/simgear/package/Package.hxx +++ b/simgear/package/Package.hxx @@ -142,6 +142,13 @@ public: string_set tags() const; + /** + * @brief hasTag - efficently check if a tag is defined or not + * @param tag + * @return + */ + bool hasTag(const std::string& tag) const; + /** * download URLs for the package */