#include <tag.h>
#include <tstringlist.h>
#include <tbytevectorlist.h>
+#include <tpropertymap.h>
#include <apetag.h>
#include "utils.h"
void testDict()
{
APE::Tag tag;
- TagDict dict = tag.toDict();
+ PropertyMap dict = tag.properties();
CPPUNIT_ASSERT(dict.isEmpty());
dict["ARTIST"] = String("artist 1");
dict["ARTIST"].append("artist 2");
dict["TRACKNUMBER"].append("17");
- tag.fromDict(dict);
+ tag.setProperties(dict);
CPPUNIT_ASSERT_EQUAL(String("17"), tag.itemListMap()["TRACK"].values()[0]);
CPPUNIT_ASSERT_EQUAL(2u, tag.itemListMap()["ARTIST"].values().size());
CPPUNIT_ASSERT_EQUAL(String("artist 1"), tag.artist());
#include <tag.h>
#include <tstringlist.h>
#include <tbytevectorlist.h>
+#include <tpropertymap.h>
#include <flacfile.h>
#include <xiphcomment.h>
#include "utils.h"
string newname = copy.fileName();
FLAC::File *f = new FLAC::File(newname.c_str());
- TagDict dict;
+ PropertyMap dict;
dict["ARTIST"].append("artøst 1");
dict["ARTIST"].append("artöst 2");
- f->fromDict(dict);
+ f->setProperties(dict);
f->save();
delete f;
f = new FLAC::File(newname.c_str());
- dict = f->toDict();
+ dict = f->properties();
CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), dict["ARTIST"].size());
CPPUNIT_ASSERT_EQUAL(String("artøst 1"), dict["ARTIST"][0]);
CPPUNIT_ASSERT_EQUAL(String("artöst 2"), dict["ARTIST"][1]);
#include <tag.h>
#include <tstringlist.h>
#include <tbytevectorlist.h>
+#include <tpropertymap.h>
#include <oggfile.h>
#include <vorbisfile.h>
#include <oggpageheader.h>
Vorbis::File *f = new Vorbis::File(newname.c_str());
- CPPUNIT_ASSERT_EQUAL(uint(0), f->tag()->toDict().size());
+ CPPUNIT_ASSERT_EQUAL(uint(0), f->tag()->properties().size());
- TagDict newTags;
+ PropertyMap newTags;
StringList values("value 1");
values.append("value 2");
newTags["ARTIST"] = values;
- f->tag()->fromDict(newTags);
+ f->tag()->setProperties(newTags);
- TagDict map = f->tag()->toDict();
+ PropertyMap map = f->tag()->properties();
CPPUNIT_ASSERT_EQUAL(uint(1), map.size());
CPPUNIT_ASSERT_EQUAL(uint(2), map["ARTIST"].size());
CPPUNIT_ASSERT_EQUAL(String("value 1"), map["ARTIST"][0]);
string newname = copy.fileName();
Vorbis::File *f = new Vorbis::File(newname.c_str());
- TagDict tags = f->tag()->toDict();
+ PropertyMap tags = f->tag()->properties();
CPPUNIT_ASSERT_EQUAL(uint(2), tags["UNUSUALTAG"].size());
CPPUNIT_ASSERT_EQUAL(String("usual value"), tags["UNUSUALTAG"][0]);
tags["UNICODETAG"][0] = L"νεω ναλυε";
tags.erase("UNUSUALTAG");
- f->tag()->fromDict(tags);
- CPPUNIT_ASSERT_EQUAL(String(L"νεω ναλυε"), f->tag()->toDict()["UNICODETAG"][0]);
- CPPUNIT_ASSERT_EQUAL(false, f->tag()->toDict().contains("UNUSUALTAG"));
+ f->tag()->setProperties(tags);
+ CPPUNIT_ASSERT_EQUAL(String(L"νεω ναλυε"), f->tag()->properties()["UNICODETAG"][0]);
+ CPPUNIT_ASSERT_EQUAL(false, f->tag()->properties().contains("UNUSUALTAG"));
delete f;
}