本文整理汇总了C++中MeiElement::getFacs方法的典型用法代码示例。如果您正苦于以下问题:C++ MeiElement::getFacs方法的具体用法?C++ MeiElement::getFacs怎么用?C++ MeiElement::getFacs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MeiElement
的用法示例。
在下文中一共展示了MeiElement::getFacs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadFacsTable
void MusMeiInput::ReadFacsTable(MeiElement *element, FacsTable *table)
{
if (element->getChildren().size() > 0) {
for (vector<MeiElement*>::iterator i = element->getChildren().begin(); i != element->getChildren().end(); i++) {
MeiElement e = **i;
if (e.getName() == "zone") {
std::string id;
if (e.getId() != "") {
id = e.getId();
} else {
throw "missing xml:id attribute on zone element";
}
int ulx = atoi(e.getAttribute("ulx")->getValue().c_str());
int uly = atoi(e.getAttribute("uly")->getValue().c_str());
int lry = atoi(e.getAttribute("lry")->getValue().c_str());
table->add(id, ulx, uly, lry);
} else if (e.getName() == "system") {
std::string id;
if (e.getId() != "") {
id = e.getId();
} else {
throw "missing xml:id attribute on system element";
}
std::string facs;
if (e.getFacs() != NULL) {
facs = e.getFacs()->getValue();
} else {
throw "missing facs attribute on system element";
}
int ulx = table->GetX(facs); //what if they haven't been stored yet? zones are always defined before systems, as the facs needs to refer to something.
int uly = table->GetUY(facs); //"
int lry = table->GetLY(facs);
table->add(id, ulx, uly, lry);
}
ReadFacsTable(*i,&*table);
}
}
}