本文整理汇总了C++中txExecutionState::gotoInstruction方法的典型用法代码示例。如果您正苦于以下问题:C++ txExecutionState::gotoInstruction方法的具体用法?C++ txExecutionState::gotoInstruction怎么用?C++ txExecutionState::gotoInstruction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类txExecutionState
的用法示例。
在下文中一共展示了txExecutionState::gotoInstruction方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
nsresult
txGoTo::execute(txExecutionState& aEs)
{
aEs.gotoInstruction(mTarget);
return NS_OK;
}
示例2: txNodeSetContext
nsresult
txPushNewContext::execute(txExecutionState& aEs)
{
RefPtr<txAExprResult> exprRes;
nsresult rv = mSelect->evaluate(aEs.getEvalContext(),
getter_AddRefs(exprRes));
NS_ENSURE_SUCCESS(rv, rv);
if (exprRes->getResultType() != txAExprResult::NODESET) {
// XXX ErrorReport: nodeset expected
return NS_ERROR_XSLT_NODESET_EXPECTED;
}
txNodeSet* nodes = static_cast<txNodeSet*>
(static_cast<txAExprResult*>
(exprRes));
if (nodes->isEmpty()) {
aEs.gotoInstruction(mBailTarget);
return NS_OK;
}
txNodeSorter sorter;
uint32_t i, count = mSortKeys.Length();
for (i = 0; i < count; ++i) {
SortKey& sort = mSortKeys[i];
rv = sorter.addSortElement(sort.mSelectExpr, sort.mLangExpr,
sort.mDataTypeExpr, sort.mOrderExpr,
sort.mCaseOrderExpr,
aEs.getEvalContext());
NS_ENSURE_SUCCESS(rv, rv);
}
RefPtr<txNodeSet> sortedNodes;
rv = sorter.sortNodeSet(nodes, &aEs, getter_AddRefs(sortedNodes));
NS_ENSURE_SUCCESS(rv, rv);
txNodeSetContext* context = new txNodeSetContext(sortedNodes, &aEs);
NS_ENSURE_TRUE(context, NS_ERROR_OUT_OF_MEMORY);
context->next();
rv = aEs.pushEvalContext(context);
if (NS_FAILED(rv)) {
delete context;
return rv;
}
return NS_OK;
}
示例3: switch
nsresult
txCopy::execute(txExecutionState& aEs)
{
nsresult rv = NS_OK;
const txXPathNode& node = aEs.getEvalContext()->getContextNode();
switch (txXPathNodeUtils::getNodeType(node)) {
case txXPathNodeType::DOCUMENT_NODE:
case txXPathNodeType::DOCUMENT_FRAGMENT_NODE:
{
const nsAFlatString& empty = EmptyString();
// "close" current element to ensure that no attributes are added
rv = aEs.mResultHandler->characters(empty, false);
NS_ENSURE_SUCCESS(rv, rv);
rv = aEs.pushBool(false);
NS_ENSURE_SUCCESS(rv, rv);
break;
}
case txXPathNodeType::ELEMENT_NODE:
{
nsCOMPtr<nsIAtom> localName =
txXPathNodeUtils::getLocalName(node);
rv = aEs.mResultHandler->
startElement(txXPathNodeUtils::getPrefix(node),
localName, nullptr,
txXPathNodeUtils::getNamespaceID(node));
NS_ENSURE_SUCCESS(rv, rv);
// XXX copy namespace nodes once we have them
rv = aEs.pushBool(true);
NS_ENSURE_SUCCESS(rv, rv);
break;
}
default:
{
rv = copyNode(node, aEs);
NS_ENSURE_SUCCESS(rv, rv);
aEs.gotoInstruction(mBailTarget);
}
}
return NS_OK;
}