本文整理汇总了C++中dynamiccontext::Ptr::outputReceiver方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::outputReceiver方法的具体用法?C++ Ptr::outputReceiver怎么用?C++ Ptr::outputReceiver使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dynamiccontext::Ptr
的用法示例。
在下文中一共展示了Ptr::outputReceiver方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: evaluateToSequenceReceiver
void ComputedNamespaceConstructor::evaluateToSequenceReceiver(const DynamicContext::Ptr &context) const
{
const Item prefixItem(m_operand1->evaluateSingleton(context));
const QString prefix(prefixItem ? prefixItem.stringValue() : QString());
const Item namespaceItem(m_operand2->evaluateSingleton(context));
const QString namespaceURI(namespaceItem ? namespaceItem.stringValue() : QString());
if(namespaceURI.isEmpty())
{
context->error(QtXmlPatterns::tr("In a namespace constructor, the value for a namespace cannot be an empty string."),
ReportContext::XTDE0930,
this);
}
/* One optimization could be to store a pointer to
* the name pool as a member in order to avoid the virtual call(s). */
const NamePool::Ptr np(context->namePool());
if(!prefix.isEmpty() && !QXmlUtils::isNCName(prefix))
{
context->error(QtXmlPatterns::tr("The prefix must be a valid %1, which %2 is not.")
.arg(formatType(np, BuiltinTypes::xsNCName),
formatKeyword(prefix)),
ReportContext::XTDE0920,
this);
}
const QXmlName binding(np->allocateBinding(prefix, namespaceURI));
AnyURI::toQUrl<ReportContext::XTDE0905, DynamicContext::Ptr>(namespaceURI,
context,
this);
if(binding.prefix() == StandardPrefixes::xmlns)
{
context->error(QtXmlPatterns::tr("The prefix %1 cannot be bound.")
.arg(formatKeyword(prefix)),
ReportContext::XTDE0920,
this);
}
if((binding.prefix() == StandardPrefixes::xml && binding.namespaceURI() != StandardNamespaces::xml)
||
(binding.prefix() != StandardPrefixes::xml && binding.namespaceURI() == StandardNamespaces::xml))
{
context->error(QtXmlPatterns::tr("Only the prefix %1 can be bound to %2 and vice versa.")
.arg(formatKeyword(prefix), formatKeyword(namespaceURI)),
ReportContext::XTDE0925,
this);
}
context->outputReceiver()->namespaceBinding(binding);
}
示例3: evaluateToSequenceReceiver
void Expression::evaluateToSequenceReceiver(const DynamicContext::Ptr &context) const
{
QAbstractXmlReceiver *const receiver = context->outputReceiver();
const Item::Iterator::Ptr it(evaluateSequence(context));
Item next(it->next());
while(next)
{
receiver->item(next);
next = it->next();
}
}
示例4: evaluateToSequenceReceiver
void TextNodeConstructor::evaluateToSequenceReceiver(const DynamicContext::Ptr &context) const
{
const Item item(m_operand->evaluateSingleton(context));
QAbstractXmlReceiver *const receiver = context->outputReceiver();
if(item)
{
const QString &v = item.stringValue();
receiver->characters(QStringRef(&v));
}
else
receiver->characters(QStringRef());
}
示例5: 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();
}
示例6: evaluateToSequenceReceiver
void CopyOf::evaluateToSequenceReceiver(const DynamicContext::Ptr &context) const
{
const Item::Iterator::Ptr it(m_operand->evaluateSequence(context));
QAbstractXmlReceiver *const receiver = context->outputReceiver();
Item next(it->next());
while(next)
{
if(next.isNode())
{
const QXmlNodeModelIndex &asNode = next.asNode();
asNode.model()->copyNodeTo(asNode, receiver, m_settings);
}
else
receiver->item(next);
next = it->next();
}
}
示例7: evaluateToSequenceReceiver
void CopyOf::evaluateToSequenceReceiver(const DynamicContext::Ptr &context) const
{
/* Optimization: this completely breaks streaming. We get a call to
* evaluateToSequenceReceiver() but we require heap allocations by calling
* evaluateSequence(). */
const Item::Iterator::Ptr it(m_operand->evaluateSequence(context));
QAbstractXmlReceiver *const receiver = context->outputReceiver();
Item next(it->next());
while(next)
{
if(next.isNode())
{
const QXmlNodeModelIndex &asNode = next.asNode();
asNode.model()->copyNodeTo(asNode, receiver, m_settings);
}
else
receiver->item(next);
next = it->next();
}
}
示例8: evaluateToSequenceReceiver
void NamespaceConstructor::evaluateToSequenceReceiver(const DynamicContext::Ptr &context) const
{
context->outputReceiver()->namespaceBinding(m_binding);
}
示例9: evaluateToSequenceReceiver
void Literal::evaluateToSequenceReceiver(const DynamicContext::Ptr &context) const
{
context->outputReceiver()->item(m_item);
}
示例10: evaluateToSequenceReceiver
void ProcessingInstructionConstructor::evaluateToSequenceReceiver(const DynamicContext::Ptr &context) const
{
QAbstractXmlReceiver *const receiver = context->outputReceiver();
receiver->processingInstruction(evaluateTardata(context), data(context));
}