本文整理汇总了C++中PropertyMap::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ PropertyMap::clear方法的具体用法?C++ PropertyMap::clear怎么用?C++ PropertyMap::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropertyMap
的用法示例。
在下文中一共展示了PropertyMap::clear方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: splitProperties
void Frame::splitProperties(const PropertyMap &original, PropertyMap &singleFrameProperties,
PropertyMap &tiplProperties, PropertyMap &tmclProperties)
{
singleFrameProperties.clear();
tiplProperties.clear();
tmclProperties.clear();
for(PropertyMap::ConstIterator it = original.begin(); it != original.end(); ++it) {
if(TextIdentificationFrame::involvedPeopleMap().contains(it->first))
tiplProperties.insert(it->first, it->second);
else if(it->first.startsWith(TextIdentificationFrame::instrumentPrefix))
tmclProperties.insert(it->first, it->second);
else
singleFrameProperties.insert(it->first, it->second);
}
}
示例2: makeTIPLProperties
PropertyMap TextIdentificationFrame::makeTIPLProperties() const
{
PropertyMap map;
if(fieldList().size() % 2 != 0){
// according to the ID3 spec, TIPL must contain an even number of entries
map.unsupportedData().append(frameID());
return map;
}
StringList l = fieldList();
for(StringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
bool found = false;
for(size_t i = 0; i < involvedPeopleSize; ++i)
if(*it == involvedPeople[i][0]) {
map.insert(involvedPeople[i][1], (++it)->split(","));
found = true;
break;
}
if(!found){
// invalid involved role -> mark whole frame as unsupported in order to be consisten with writing
map.clear();
map.unsupportedData().append(frameID());
return map;
}
}
return map;
}
示例3: init
RTComponent::RTComponent(string moduleName_)
{
rtc_ = 0;
rtcRef = 0;
if(moduleName_.empty()){
return;
}
PropertyMap prop;
prop.clear();
init(moduleName_, prop);
}
示例4: makeTMCLProperties
PropertyMap TextIdentificationFrame::makeTMCLProperties() const
{
PropertyMap map;
if(fieldList().size() % 2 != 0){
// according to the ID3 spec, TMCL must contain an even number of entries
map.unsupportedData().append(frameID());
return map;
}
StringList l = fieldList();
for(StringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
String instrument = it->upper();
if(instrument.isEmpty()) {
// instrument is not a valid key -> frame unsupported
map.clear();
map.unsupportedData().append(frameID());
return map;
}
map.insert(L"PERFORMER:" + instrument, (++it)->split(","));
}
return map;
}
示例5: properties_data
void tst_QDBusXmlParser::properties_data()
{
QTest::addColumn<QString>("xmlDataFragment");
QTest::addColumn<PropertyMap>("propertyMap");
PropertyMap map;
QTest::newRow("no-signals") << QString() << map;
// one readable signal
QDBusIntrospection::Property prop;
prop.name = "foo";
prop.type = "s";
prop.access = QDBusIntrospection::Property::Read;
map << prop;
QTest::newRow("one-readable") << "<property name=\"foo\" type=\"s\" access=\"read\"/>" << map;
// one writable signal
prop.access = QDBusIntrospection::Property::Write;
map.clear();
map << prop;
QTest::newRow("one-writable") << "<property name=\"foo\" type=\"s\" access=\"write\"/>" << map;
// one read- & writable signal
prop.access = QDBusIntrospection::Property::ReadWrite;
map.clear();
map << prop;
QTest::newRow("one-read-writable") << "<property name=\"foo\" type=\"s\" access=\"readwrite\"/>"
<< map;
// two, mixed properties
prop.name = "bar";
prop.type = "i";
prop.access = QDBusIntrospection::Property::Read;
map << prop;
QTest::newRow("two") <<
"<property name=\"foo\" type=\"s\" access=\"readwrite\"/>"
"<property name=\"bar\" type=\"i\" access=\"read\"/>" << map;
// invert the order of the declaration
QTest::newRow("two") <<
"<property name=\"bar\" type=\"i\" access=\"read\"/>"
"<property name=\"foo\" type=\"s\" access=\"readwrite\"/>" << map;
// add a third with annotations
prop.name = "baz";
prop.type = "as";
prop.access = QDBusIntrospection::Property::Write;
prop.annotations.insert("foo.annotation", "Hello, World");
prop.annotations.insert("foo.annotation2", "Goodbye, World");
map << prop;
QTest::newRow("complex") <<
"<property name=\"bar\" type=\"i\" access=\"read\"/>"
"<property name=\"baz\" type=\"as\" access=\"write\">"
"<annotation name=\"foo.annotation\" value=\"Hello, World\" />"
"<annotation name=\"foo.annotation2\" value=\"Goodbye, World\" />"
"<property name=\"foo\" type=\"s\" access=\"readwrite\"/>" << map;
// and now change the order
QTest::newRow("complex2") <<
"<property name=\"baz\" type=\"as\" access=\"write\">"
"<annotation name=\"foo.annotation2\" value=\"Goodbye, World\" />"
"<annotation name=\"foo.annotation\" value=\"Hello, World\" />"
"<property name=\"bar\" type=\"i\" access=\"read\"/>"
"<property name=\"foo\" type=\"s\" access=\"readwrite\"/>" << map;
}