本文整理汇总了C++中dynamiccontext::Ptr类的典型用法代码示例。如果您正苦于以下问题:C++ Ptr类的具体用法?C++ Ptr怎么用?C++ Ptr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Ptr类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: evaluateToSequenceReceiver
void DocumentConstructor::evaluateToSequenceReceiver(const DynamicContext::Ptr &context) const
{
QAbstractXmlReceiver *const receiver = context->outputReceiver();
DocumentContentValidator validator(receiver, context, ConstPtr(this));
const DynamicContext::Ptr receiverContext(context->createReceiverContext(&validator));
validator.startDocument();
m_operand->evaluateToSequenceReceiver(receiverContext);
validator.endDocument();
}
开发者ID:,项目名称:,代码行数:12,代码来源:
示例2: source
Item::Iterator::Ptr AxisStep::evaluateSequence(const DynamicContext::Ptr &context) const
{
/* If we don't have a focus, it's either a bug or our parent isn't a Path
* that have advanced the focus iterator. Hence, attempt to advance the focus on our own. */
if(!context->contextItem())
context->focusIterator()->next();
Q_ASSERT(context->contextItem());
const QXmlNodeModelIndex::Iterator::Ptr source(context->contextItem().asNode().iterate(m_axis));
return makeItemMappingIterator<Item>(ConstPtr(this), source, context);
}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.vendor,代码行数:13,代码来源:qaxisstep.cpp
示例3: evaluateSingleton
Item PrefixFromQNameFN::evaluateSingleton(const DynamicContext::Ptr &context) const
{
const QNameValue::Ptr arg(m_operands.first()->evaluateSingleton(context).as<QNameValue>());
if(!arg)
return Item();
const QString prefix(context->namePool()->stringForPrefix(arg->qName().prefix()));
if(prefix.isEmpty())
return Item();
else
return AtomicString::fromValue(context->namePool()->stringForPrefix(arg->qName().prefix()));
}
开发者ID:kileven,项目名称:qt5,代码行数:13,代码来源:qqnamefns.cpp
示例4: topFocusContext
Item EvaluationCache<IsForGlobal>::evaluateSingleton(const DynamicContext::Ptr &context) const
{
ItemCacheCell &cell = IsForGlobal ? context->globalItemCacheCell(m_varSlot) : context->itemCacheCell(m_varSlot);
if(cell.cacheState == ItemCacheCell::Full)
return cell.cachedItem;
else
{
Q_ASSERT(cell.cacheState == ItemCacheCell::Empty);
cell.cachedItem = m_operand->evaluateSingleton(IsForGlobal ? topFocusContext(context) : context);
cell.cacheState = ItemCacheCell::Full;
return cell.cachedItem;
}
}
开发者ID:KDE,项目名称:android-qt,代码行数:14,代码来源:qevaluationcache.cpp
示例5: checkTargetNode
void ContextNodeChecker::checkTargetNode(const QXmlNodeModelIndex &node,
const DynamicContext::Ptr &context,
const ReportContext::ErrorCode code) const
{
if(node.root().kind() != QXmlNodeModelIndex::Document)
{
context->error(QtXmlPatterns::tr("The root node of the second argument "
"to function %1 must be a document "
"node. %2 is not a document node.")
.arg(formatFunction(context->namePool(), signature()),
formatData(node)),
code, this);
}
}
开发者ID:RobinWuDev,项目名称:Qt,代码行数:14,代码来源:qcontextnodechecker.cpp
示例6: evaluateSingleton
Item AttributeConstructor::evaluateSingleton(const DynamicContext::Ptr &context) const
{
const Item nameItem(m_operand1->evaluateSingleton(context));
const Item content(m_operand2->evaluateSingleton(context));
const QXmlName name(nameItem.as<QNameValue>()->qName());
const QString value(processValue(name, content ? content.stringValue() : QString()));
const NodeBuilder::Ptr nodeBuilder(context->nodeBuilder(QUrl()));
nodeBuilder->attribute(name, QStringRef(&value));
const QAbstractXmlNodeModel::Ptr nm(nodeBuilder->builtDocument());
context->addNodeModel(nm);
return nm->root(QXmlNodeModelIndex());
}
开发者ID:FilipBE,项目名称:qtextended,代码行数:15,代码来源:qattributeconstructor.cpp
示例7: next
Item::Iterator::Ptr CardinalityVerifier::evaluateSequence(const DynamicContext::Ptr &context) const
{
const Item::Iterator::Ptr it(m_operand->evaluateSequence(context));
const Item next(it->next());
if(next)
{
const Item next2(it->next());
if(next2)
{
if(m_reqCard.allowsMany())
{
Item::List start;
start.append(next);
start.append(next2);
return Item::Iterator::Ptr(new InsertionIterator(it, 1, makeListIterator(start)));
}
else
{
context->error(wrongCardinality(m_reqCard, Cardinality::twoOrMore()), m_errorCode, this);
return CommonValues::emptyIterator;
}
}
else
{
/* We might be instantiated for the empty sequence. */
if(m_reqCard.isEmpty())
{
context->error(wrongCardinality(m_reqCard, Cardinality::twoOrMore()), m_errorCode, this);
return CommonValues::emptyIterator;
}
else
return makeSingletonIterator(next);
}
}
else
{
if(m_reqCard.allowsEmpty())
return CommonValues::emptyIterator;
else
{
context->error(wrongCardinality(m_reqCard, Cardinality::twoOrMore()), m_errorCode, this);
return CommonValues::emptyIterator;
}
}
}
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:48,代码来源:qcardinalityverifier.cpp
示例8: next
Item::Iterator::Ptr Path::evaluateSequence(const DynamicContext::Ptr &context) const
{
/* Note, we use the old context for m_operand1. */
const Item::Iterator::Ptr source(m_operand1->evaluateSequence(context));
const DynamicContext::Ptr focus(context->createFocus());
focus->setFocusIterator(source);
const Item::Iterator::Ptr result(makeSequenceMappingIterator<Item>(ConstPtr(this), source, focus));
if(m_checkXPTY0018)
{
/* This is an expensive code path, but it should happen very rarely. */
enum FoundItem
{
FoundNone,
FoundNode,
FoundAtomicValue
} hasFound = FoundNone;
Item::List whenChecked;
Item next(result->next());
while(next)
{
const FoundItem found = next.isAtomicValue() ? FoundAtomicValue : FoundNode;
if(hasFound != FoundNone && hasFound != found)
{
/* It's an atomic value and we've already found a node. Mixed content. */
context->error(QtXmlPatterns::tr("The last step in a path must contain either nodes "
"or atomic values. It cannot be a mixture between the two."),
ReportContext::XPTY0018, this);
}
else
hasFound = found;
whenChecked.append(next);
next = result->next();
}
return makeListIterator(whenChecked);
}
else
return result;
}
开发者ID:krysanto,项目名称:steamlink-sdk,代码行数:48,代码来源:qpath.cpp
示例9: evaluateSingleton
Item DocumentConstructor::evaluateSingleton(const DynamicContext::Ptr &context) const
{
NodeBuilder::Ptr nodeBuilder(context->nodeBuilder(m_staticBaseURI));
DocumentContentValidator validator(nodeBuilder.data(), context, ConstPtr(this));
const DynamicContext::Ptr receiverContext(context->createReceiverContext(&validator));
validator.startDocument();
m_operand->evaluateToSequenceReceiver(receiverContext);
validator.endDocument();
const QAbstractXmlNodeModel::Ptr nm(nodeBuilder->builtDocument());
context->addNodeModel(nm);
return nm->root(QXmlNodeModelIndex());
}
开发者ID:kileven,项目名称:qt5,代码行数:16,代码来源:qdocumentconstructor.cpp
示例10: evaluateToSequenceReceiver
void CommentConstructor::evaluateToSequenceReceiver(const DynamicContext::Ptr &context) const
{
const QString content(evaluateContent(context));
QAbstractXmlReceiver *const receiver = context->outputReceiver();
receiver->comment(content);
}
开发者ID:AtlantisCD9,项目名称:Qt,代码行数:7,代码来源:qcommentconstructor.cpp
示例11: mapToItem
/**
* Performs the actual tracing.
*/
Item mapToItem(const Item &item,
const DynamicContext::Ptr &context)
{
QTextStream out(stderr);
++m_position;
if(m_position == 1)
{
if(item)
{
out << qPrintable(m_msg)
<< " : "
<< qPrintable(item.stringValue());
}
else
{
out << qPrintable(m_msg)
<< " : ("
<< qPrintable(formatType(context->namePool(), CommonSequenceTypes::Empty))
<< ")\n";
return Item();
}
}
else
{
out << qPrintable(item.stringValue())
<< '['
<< m_position
<< "]\n";
}
return item;
}
开发者ID:,项目名称:,代码行数:35,代码来源:
示例12: evaluateToSequenceReceiver
void ElementConstructor::evaluateToSequenceReceiver(const DynamicContext::Ptr &context) const
{
/* We create an OutputValidator here too. If we're serializing(a common case, unfortunately)
* the receiver is already validating in order to catch cases where a computed attribute
* constructor is followed by an element constructor, but in the cases where we're not serializing
* it's necessary that we validate in this step. */
const Item name(m_operand1->evaluateSingleton(context));
QAbstractXmlReceiver *const receiver = context->outputReceiver();
OutputValidator validator(receiver, context, this);
const DynamicContext::Ptr receiverContext(context->createReceiverContext(&validator));
receiver->startElement(name.as<QNameValue>()->qName());
m_operand2->evaluateToSequenceReceiver(receiverContext);
receiver->endElement();
}
开发者ID:pk-codebox-evo,项目名称:remixos-usb-tool,代码行数:16,代码来源:qelementconstructor.cpp
示例13: evaluateSingleton
Item CastAs::evaluateSingleton(const DynamicContext::Ptr &context) const
{
Q_ASSERT(context);
const Item val(m_operand->evaluateSingleton(context));
if(val)
return cast(val, context);
else
{
/* No item supplied, let's handle the cardinality part. */
if(m_targetType->cardinality().allowsEmpty())
return Item();
else
{
Q_ASSERT(context);
context->error(QtXmlPatterns::tr("Type error in cast, expected %1, "
"received %2.")
.arg(formatType(Cardinality::exactlyOne()))
.arg(formatType(Cardinality::empty())),
ReportContext::XPTY0004, this);
return Item();
}
}
}
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:25,代码来源:qcastas.cpp
示例14: determineNormalizationForm
int NormalizeUnicodeFN::determineNormalizationForm(const DynamicContext::Ptr &context) const
{
const QString strRepr(m_operands.last()->evaluateSingleton(context).stringValue().trimmed().toUpper());
/* TODO. Put these values in a QHash for faster lookup. Keep thread safety in mind. */
if(strRepr.isEmpty())
return -1;
else if(strRepr == QLatin1String("NFC"))
return QString::NormalizationForm_C;
else if(strRepr == QLatin1String("NFD"))
return QString::NormalizationForm_D;
else if(strRepr == QLatin1String("NFKC"))
return QString::NormalizationForm_KC;
else if(strRepr == QLatin1String("NFKD"))
return QString::NormalizationForm_KD;
else
{
/* What form is FULLY_NORMALIZED? Is a code path available for that somewhere? */
context->error(QtXmlPatterns::tr("The normalization form %1 is "
"unsupported. The supported forms are "
"%2, %3, %4, and %5, and none, i.e. "
"the empty string (no normalization).")
.arg(formatKeyword(strRepr))
.arg(formatKeyword("NFC"))
.arg(formatKeyword("NFD"))
.arg(formatKeyword("NFKC"))
.arg(formatKeyword("NFKD")),
ReportContext::FOCH0003,
this);
return QString::NormalizationForm_C; /* Silence compiler warning. */
}
}
开发者ID:wpbest,项目名称:copperspice,代码行数:32,代码来源:qstringvaluefns.cpp
示例15: evaluateSingleton
Item TextNodeConstructor::evaluateSingleton(const DynamicContext::Ptr &context) const
{
const Item chars(m_operand->evaluateSingleton(context));
if(!chars)
return Item();
const NodeBuilder::Ptr nodeBuilder(context->nodeBuilder(QUrl()));
const QString &v = chars.stringValue();
nodeBuilder->characters(QStringRef(&v));
const QAbstractXmlNodeModel::Ptr nm(nodeBuilder->builtDocument());
context->addNodeModel(nm);
return nm->root(QXmlNodeModelIndex());
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:16,代码来源:qtextnodeconstructor.cpp
示例16: evaluateSingleton
Item CodepointsToStringFN::evaluateSingleton(const DynamicContext::Ptr &context) const
{
const Item::Iterator::Ptr it(m_operands.first()->evaluateSequence(context));
if(!it)
return CommonValues::EmptyString;
QString retval;
Item item(it->next());
while(item)
{
const qint32 cp = static_cast<qint32>(item.as<Numeric>()->toInteger());
if(!isValidXML10Char(cp))
{
context->error(QtXmlPatterns::tr("%1 is not a valid XML 1.0 character.")
.arg(formatData(QLatin1String("0x") +
QString::number(cp, 16))),
ReportContext::FOCH0001, this);
return CommonValues::EmptyString;
}
retval.append(QChar(cp));
item = it->next();
}
return AtomicString::fromValue(retval);
}
开发者ID:dewhisna,项目名称:emscripten-qt,代码行数:28,代码来源:qassemblestringfns.cpp
示例17: evaluateSingleton
Item ElementConstructor::evaluateSingleton(const DynamicContext::Ptr &context) const
{
const Item name(m_operand1->evaluateSingleton(context));
const NodeBuilder::Ptr nodeBuilder(context->nodeBuilder(m_staticBaseURI));
OutputValidator validator(nodeBuilder.data(), context, this, m_isXSLT);
const DynamicContext::Ptr receiverContext(context->createReceiverContext(&validator));
nodeBuilder->startElement(name.as<QNameValue>()->qName());
m_operand2->evaluateToSequenceReceiver(receiverContext);
nodeBuilder->endElement();
const QAbstractXmlNodeModel::Ptr nm(nodeBuilder->builtDocument());
context->addNodeModel(nm);
return nm->root(QXmlNodeModelIndex());
}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.vendor,代码行数:18,代码来源:qelementconstructor.cpp
示例18: evaluateEBV
bool DocAvailableFN::evaluateEBV(const DynamicContext::Ptr &context) const
{
const Item itemURI(m_operands.first()->evaluateSingleton(context));
/* 15.5.4 fn:doc reads: "If $uri is the empty sequence, the result is an empty sequence."
* Hence, we return false for the empty sequence, because this doesn't hold true:
* "If this function returns true, then calling fn:doc($uri) within
* the same execution scope must return a document node."(15.5.5 fn:doc-available) */
if(!itemURI)
return false;
/* These two lines are duplicated in DocFN::evaluateSingleton(), as part
* of a workaround for solaris-cc-64. */
const QUrl mayRela(AnyURI::toQUrl<ReportContext::FODC0005>(itemURI.stringValue(), context, this));
const QUrl uri(context->resolveURI(mayRela, staticBaseURI()));
Q_ASSERT(!uri.isRelative());
return context->resourceLoader()->isDocumentAvailable(uri);
}
开发者ID:krysanto,项目名称:steamlink-sdk,代码行数:19,代码来源:qsequencegeneratingfns.cpp
示例19: bindVariables
DynamicContext::Ptr UserFunctionCallsite::bindVariables(const DynamicContext::Ptr &context) const
{
const DynamicContext::Ptr stackContext(context->createStack());
Q_ASSERT(stackContext);
const Expression::List::const_iterator end(m_operands.constEnd());
Expression::List::const_iterator it(m_operands.constBegin());
VariableSlotID slot = m_expressionSlotOffset;
for(; it != end; ++it)
{
stackContext->setExpressionVariable(slot,
Expression::Ptr(new DynamicContextStore(*it, context)));
++slot;
}
return stackContext;
}
开发者ID:,项目名称:,代码行数:19,代码来源:
示例20: switch
Item::Iterator::Ptr EvaluationCache<IsForGlobal>::evaluateSequence(const DynamicContext::Ptr &context) const
{
ItemSequenceCacheCell::Vector &cells = IsForGlobal ? context->globalItemSequenceCacheCells(m_varSlot) : context->itemSequenceCacheCells(m_varSlot);
ItemSequenceCacheCell &cell = cells[m_varSlot];
if(cell.inUse)
{
context->error(QtXmlPatterns::tr("Circularity detected"),
ReportContext::XTDE0640, this);
}
switch(cell.cacheState)
{
case ItemSequenceCacheCell::Full:
{
/**
* We don't use makeListIterator() here because the MIPSPro compiler can't handle it.
*/
return Item::Iterator::Ptr(new ListIterator<Item, Item::List>(cell.cachedItems));
}
case ItemSequenceCacheCell::Empty:
{
cell.inUse = true;
cell.sourceIterator = m_operand->evaluateSequence(IsForGlobal ? topFocusContext(context) : context);
cell.cacheState = ItemSequenceCacheCell::PartiallyPopulated;
/* Fallthrough. */
}
case ItemSequenceCacheCell::PartiallyPopulated:
{
cell.inUse = false;
Q_ASSERT_X(cells.at(m_varSlot).sourceIterator, Q_FUNC_INFO,
"This trigger for a cache bug which hasn't yet been analyzed.");
return Item::Iterator::Ptr(new CachingIterator(cells, m_varSlot, IsForGlobal ? topFocusContext(context) : context));
}
default:
{
Q_ASSERT_X(false, Q_FUNC_INFO, "This path is not supposed to be run.");
return Item::Iterator::Ptr();
}
}
}
开发者ID:KDE,项目名称:android-qt,代码行数:42,代码来源:qevaluationcache.cpp
注:本文中的dynamiccontext::Ptr类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论