| 513 | } |
| 514 | |
| 515 | Base::Type ProjectFile::getTypeId(const std::string& name) const |
| 516 | { |
| 517 | // <Objects Count="1"> |
| 518 | // <Object type="Mesh::MeshFeature" name="Mesh" /> |
| 519 | // <Objects/> |
| 520 | if (!xmlDocument) { |
| 521 | return Base::Type::BadType; |
| 522 | } |
| 523 | |
| 524 | DOMNodeList* nodes = xmlDocument->getElementsByTagName(XStrLiteral("Objects").unicodeForm()); |
| 525 | for (XMLSize_t i = 0; i < nodes->getLength(); i++) { |
| 526 | DOMNode* node = nodes->item(i); |
| 527 | if (node->getNodeType() == DOMNode::ELEMENT_NODE) { |
| 528 | DOMNodeList* objectList = static_cast<DOMElement*>(node)->getElementsByTagName( |
| 529 | XStrLiteral("Object").unicodeForm()); // NOLINT |
| 530 | for (XMLSize_t j = 0; j < objectList->getLength(); j++) { |
| 531 | DOMNode* objectNode = objectList->item(j); |
| 532 | DOMNode* typeAttr = |
| 533 | objectNode->getAttributes()->getNamedItem(XStrLiteral("type").unicodeForm()); |
| 534 | DOMNode* nameAttr = |
| 535 | objectNode->getAttributes()->getNamedItem(XStrLiteral("name").unicodeForm()); |
| 536 | if (typeAttr && nameAttr) { |
| 537 | if (strcmp(name.c_str(), StrX(nameAttr->getNodeValue()).c_str()) == 0) { |
| 538 | std::string typeId = StrX(typeAttr->getNodeValue()).c_str(); |
| 539 | return Base::Type::fromName(typeId.c_str()); |
| 540 | } |
| 541 | } |
| 542 | } |
| 543 | } |
| 544 | } |
| 545 | |
| 546 | return Base::Type::BadType; |
| 547 | } |
| 548 | |
| 549 | std::list<ProjectFile::PropertyFile> ProjectFile::getPropertyFiles(const std::string& name) const |
| 550 | { |
no test coverage detected