From 84533b6cad78626b27ceb463282687918653b605 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 5 Sep 2013 19:14:39 +0200 Subject: TagBuilder: add method IsEmpty() --- src/tag/TagBuilder.hxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') 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 @@ -65,12 +65,20 @@ public: TagBuilder(const TagBuilder &other) = delete; 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(); -- cgit v1.2.3