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

Function getFullyQualifiedClassName

trunk/win/Source/LUpdateString/cpp.cpp:637–673  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

635}
636
637static QString getFullyQualifiedClassName(
638 const QSet<QString> &allClasses, const QStringList &namespaces,
639 const QHash<QString, QStringList> &namespaceAliases,
640 const QString &ident, bool hasPrefix)
641{
642 static QString strColons(QLatin1String("::"));
643
644 QString context = ident;
645 QStringList segments = context.split(strColons);
646 if (segments.first().isEmpty()) {
647 // fully qualified
648 segments.removeFirst();
649 context = resolveNamespaces(segments, namespaceAliases).join(strColons);
650 } else {
651 for (int n = namespaces.count(); --n >= -1; ) {
652 QStringList ns;
653 for (int i = 0; i <= n; ++i) // Note: n == -1 possible
654 ns.append(namespaces[i]);
655 foreach (const QString &cns, segments) {
656 ns.append(cns);
657 ns = namespaceAliases.value(ns.join(strColons), ns);
658 }
659 QString nctx = ns.join(strColons);
660 if (allClasses.contains(nctx)) {
661 context = nctx;
662 goto gotit;
663 }
664 }
665
666 if (!hasPrefix && namespaces.count())
667 context = namespaces.join(strColons) + strColons + context;
668 }
669gotit:
670 //qDebug() << "CLASSES:" << allClasses << "NAMEPACES:" << namespaces
671 // << "IDENT:" << ident << "CONTEXT:" << context;
672 return context;
673}
674
675
676static QString transcode(const QString &str, bool utf8)

Callers 1

parseFunction · 0.85

Calls 10

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

Tested by

no test coverage detected