| 441 | } |
| 442 | |
| 443 | std::list<std::string> ProjectFile::getObjectsOfType(const Base::Type& typeId) const |
| 444 | { |
| 445 | std::list<std::string> names; |
| 446 | if (!xmlDocument) { |
| 447 | return names; |
| 448 | } |
| 449 | |
| 450 | DOMNodeList* nodes = xmlDocument->getElementsByTagName(XStrLiteral("Objects").unicodeForm()); |
| 451 | for (XMLSize_t i = 0; i < nodes->getLength(); i++) { |
| 452 | DOMNode* node = nodes->item(i); |
| 453 | if (node->getNodeType() == DOMNode::ELEMENT_NODE) { |
| 454 | DOMNodeList* objectList = static_cast<DOMElement*>(node)->getElementsByTagName( |
| 455 | XStrLiteral("Object").unicodeForm()); // NOLINT |
| 456 | for (XMLSize_t j = 0; j < objectList->getLength(); j++) { |
| 457 | DOMNode* objectNode = objectList->item(j); |
| 458 | DOMNode* typeAttr = |
| 459 | objectNode->getAttributes()->getNamedItem(XStrLiteral("type").unicodeForm()); |
| 460 | DOMNode* nameAttr = |
| 461 | objectNode->getAttributes()->getNamedItem(XStrLiteral("name").unicodeForm()); |
| 462 | if (typeAttr && nameAttr) { |
| 463 | if (Base::Type::fromName(StrX(typeAttr->getNodeValue()).c_str()) == typeId) { |
| 464 | names.emplace_back(StrX(nameAttr->getNodeValue()).c_str()); |
| 465 | } |
| 466 | } |
| 467 | } |
| 468 | } |
| 469 | } |
| 470 | |
| 471 | return names; |
| 472 | } |
| 473 | |
| 474 | bool ProjectFile::restoreObject(const std::string& name, App::PropertyContainer* obj, bool verbose) |
| 475 | { |
nothing calls this directly
no test coverage detected