本文整理汇总了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 );
}
}
示例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" );
}
}
}
}