TagBuilder: add method HasType()
This commit is contained in:
@@ -74,6 +74,16 @@ TagBuilder::Commit()
|
|||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
TagBuilder::HasType(TagType type) const
|
||||||
|
{
|
||||||
|
for (auto i : items)
|
||||||
|
if (i->type == type)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
TagBuilder::AddItemInternal(TagType type, const char *value, size_t length)
|
TagBuilder::AddItemInternal(TagType type, const char *value, size_t length)
|
||||||
{
|
{
|
||||||
|
@@ -108,6 +108,13 @@ public:
|
|||||||
items.reserve(n);
|
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.
|
* Appends a new tag item.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user