本文整理汇总了C++中document::Ptr::globalNamespace方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::globalNamespace方法的具体用法?C++ Ptr::globalNamespace怎么用?C++ Ptr::globalNamespace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类document::Ptr
的用法示例。
在下文中一共展示了Ptr::globalNamespace方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: process
void process(Document::Ptr doc, QSet<Namespace *> *processed)
{
if (!doc)
return;
if (!processed->contains(doc->globalNamespace())) {
processed->insert(doc->globalNamespace());
foreach (const Document::Include &i, doc->resolvedIncludes())
process(_snapshot.document(i.resolvedFileName()), processed);
_mainDocument = (doc == _doc); // ### improve
accept(doc->globalNamespace());
}
示例2: ClassDocumentPtrPair
static ClassDocumentPtrPair
findClassRecursively(const LookupContext &context, const QString &className,
unsigned maxIncludeDepth, QString *namespaceName)
{
const Document::Ptr doc = context.thisDocument();
const Snapshot docTable = context.snapshot();
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << doc->fileName() << className << maxIncludeDepth;
// Check document
if (const Class *cl = findClass(doc->globalNamespace(), context, className, namespaceName))
return ClassDocumentPtrPair(cl, doc);
if (maxIncludeDepth) {
// Check the includes
const unsigned recursionMaxIncludeDepth = maxIncludeDepth - 1u;
const auto includedFiles = doc->includedFiles();
for (const QString &include : includedFiles) {
const Snapshot::const_iterator it = docTable.find(include);
if (it != docTable.end()) {
const Document::Ptr includeDoc = it.value();
LookupContext context(includeDoc, docTable);
const ClassDocumentPtrPair irc = findClassRecursively(context, className,
recursionMaxIncludeDepth, namespaceName);
if (irc.first)
return irc;
}
}
}
return ClassDocumentPtrPair(0, Document::Ptr());
}
示例3: accept
void SnapshotSymbolVisitor::accept(Document::Ptr doc, QSet<QString> *processed)
{
if (doc && doc->globalNamespace() && ! processed->contains(doc->fileName())) {
processed->insert(doc->fileName());
foreach (const Document::Include &i, doc->resolvedIncludes()) {
if (Document::Ptr incl = _snapshot.document(i.resolvedFileName()))
accept(incl, processed);
}
std::swap(_document, doc);
accept(_document->globalNamespace());
std::swap(_document, doc);
}