aboutsummaryrefslogtreecommitdiffstats
path: root/src/tag
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-04-24 11:29:55 +0200
committerMax Kellermann <max@duempel.org>2014-04-24 11:38:48 +0200
commit22206512539aa9a888fdba68d60324c560389d5d (patch)
tree3a69408316f4edd017fa45192e01ee3093fc04d0 /src/tag
parent7fdd8014798a11e93af59f757832a412e9aae45c (diff)
downloadmpd-22206512539aa9a888fdba68d60324c560389d5d.tar.gz
mpd-22206512539aa9a888fdba68d60324c560389d5d.tar.xz
mpd-22206512539aa9a888fdba68d60324c560389d5d.zip
TagBuilder: add method AddEmptyItem()
Diffstat (limited to 'src/tag')
-rw-r--r--src/tag/TagBuilder.cxx10
-rw-r--r--src/tag/TagBuilder.hxx7
2 files changed, 17 insertions, 0 deletions
diff --git a/src/tag/TagBuilder.cxx b/src/tag/TagBuilder.cxx
index 40ccff752..bc8ea2ae7 100644
--- a/src/tag/TagBuilder.cxx
+++ b/src/tag/TagBuilder.cxx
@@ -219,6 +219,16 @@ TagBuilder::AddItem(TagType type, const char *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()
{
tag_pool_lock.lock();
diff --git a/src/tag/TagBuilder.hxx b/src/tag/TagBuilder.hxx
index c0b4bebfa..6de52b775 100644
--- a/src/tag/TagBuilder.hxx
+++ b/src/tag/TagBuilder.hxx
@@ -154,6 +154,13 @@ public:
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.
*/
void RemoveAll();