mirror of
https://github.com/taglib/taglib.git
synced 2025-06-03 17:18:11 -04:00
Implemented a specialized version of APE::Tag::isEmpty()
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@1148318 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
parent
ab7e997bc6
commit
49631a3013
2
NEWS
2
NEWS
@ -2,6 +2,8 @@ TagLib 1.7
|
||||
==========
|
||||
|
||||
* Support for reading/writing tags from Monkey's Audio files.
|
||||
* Implemented APE::Tag::isEmpty() to check for all APE tags, not just the
|
||||
basic ones.
|
||||
|
||||
TagLib 1.6.3 (Apr 17, 2010)
|
||||
===========================
|
||||
|
@ -208,6 +208,11 @@ void APE::Tag::setItem(const String &key, const Item &item)
|
||||
d->itemListMap.insert(key.upper(), item);
|
||||
}
|
||||
|
||||
bool APE::Tag::isEmpty() const
|
||||
{
|
||||
return d->itemListMap.isEmpty();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// protected methods
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -137,6 +137,11 @@ namespace TagLib {
|
||||
*/
|
||||
void setItem(const String &key, const Item &item);
|
||||
|
||||
/*!
|
||||
* Returns true if the tag does not contain any data.
|
||||
*/
|
||||
bool isEmpty() const;
|
||||
|
||||
protected:
|
||||
|
||||
/*!
|
||||
|
@ -39,6 +39,7 @@ SET(test_runner_SRCS
|
||||
test_oggflac.cpp
|
||||
test_flac.cpp
|
||||
test_ape.cpp
|
||||
test_apetag.cpp
|
||||
)
|
||||
IF(WITH_MP4)
|
||||
SET(test_runner_SRCS ${test_runner_SRCS}
|
||||
|
40
tests/test_apetag.cpp
Normal file
40
tests/test_apetag.cpp
Normal file
@ -0,0 +1,40 @@
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
#include <string>
|
||||
#include <stdio.h>
|
||||
#include <tag.h>
|
||||
#include <tstringlist.h>
|
||||
#include <tbytevectorlist.h>
|
||||
#include <apetag.h>
|
||||
#include "utils.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace TagLib;
|
||||
|
||||
class TestAPETag : public CppUnit::TestFixture
|
||||
{
|
||||
CPPUNIT_TEST_SUITE(TestAPETag);
|
||||
CPPUNIT_TEST(testIsEmpty);
|
||||
CPPUNIT_TEST(testIsEmpty2);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
|
||||
void testIsEmpty()
|
||||
{
|
||||
APE::Tag tag;
|
||||
CPPUNIT_ASSERT(tag.isEmpty());
|
||||
tag.addValue("COMPOSER", "Mike Oldfield");
|
||||
CPPUNIT_ASSERT(!tag.isEmpty());
|
||||
}
|
||||
|
||||
void testIsEmpty2()
|
||||
{
|
||||
APE::Tag tag;
|
||||
CPPUNIT_ASSERT(tag.isEmpty());
|
||||
tag.setArtist("Mike Oldfield");
|
||||
CPPUNIT_ASSERT(!tag.isEmpty());
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestAPETag);
|
Loading…
x
Reference in New Issue
Block a user