diff options
Diffstat (limited to 'src/tag')
-rw-r--r-- | src/tag/TagBuilder.cxx | 10 | ||||
-rw-r--r-- | src/tag/TagBuilder.hxx | 7 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/tag/TagBuilder.cxx b/src/tag/TagBuilder.cxx index 25e5cc24b..02749cfd5 100644 --- a/src/tag/TagBuilder.cxx +++ b/src/tag/TagBuilder.cxx @@ -74,6 +74,16 @@ TagBuilder::Commit() return tag; } +bool +TagBuilder::HasType(TagType type) const +{ + for (auto i : items) + if (i->type == type) + return true; + + return false; +} + inline void TagBuilder::AddItemInternal(TagType type, const char *value, size_t length) { diff --git a/src/tag/TagBuilder.hxx b/src/tag/TagBuilder.hxx index ffc60a1b2..ff6251014 100644 --- a/src/tag/TagBuilder.hxx +++ b/src/tag/TagBuilder.hxx @@ -109,6 +109,13 @@ public: } /** + * Checks whether the tag contains one or more items with + * the specified type. + */ + gcc_pure + bool HasType(TagType type) const; + + /** * Appends a new tag item. * * @param type the type of the new tag item |