本文整理汇总了C++中txExecutionState::pushBool方法的典型用法代码示例。如果您正苦于以下问题:C++ txExecutionState::pushBool方法的具体用法?C++ txExecutionState::pushBool怎么用?C++ txExecutionState::pushBool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类txExecutionState
的用法示例。
在下文中一共展示了txExecutionState::pushBool方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2:
nsresult
txStartLREElement::execute(txExecutionState& aEs)
{
nsresult rv = aEs.mResultHandler->startElement(mPrefix, mLocalName,
mLowercaseLocalName,
mNamespaceID);
NS_ENSURE_SUCCESS(rv, rv);
rv = aEs.pushBool(true);
NS_ENSURE_SUCCESS(rv, rv);
return NS_OK;
}
示例3: Substring
nsresult
txStartElement::execute(txExecutionState& aEs)
{
nsAutoString name;
nsresult rv = mName->evaluateToString(aEs.getEvalContext(), name);
NS_ENSURE_SUCCESS(rv, rv);
int32_t nsId = kNameSpaceID_None;
nsCOMPtr<nsIAtom> prefix;
uint32_t lnameStart = 0;
const char16_t* colon;
if (XMLUtils::isValidQName(name, &colon)) {
if (colon) {
prefix = do_GetAtom(Substring(name.get(), colon));
lnameStart = colon - name.get() + 1;
}
if (mNamespace) {
nsAutoString nspace;
rv = mNamespace->evaluateToString(aEs.getEvalContext(),
nspace);
NS_ENSURE_SUCCESS(rv, rv);
if (!nspace.IsEmpty()) {
nsId = txNamespaceManager::getNamespaceID(nspace);
}
}
else {
nsId = mMappings->lookupNamespace(prefix);
}
}
else {
nsId = kNameSpaceID_Unknown;
}
bool success = true;
if (nsId != kNameSpaceID_Unknown) {
rv = aEs.mResultHandler->startElement(prefix,
Substring(name, lnameStart),
nsId);
}
else {
rv = NS_ERROR_XSLT_BAD_NODE_NAME;
}
if (rv == NS_ERROR_XSLT_BAD_NODE_NAME) {
success = false;
// we call characters with an empty string to "close" any element to
// make sure that no attributes are added
rv = aEs.mResultHandler->characters(EmptyString(), false);
}
NS_ENSURE_SUCCESS(rv, rv);
rv = aEs.pushBool(success);
NS_ENSURE_SUCCESS(rv, rv);
return NS_OK;
}