本文整理汇总了C++中xml::Node::isOrphan方法的典型用法代码示例。如果您正苦于以下问题:C++ Node::isOrphan方法的具体用法?C++ Node::isOrphan怎么用?C++ Node::isOrphan使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xml::Node
的用法示例。
在下文中一共展示了Node::isOrphan方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: insertTopLevelNodeBefore
void Xml::insertTopLevelNodeBefore(const Xml::node_iterator& beforeThis,
Xml::Node insertThis) {
const char* method = "Xml::insertTopLevelNodeBefore()";
// Check that the supplied Node is OK.
SimTK_ERRCHK_ALWAYS(insertThis.isValid(), method,
"The supplied Node handle was empty.");
SimTK_ERRCHK_ALWAYS(insertThis.isOrphan(), method,
"The Node was not an orphan so can't be inserted.");
SimTK_ERRCHK1_ALWAYS(Comment::isA(insertThis) || Unknown::isA(insertThis),
method, "The Node had NodeType %s, but only Comment and Unknown nodes"
" can be inserted at the topmost document level.",
insertThis.getNodeTypeAsString().c_str());
// If no iterator, add the Node to the end and we're done.
if (beforeThis == node_end()) {
updImpl().m_tixml.LinkEndChild(insertThis.updTiNodePtr());
return;
}
// There is an iterator, make sure it's a top-level one.
SimTK_ERRCHK_ALWAYS(beforeThis->isTopLevelNode(), method,
"The node_iterator did not refer to a top-level Node.");
updImpl().m_tixml.LinkBeforeChild(beforeThis->updTiNodePtr(),
insertThis.updTiNodePtr());
}