aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-09-05 19:14:39 +0200
committerMax Kellermann <max@duempel.org>2013-09-05 19:14:47 +0200
commit84533b6cad78626b27ceb463282687918653b605 (patch)
tree95574f85282e44ec448a347daf8df47080229092 /src
parent8dca38e979bb00f2045bea02f19d407fafd62ca3 (diff)
downloadmpd-84533b6cad78626b27ceb463282687918653b605.tar.gz
mpd-84533b6cad78626b27ceb463282687918653b605.tar.xz
mpd-84533b6cad78626b27ceb463282687918653b605.zip
TagBuilder: add method IsEmpty()
Diffstat (limited to 'src')
-rw-r--r--src/tag/TagBuilder.hxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/tag/TagBuilder.hxx b/src/tag/TagBuilder.hxx
index c882f4d53..4eeb0c48d 100644
--- a/src/tag/TagBuilder.hxx
+++ b/src/tag/TagBuilder.hxx
@@ -66,11 +66,19 @@ public:
TagBuilder &operator=(const TagBuilder &other) = delete;
/**
+ * Returns true if the tag contains no items. This ignores the "time"
+ * attribute.
+ */
+ bool IsEmpty() const {
+ return items.empty();
+ }
+
+ /**
* Returns true if the object contains any information.
*/
gcc_pure
bool IsDefined() const {
- return time >= 0 || has_playlist || !items.empty();
+ return time >= 0 || has_playlist || !IsEmpty();
}
void Clear();