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


C++ NodeSet::pushBack方法代码示例

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


在下文中一共展示了NodeSet::pushBack方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: resolveNodeAndPushToNodeSet

 void XemProcessor::resolveNodeAndPushToNodeSet ( NodeSet& result, const String& nodeIdStr )
 {
   KeyId attributeKeyId = 0;
   ElementRef resolvedElement = resolveElementWithRole ( nodeIdStr, attributeKeyId );
   if ( !resolvedElement )
     {
       throwException ( Exception, "Could not resolve element fro '%s'.\n", nodeIdStr.c_str() );
     }
   if ( attributeKeyId )
     {
       AttributeRef attrRef = resolvedElement.findAttr ( attributeKeyId, AttributeType_String );
       if ( ! attrRef )
         {
           throwException ( Exception, "Could not get attr '%x' in element %s from '%s'\n", attributeKeyId,
               resolvedElement.generateVersatileXPath().c_str(), nodeIdStr.c_str() );
         }
       Log_XemRoleBased ( "Pushing attribute '%s'\n", attrRef.generateVersatileXPath().c_str() );
       result.pushBack ( attrRef );
     }
   else
     {
       Log_XemRoleBased ( "Pushing element '%s'\n", resolvedElement.generateVersatileXPath().c_str() );
       result.pushBack ( resolvedElement );
     }
 }
开发者ID:Doloops,项目名称:Xemeiah,代码行数:25,代码来源:xem-rolebased.cpp

示例2: evalFunctionKeyGet

  void XPath::evalFunctionKeyGet ( ElementMultiMapRef& map,
      XPath& useXPath, NodeSet& resultNodeSet, String& value )
  {
    __ui64 hash = SKMapRef::hashString ( value );
    Log_EvalKey ( "Computed value : '%s', hash='%llx'\n", value.c_str(), hash );

    for ( SKMultiMapRef::multi_iterator miter ( map, hash ); miter ; miter++ )
      {
        Log_EvalKey ( "Found iter %llx, val=%llx\n", miter.getHash(), miter.getValue() );
        if ( miter.getHash() != hash )
          {
            Log_EvalKey ( "Diverging keys : %llx != %llx\n", miter.getHash(), hash );
            break;
          }
        ElementRef foundElt = map.get ( miter );
        Log_EvalKey ( "Found elt=0x%llx\n", foundElt.getElementId() );
        // AssertBug ( foundElt.getElementId(), "Null elementId ! Element was deleted ?\n" );
        NodeSet foundValue;
        useXPath.eval ( foundValue, foundElt );
        for ( NodeSet::iterator valiter ( foundValue ) ; valiter ; valiter++ )
          {
            String eltValue = valiter->toString();
            Log_EvalKey ( "Found node 0x%llx:%s, eltValue='%s'\n", foundElt.getElementId(), foundElt.getKey().c_str(), eltValue.c_str() );
            if ( eltValue == value )
              {
                resultNodeSet.pushBack ( foundElt, true );
                Log_EvalKey ( "Matches !\n" );
              }
            
          }
      }
  }  
开发者ID:Doloops,项目名称:Xemeiah,代码行数:32,代码来源:xpath-key.cpp


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