TagBuilder: add method AddEmptyItem()

This commit is contained in:
Max Kellermann 2014-04-24 11:29:55 +02:00
parent 7fdd801479
commit 2220651253
2 changed files with 17 additions and 0 deletions

View File

@ -218,6 +218,16 @@ TagBuilder::AddItem(TagType type, const char *value)
AddItem(type, value, strlen(value));
}
void
TagBuilder::AddEmptyItem(TagType type)
{
tag_pool_lock.lock();
auto i = tag_pool_get_item(type, "", 0);
tag_pool_lock.unlock();
items.push_back(i);
}
void
TagBuilder::RemoveAll()
{

View File

@ -153,6 +153,13 @@ public:
gcc_nonnull_all
void AddItem(TagType type, const char *value);
/**
* Appends a new tag item with an empty value. Do not use
* this unless you know what you're doing - because usually,
* empty values are discarded.
*/
void AddEmptyItem(TagType type);
/**
* Removes all tag items.
*/