本文整理汇总了C++中Sxmlelement::getType方法的典型用法代码示例。如果您正苦于以下问题:C++ Sxmlelement::getType方法的具体用法?C++ Sxmlelement::getType怎么用?C++ Sxmlelement::getType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sxmlelement
的用法示例。
在下文中一共展示了Sxmlelement::getType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addpart
//------------------------------------------------------------------------
void musicxmlfactory::addpart (const Sxmlelement& part)
{
switch (part->getType()) {
case k_score_part:
fPartList->push(part);
break;
case k_part:
fRoot->push(part);
break;
default:
cerr << "musicxmlfactory::addpart unexpected type " << part->getType() << endl;
}
}
示例2: if
//_______________________________________________________________________________
static void test2(Sxmlelement elt)
{
cerr << "test2: erasing all the par measures" << endl;
ctree<xmlelement>::iterator next, iter = elt->begin();
int measure=1;
while (iter != elt->end()) {
Sxmlelement xml = *iter;
next = iter;
next++;
assert (xml);
if (xml->getType() == k_software) {
next = elt->erase(iter);
}
else if (xml->getType() == k_measure) {
if (!(measure & 1)) {
next = elt->erase(iter);
}
measure++;
}
iter = next;
}
}
示例3:
//_______________________________________________________________________________
static void test1(Sxmlelement elt)
{
cerr << "test1: iterate thru the tree" << endl;
ctree<xmlelement>::iterator iter = elt->begin();
cerr << "=> test1: iterate thru the tree" << endl;
while (iter != elt->end()) {
Sxmlelement xml = *iter;
if (xml)
cerr << " element type " << xml->getType()
<< " - " << xml->getName()
<< " - size: " << xml->size() << endl;
else
cerr << "iterate thru unknown element type " << endl;
iter++;
}
}
示例4: operator
virtual bool operator () (const Sxmlelement elt) const {
return elt->getType() == fType;
}