当前位置: 首页>>代码示例>>C++>>正文


C++ Node::isValid方法代码示例

本文整理汇总了C++中xml::Node::isValid方法的典型用法代码示例。如果您正苦于以下问题:C++ Node::isValid方法的具体用法?C++ Node::isValid怎么用?C++ Node::isValid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在xml::Node的用法示例。


在下文中一共展示了Node::isValid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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());
}
开发者ID:Lemm,项目名称:simbody,代码行数:27,代码来源:Xml.cpp

示例2: if

/*static*/ bool Xml::Text::isA(const Xml::Node& node) 
{   if (!node.isValid()) return false;
    return node.getTiNode().ToText() != 0; }
开发者ID:Lemm,项目名称:simbody,代码行数:3,代码来源:Xml.cpp


注:本文中的xml::Node::isValid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。