本文整理汇总了C++中namepool::Ptr::allocateQName方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::allocateQName方法的具体用法?C++ Ptr::allocateQName怎么用?C++ Ptr::allocateQName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类namepool::Ptr
的用法示例。
在下文中一共展示了Ptr::allocateQName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: name
QXmlName AnySimpleType::name(const NamePool::Ptr &np) const
{
return np->allocateQName(StandardNamespaces::xs, QLatin1String("anySimpleType"));
}
示例2: streamToReceiver
bool AccelTreeResourceLoader::streamToReceiver(QIODevice *const dev,
AccelTreeBuilder<true> *const receiver,
const NamePool::Ptr &np,
const ReportContext::Ptr &context,
const QUrl &uri)
{
Q_ASSERT(dev);
Q_ASSERT(receiver);
Q_ASSERT(np);
QXmlStreamReader reader(dev);
/* Optimize: change NamePool to take QStringRef such that we don't have to call toString() below. That
* will save us a gazillion of temporary QStrings. */
while(!reader.atEnd())
{
reader.readNext();
switch(reader.tokenType())
{
case QXmlStreamReader::StartElement:
{
/* Send the name. */
receiver->startElement(np->allocateQName(reader.namespaceUri().toString(), reader.name().toString(),
reader.prefix().toString()), reader.lineNumber(), reader.columnNumber());
/* Send namespace declarations. */
const QXmlStreamNamespaceDeclarations &nss = reader.namespaceDeclarations();
/* The far most common case, is for it to be empty. */
if(!nss.isEmpty())
{
const int len = nss.size();
for(int i = 0; i < len; ++i)
{
const QXmlStreamNamespaceDeclaration &ns = nss.at(i);
receiver->namespaceBinding(np->allocateBinding(ns.prefix().toString(), ns.namespaceUri().toString()));
}
}
/* Send attributes. */
const QXmlStreamAttributes &attrs = reader.attributes();
const int len = attrs.size();
for(int i = 0; i < len; ++i)
{
const QXmlStreamAttribute &attr = attrs.at(i);
receiver->attribute(np->allocateQName(attr.namespaceUri().toString(), attr.name().toString(),
attr.prefix().toString()),
attr.value());
}
continue;
}
case QXmlStreamReader::EndElement:
{
receiver->endElement();
continue;
}
case QXmlStreamReader::Characters:
{
if(reader.isWhitespace())
receiver->whitespaceOnly(reader.text());
else
receiver->characters(reader.text());
continue;
}
case QXmlStreamReader::Comment:
{
receiver->comment(reader.text().toString());
continue;
}
case QXmlStreamReader::ProcessingInstruction:
{
receiver->processingInstruction(np->allocateQName(QString(), reader.processingInstructionTarget().toString()),
reader.processingInstructionData().toString());
continue;
}
case QXmlStreamReader::StartDocument:
{
receiver->startDocument();
continue;
}
case QXmlStreamReader::EndDocument:
{
receiver->endDocument();
continue;
}
case QXmlStreamReader::EntityReference:
/* Fallthrough. */
case QXmlStreamReader::DTD:
{
/* We just ignore any DTD and entity references. */
continue;
}
case QXmlStreamReader::Invalid:
//.........这里部分代码省略.........
示例3: name
QXmlName Untyped::name(const NamePool::Ptr &np) const
{
return np->allocateQName(StandardNamespaces::xs, QLatin1String("untyped"));
}