summaryrefslogtreecommitdiffstats
path: root/src/doxygen.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2014-09-11 18:21:24 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2014-09-11 18:21:24 (GMT)
commit9879fddbf8f91c57b258b8e788b5ed8a150a8331 (patch)
treebb07db8823e9c8104182b0d8a0e58382d57fc37e /src/doxygen.cpp
parent561a996c68f796dccb36fb3eed6150fcc90e5634 (diff)
downloadDoxygen-9879fddbf8f91c57b258b8e788b5ed8a150a8331.zip
Doxygen-9879fddbf8f91c57b258b8e788b5ed8a150a8331.tar.gz
Doxygen-9879fddbf8f91c57b258b8e788b5ed8a150a8331.tar.bz2
Fix to show relations between C#/Java generic classes
Diffstat (limited to 'src/doxygen.cpp')
-rw-r--r--src/doxygen.cpp32
1 files changed, 21 insertions, 11 deletions
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 9e0c6f1..6c9a44d 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -4659,7 +4659,8 @@ static bool findClassRelation(
if (si==-1) si=0;
if (baseClass==0 && (root->lang==SrcLangExt_CSharp || root->lang==SrcLangExt_Java))
{
- baseClass = Doxygen::genericsDict->find(baseClassName);
+ // for Java/C# strip the template part before looking for matching
+ baseClass = Doxygen::genericsDict->find(baseClassName.left(i));
//printf("looking for '%s' result=%p\n",baseClassName.data(),baseClass);
}
if (baseClass==0 && i!=-1)
@@ -4949,6 +4950,22 @@ static void findClassEntries(EntryNav *rootNav)
RECURSE_ENTRYTREE(findClassEntries,rootNav);
}
+static QCString extractClassName(EntryNav *rootNav)
+{
+ // strip any anonymous scopes first
+ QCString bName=stripAnonymousNamespaceScope(rootNav->name());
+ bName=stripTemplateSpecifiersFromScope(bName);
+ int i;
+ if ((rootNav->lang()==SrcLangExt_CSharp || rootNav->lang()==SrcLangExt_Java) &&
+ (i=bName.find('<'))!=-1)
+ {
+ // a Java/C# generic class looks like a C++ specialization, so we need to strip the
+ // template part before looking for matches
+ bName=bName.left(i);
+ }
+ return bName;
+}
+
/*! Using the dictionary build by findClassEntries(), this
* function will look for additional template specialization that
* exists as inheritance relations only. These instances will be
@@ -4963,9 +4980,7 @@ static void findInheritedTemplateInstances()
for (;(rootNav=edi.current());++edi)
{
ClassDef *cd;
- // strip any anonymous scopes first
- QCString bName=stripAnonymousNamespaceScope(rootNav->name());
- bName=stripTemplateSpecifiersFromScope(bName);
+ QCString bName = extractClassName(rootNav);
Debug::print(Debug::Classes,0," Inheritance: Class %s : \n",bName.data());
if ((cd=getClass(bName)))
{
@@ -4986,9 +5001,7 @@ static void findUsedTemplateInstances()
for (;(rootNav=edi.current());++edi)
{
ClassDef *cd;
- // strip any anonymous scopes first
- QCString bName=stripAnonymousNamespaceScope(rootNav->name());
- bName=stripTemplateSpecifiersFromScope(bName);
+ QCString bName = extractClassName(rootNav);
Debug::print(Debug::Classes,0," Usage: Class %s : \n",bName.data());
if ((cd=getClass(bName)))
{
@@ -5011,10 +5024,7 @@ static void computeClassRelations()
rootNav->loadEntry(g_storage);
Entry *root = rootNav->entry();
-
- // strip any anonymous scopes first
- QCString bName=stripAnonymousNamespaceScope(rootNav->name());
- bName=stripTemplateSpecifiersFromScope(bName);
+ QCString bName = extractClassName(rootNav);
Debug::print(Debug::Classes,0," Relations: Class %s : \n",bName.data());
if ((cd=getClass(bName)))
{