From 8a5209ad93f860572b3545d56bc6f170449be1dc Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 3 Dec 2013 12:12:30 +0100 Subject: Tag: remove method AddItem() Use class TagBuilder instead. --- src/tag/Tag.cxx | 40 ---------------------------------------- src/tag/Tag.hxx | 21 --------------------- 2 files changed, 61 deletions(-) (limited to 'src/tag') diff --git a/src/tag/Tag.cxx b/src/tag/Tag.cxx index 43ded308a..e212c69a2 100644 --- a/src/tag/Tag.cxx +++ b/src/tag/Tag.cxx @@ -147,43 +147,3 @@ Tag::HasType(TagType type) const { return GetValue(type) != nullptr; } - -void -Tag::AddItemInternal(TagType type, const char *value, size_t len) -{ - unsigned int i = num_items; - - char *p = FixTagString(value, len); - if (p != nullptr) { - value = p; - len = strlen(value); - } - - num_items++; - - items = (TagItem **)g_realloc(items, items_size(*this)); - - tag_pool_lock.lock(); - items[i] = tag_pool_get_item(type, value, len); - tag_pool_lock.unlock(); - - g_free(p); -} - -void -Tag::AddItem(TagType type, const char *value, size_t len) -{ - if (ignore_tag_items[type]) - return; - - if (value == nullptr || len == 0) - return; - - AddItemInternal(type, value, len); -} - -void -Tag::AddItem(TagType type, const char *value) -{ - AddItem(type, value, strlen(value)); -} diff --git a/src/tag/Tag.hxx b/src/tag/Tag.hxx index e404a4f26..457a889bd 100644 --- a/src/tag/Tag.hxx +++ b/src/tag/Tag.hxx @@ -103,24 +103,6 @@ struct Tag { */ void Clear(); - /** - * Appends a new tag item. - * - * @param type the type of the new tag item - * @param value the value of the tag item (not null-terminated) - * @param len the length of #value - */ - void AddItem(TagType type, const char *value, size_t len); - - /** - * Appends a new tag item. - * - * @param tag the #tag object - * @param type the type of the new tag item - * @param value the value of the tag item (null-terminated) - */ - void AddItem(TagType type, const char *value); - /** * Merges the data from two tags. If both tags share data for the * same TagType, only data from "add" is used. @@ -152,9 +134,6 @@ struct Tag { */ gcc_pure bool HasType(TagType type) const; - -private: - void AddItemInternal(TagType type, const char *value, size_t len); }; /** -- cgit v1.2.3