本文整理汇总了C++中qabstractxmlnodemodel::Ptr类的典型用法代码示例。如果您正苦于以下问题:C++ Ptr类的具体用法?C++ Ptr怎么用?C++ Ptr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Ptr类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: evaluateSingleton
Item CommentConstructor::evaluateSingleton(const DynamicContext::Ptr &context) const
{
const QString content(evaluateContent(context));
const NodeBuilder::Ptr nodeBuilder(context->nodeBuilder(QUrl()));
nodeBuilder->comment(content);
const QAbstractXmlNodeModel::Ptr nm(nodeBuilder->builtDocument());
context->addNodeModel(nm);
return nm->root(QXmlNodeModelIndex());
}
示例2: 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());
}
示例3: 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());
}
示例4: 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());
}
示例5: 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());
}