本文整理汇总了C++中dynamiccontext::Ptr::createReceiverContext方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::createReceiverContext方法的具体用法?C++ Ptr::createReceiverContext怎么用?C++ Ptr::createReceiverContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dynamiccontext::Ptr
的用法示例。
在下文中一共展示了Ptr::createReceiverContext方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例2: 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());
}
示例3: 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();
}
示例4: 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());
}