本文整理汇总了C++中PropertyMap::erase方法的典型用法代码示例。如果您正苦于以下问题:C++ PropertyMap::erase方法的具体用法?C++ PropertyMap::erase怎么用?C++ PropertyMap::erase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropertyMap
的用法示例。
在下文中一共展示了PropertyMap::erase方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: copy
void testDictInterface2()
{
ScopedFileCopy copy("test", ".ogg");
string newname = copy.fileName();
Vorbis::File *f = new Vorbis::File(newname.c_str());
PropertyMap tags = f->tag()->properties();
CPPUNIT_ASSERT_EQUAL(TagLib::uint(2), tags["UNUSUALTAG"].size());
CPPUNIT_ASSERT_EQUAL(String("usual value"), tags["UNUSUALTAG"][0]);
CPPUNIT_ASSERT_EQUAL(String("another value"), tags["UNUSUALTAG"][1]);
CPPUNIT_ASSERT_EQUAL(
String("\xC3\xB6\xC3\xA4\xC3\xBC\x6F\xCE\xA3\xC3\xB8", String::UTF8),
tags["UNICODETAG"][0]);
tags["UNICODETAG"][0] = String(
"\xCE\xBD\xCE\xB5\xCF\x89\x20\xCE\xBD\xCE\xB1\xCE\xBB\xCF\x85\xCE\xB5", String::UTF8);
tags.erase("UNUSUALTAG");
f->tag()->setProperties(tags);
CPPUNIT_ASSERT_EQUAL(
String("\xCE\xBD\xCE\xB5\xCF\x89\x20\xCE\xBD\xCE\xB1\xCE\xBB\xCF\x85\xCE\xB5", String::UTF8),
f->tag()->properties()["UNICODETAG"][0]);
CPPUNIT_ASSERT_EQUAL(false, f->tag()->properties().contains("UNUSUALTAG"));
delete f;
}
示例2: testInsertAndExtract
void testInsertAndExtract()
{
ScopedFileCopy copy("matroska", ".mka");
string filename = copy.fileName();
{
EBML::Matroska::File f1(filename.c_str());
CPPUNIT_ASSERT(f1.isValid());
Tag* t = f1.tag();
CPPUNIT_ASSERT(t != 0);
t->setTitle("Seconds of Silence");
t->setArtist("Nobody");
t->setAlbum("TagLib Test Suite");
t->setComment("Well, there's nothing to say - a few special signs: ©’…ä–€ſ");
t->setGenre("Air");
t->setYear(2013);
t->setTrack(15);
CPPUNIT_ASSERT(f1.save());
}
{
EBML::Matroska::File f2(filename.c_str());
CPPUNIT_ASSERT(f2.isValid());
Tag* t = f2.tag();
CPPUNIT_ASSERT(t != 0);
CPPUNIT_ASSERT_EQUAL(String("Seconds of Silence"), t->title());
CPPUNIT_ASSERT_EQUAL(String("Nobody"), t->artist());
CPPUNIT_ASSERT_EQUAL(String("TagLib Test Suite"), t->album());
CPPUNIT_ASSERT_EQUAL(String("Well, there's nothing to say - a few special signs: ©’…ä–€ſ"), t->comment());
CPPUNIT_ASSERT_EQUAL(String("Air"), t->genre());
CPPUNIT_ASSERT_EQUAL(2013u, t->year());
CPPUNIT_ASSERT_EQUAL(15u, t->track());
PropertyMap pm = f2.properties();
pm.erase("COMMENT");
f2.setProperties(pm);
CPPUNIT_ASSERT(f2.save());
}
{
EBML::Matroska::File f3(filename.c_str());
CPPUNIT_ASSERT(f3.isValid());
PropertyMap pm = f3.properties();
PropertyMap::Iterator i = pm.find("GENRE");
CPPUNIT_ASSERT(i != pm.end());
CPPUNIT_ASSERT_EQUAL(String("Air"), i->second.front());
}
}
示例3: unshare
void
Event::unset(const PropertyName &name)
{
#ifndef NDEBUG
++m_unsetCount;
#endif
unshare();
PropertyMap::iterator i;
PropertyMap *map = find(name, i);
if (map) {
delete i->second;
map->erase(i);
}
}