diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2000-09-10 15:26:30 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2000-09-10 15:26:30 (GMT) |
commit | 69ead65c747f7fa7817c0a754dfe2662004037a1 (patch) | |
tree | 19b06b53ec293b6d690ff3d82f256f67576dee1c /src/util.cpp | |
parent | 92663f876495b7d98aa85d604d0149f8b73c8dc7 (diff) | |
download | Doxygen-69ead65c747f7fa7817c0a754dfe2662004037a1.zip Doxygen-69ead65c747f7fa7817c0a754dfe2662004037a1.tar.gz Doxygen-69ead65c747f7fa7817c0a754dfe2662004037a1.tar.bz2 |
Release-20000910
Diffstat (limited to 'src/util.cpp')
-rw-r--r-- | src/util.cpp | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/src/util.cpp b/src/util.cpp index 61770bc..d2691ce 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -314,6 +314,31 @@ ClassDef *getClass(const char *name) return classDict[name]; } +NamespaceDef *getResolvedNamespace(const char *name) +{ + if (name==0 || name[0]=='\0') return 0; + QCString *subst = namespaceAliasDict[name]; + if (subst) + { + int count=0; // recursion detection guard + QCString *newSubst; + while ((newSubst=namespaceAliasDict[*subst]) && count<10) + { + subst=newSubst; + count++; + } + if (count==10) + { + warn_cont("Warning: possible recursive namespace alias detected for %s!\n",name); + } + return namespaceDict[subst->data()]; + } + else + { + return namespaceDict[name]; + } +} + ClassDef *getResolvedClass(const char *name) { if (name==0 || name[0]=='\0') return 0; @@ -2434,9 +2459,10 @@ void extractNamespaceName(const QCString &scopeName, { QCString clName=scopeName.copy(); //QCString nsName; - if (!clName.isEmpty() && namespaceDict[clName] && getClass(clName)==0) + NamespaceDef *nd; + if (!clName.isEmpty() && (nd=getResolvedNamespace(clName)) && getClass(clName)==0) { // the whole name is a namespace (and not a class) - namespaceName=clName.copy(); + namespaceName=nd->name().copy(); className.resize(0); //printf("extractNamespace `%s' => `%s|%s'\n",scopeName.data(), // className.data(),namespaceName.data()); @@ -2446,9 +2472,9 @@ void extractNamespaceName(const QCString &scopeName, while (p>=0 && (i=clName.findRev("::",p))!=-1) // see if the first part is a namespace (and not a class) { - if (i>0 && namespaceDict[clName.left(i)] && getClass(clName.left(i))==0) + if (i>0 && (nd=getResolvedNamespace(clName.left(i))) && getClass(clName.left(i))==0) { - namespaceName=clName.left(i); + namespaceName=nd->name().copy(); className=clName.right(clName.length()-i-2); //printf("extractNamespace `%s' => `%s|%s'\n",scopeName.data(), // className.data(),namespaceName.data()); |