MCPcopy Create free account
hub / github.com/bumptop/BumpTop / getFullyQualifiedNamespaceName

Function getFullyQualifiedNamespaceName

trunk/win/Source/LUpdateString/cpp.cpp:605–635  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

603}
604
605static QStringList getFullyQualifiedNamespaceName(
606 const QSet<QString> &allNamespaces, const QStringList &namespaces,
607 const QHash<QString, QStringList> &namespaceAliases,
608 const QStringList &segments)
609{
610 static QString strColons(QLatin1String("::"));
611
612 if (segments.first().isEmpty()) {
613 // fully qualified
614 QStringList segs = segments;
615 segs.removeFirst();
616 return resolveNamespaces(segs, namespaceAliases);
617 } else {
618 for (int n = namespaces.count(); --n >= -1; ) {
619 QStringList ns;
620 for (int i = 0; i <= n; ++i) // Note: n == -1 possible
621 ns << namespaces[i];
622 foreach (const QString &cns, segments) {
623 ns << cns;
624 ns = namespaceAliases.value(ns.join(strColons), ns);
625 }
626 if (allNamespaces.contains(ns.join(strColons)))
627 return ns;
628 }
629
630 // Fallback when the namespace was declared in a header, etc.
631 QStringList ns = namespaces;
632 ns += segments;
633 return ns;
634 }
635}
636
637static QString getFullyQualifiedClassName(
638 const QSet<QString> &allClasses, const QStringList &namespaces,

Callers 1

parseFunction · 0.85

Calls 8

QLatin1StringClass · 0.85
resolveNamespacesFunction · 0.85
isEmptyMethod · 0.45
firstMethod · 0.45
removeFirstMethod · 0.45
countMethod · 0.45
containsMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected