本文整理汇总了C++中txExecutionState::popResultHandler方法的典型用法代码示例。如果您正苦于以下问题:C++ txExecutionState::popResultHandler方法的具体用法?C++ txExecutionState::popResultHandler怎么用?C++ txExecutionState::popResultHandler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类txExecutionState
的用法示例。
在下文中一共展示了txExecutionState::popResultHandler方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rtfHandler
nsresult
txSetParam::execute(txExecutionState& aEs)
{
nsresult rv = NS_OK;
if (!aEs.mTemplateParams) {
aEs.mTemplateParams = new txVariableMap;
NS_ENSURE_TRUE(aEs.mTemplateParams, NS_ERROR_OUT_OF_MEMORY);
}
RefPtr<txAExprResult> exprRes;
if (mValue) {
rv = mValue->evaluate(aEs.getEvalContext(),
getter_AddRefs(exprRes));
NS_ENSURE_SUCCESS(rv, rv);
}
else {
nsAutoPtr<txRtfHandler> rtfHandler(
static_cast<txRtfHandler*>(aEs.popResultHandler()));
rv = rtfHandler->getAsRTF(getter_AddRefs(exprRes));
NS_ENSURE_SUCCESS(rv, rv);
}
rv = aEs.mTemplateParams->bindVariable(mName, exprRes);
NS_ENSURE_SUCCESS(rv, rv);
return NS_OK;
}
示例2: logString
nsresult
txMessage::execute(txExecutionState& aEs)
{
nsAutoPtr<txTextHandler> handler(
static_cast<txTextHandler*>(aEs.popResultHandler()));
nsCOMPtr<nsIConsoleService> consoleSvc =
do_GetService("@mozilla.org/consoleservice;1");
if (consoleSvc) {
nsAutoString logString(NS_LITERAL_STRING("xsl:message - "));
logString.Append(handler->mValue);
consoleSvc->LogStringMessage(logString.get());
}
return mTerminate ? NS_ERROR_XSLT_ABORTED : NS_OK;
}
示例3: handler
nsresult
txComment::execute(txExecutionState& aEs)
{
nsAutoPtr<txTextHandler> handler(
static_cast<txTextHandler*>(aEs.popResultHandler()));
uint32_t length = handler->mValue.Length();
int32_t pos = 0;
while ((pos = handler->mValue.FindChar('-', (uint32_t)pos)) != kNotFound) {
++pos;
if ((uint32_t)pos == length || handler->mValue.CharAt(pos) == '-') {
handler->mValue.Insert(char16_t(' '), pos++);
++length;
}
}
return aEs.mResultHandler->comment(handler->mValue);
}
示例4: if
nsresult
txAttribute::execute(txExecutionState& aEs)
{
nsAutoPtr<txTextHandler> handler(
static_cast<txTextHandler*>(aEs.popResultHandler()));
nsAutoString name;
nsresult rv = mName->evaluateToString(aEs.getEvalContext(), name);
NS_ENSURE_SUCCESS(rv, rv);
const char16_t* colon;
if (!XMLUtils::isValidQName(name, &colon) ||
TX_StringEqualsAtom(name, nsGkAtoms::xmlns)) {
return NS_OK;
}
nsCOMPtr<nsIAtom> prefix;
uint32_t lnameStart = 0;
if (colon) {
prefix = do_GetAtom(Substring(name.get(), colon));
lnameStart = colon - name.get() + 1;
}
int32_t nsId = kNameSpaceID_None;
if (mNamespace) {
nsAutoString nspace;
rv = mNamespace->evaluateToString(aEs.getEvalContext(),
nspace);
NS_ENSURE_SUCCESS(rv, rv);
if (!nspace.IsEmpty()) {
nsId = txNamespaceManager::getNamespaceID(nspace);
}
}
else if (colon) {
nsId = mMappings->lookupNamespace(prefix);
}
// add attribute if everything was ok
return nsId != kNameSpaceID_Unknown ?
aEs.mResultHandler->attribute(prefix, Substring(name, lnameStart),
nsId, handler->mValue) :
NS_OK;
}