TagBuilder: add method HasType()

This commit is contained in:
Max Kellermann 2013-12-03 11:17:43 +01:00
parent 2fb61534a1
commit 074a23e6b4
2 changed files with 17 additions and 0 deletions

View File

@ -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)
{

View File

@ -108,6 +108,13 @@ public:
items.reserve(n);
}
/**
* 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.
*