diff options
Diffstat (limited to 'src/tag/Tag.hxx')
-rw-r--r-- | src/tag/Tag.hxx | 41 |
1 files changed, 11 insertions, 30 deletions
diff --git a/src/tag/Tag.hxx b/src/tag/Tag.hxx index 5846e7a9d..5d3aaad0c 100644 --- a/src/tag/Tag.hxx +++ b/src/tag/Tag.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2013 The Music Player Daemon Project + * Copyright (C) 2003-2014 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -20,8 +20,8 @@ #ifndef MPD_TAG_HXX #define MPD_TAG_HXX -#include "TagType.h" -#include "TagItem.hxx" +#include "TagType.h" // IWYU pragma: export +#include "TagItem.hxx" // IWYU pragma: export #include "Compiler.h" #include <algorithm> @@ -47,23 +47,23 @@ struct Tag { */ bool has_playlist; + /** the total number of tag items in the #items array */ + unsigned short num_items; + /** an array of tag items */ TagItem **items; - /** the total number of tag items in the #items array */ - unsigned num_items; - /** * Create an empty tag. */ Tag():time(-1), has_playlist(false), - items(nullptr), num_items(0) {} + num_items(0), items(nullptr) {} Tag(const Tag &other); Tag(Tag &&other) :time(other.time), has_playlist(other.has_playlist), - items(other.items), num_items(other.num_items) { + num_items(other.num_items), items(other.items) { other.items = nullptr; other.num_items = 0; } @@ -71,7 +71,9 @@ struct Tag { /** * Free the tag object and all its items. */ - ~Tag(); + ~Tag() { + Clear(); + } Tag &operator=(const Tag &other) = delete; @@ -104,24 +106,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 +136,6 @@ struct Tag { */ gcc_pure bool HasType(TagType type) const; - -private: - void AddItemInternal(TagType type, const char *value, size_t len); }; /** |