Skip to content

Commit 791bcf8

Browse files
committed
issue doxygen#8803 Template class with the same name as existing class gets in the same output file
1 parent e546444 commit 791bcf8

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

src/doxygen.cpp

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -942,11 +942,16 @@ static void addClassToContext(const Entry *root)
942942
QCString fullName = root->name;
943943

944944
// strip off any template parameters (but not those for specializations)
945+
int idx=fullName.find('>');
946+
if (idx!=-1 && root->lang==SrcLangExt::CSharp) // mangle A<S,T>::N as A-2-g::N
947+
{
948+
fullName = mangleCSharpGenericName(fullName.left(idx+1))+fullName.mid(idx+1);
949+
}
945950
fullName=stripTemplateSpecifiersFromScope(fullName);
946951

947952
// name with scope (if not present already)
948953
QCString qualifiedName = fullName;
949-
if (!scName.isEmpty() && !leftScopeMatch(fullName,scName))
954+
if (!scName.isEmpty() && !leftScopeMatch(scName,fullName))
950955
{
951956
qualifiedName.prepend(scName+"::");
952957
}
@@ -3177,7 +3182,14 @@ static void addVariable(const Entry *root,int isFuncPtr=-1)
31773182
bool isMemberOf=FALSE;
31783183

31793184
QCString classScope=stripAnonymousNamespaceScope(scope);
3180-
classScope=stripTemplateSpecifiersFromScope(classScope,FALSE);
3185+
if (root->lang==SrcLangExt::CSharp)
3186+
{
3187+
classScope=mangleCSharpGenericName(classScope);
3188+
}
3189+
else
3190+
{
3191+
classScope=stripTemplateSpecifiersFromScope(classScope,FALSE);
3192+
}
31813193
QCString annScopePrefix=scope.left(scope.length()-classScope.length());
31823194

31833195

@@ -7496,6 +7508,10 @@ static void findEnums(const Entry *root)
74967508
if (i!=-1) // scope is specified
74977509
{
74987510
scope=root->name.left(i); // extract scope
7511+
if (root->lang==SrcLangExt::CSharp)
7512+
{
7513+
scope = mangleCSharpGenericName(scope);
7514+
}
74997515
name=root->name.right(root->name.length()-i-2); // extract name
75007516
if ((cd=getClassMutable(scope))==nullptr)
75017517
{
@@ -7667,6 +7683,10 @@ static void addEnumValuesToEnums(const Entry *root)
76677683
if (i!=-1) // scope is specified
76687684
{
76697685
scope=root->name.left(i); // extract scope
7686+
if (root->lang==SrcLangExt::CSharp)
7687+
{
7688+
scope = mangleCSharpGenericName(scope);
7689+
}
76707690
name=root->name.right(root->name.length()-i-2); // extract name
76717691
if ((cd=getClassMutable(scope))==nullptr)
76727692
{
@@ -7678,6 +7698,10 @@ static void addEnumValuesToEnums(const Entry *root)
76787698
if (root->parent()->section.isScope() && !root->parent()->name.isEmpty()) // found enum docs inside a compound
76797699
{
76807700
scope=root->parent()->name;
7701+
if (root->lang==SrcLangExt::CSharp)
7702+
{
7703+
scope = mangleCSharpGenericName(scope);
7704+
}
76817705
if ((cd=getClassMutable(scope))==nullptr) nd=getResolvedNamespaceMutable(scope);
76827706
}
76837707
name=root->name;
@@ -7748,6 +7772,11 @@ static void addEnumValuesToEnums(const Entry *root)
77487772
//printf("md->qualifiedName()=%s e->name=%s tagInfo=%p name=%s\n",
77497773
// qPrint(md->qualifiedName()),qPrint(e->name),(void*)e->tagInfo(),qPrint(e->name));
77507774
QCString qualifiedName = root->name;
7775+
i = qualifiedName.findRev("::");
7776+
if (i!=-1 && sle==SrcLangExt::CSharp)
7777+
{
7778+
qualifiedName = mangleCSharpGenericName(qualifiedName.left(i))+qualifiedName.mid(i);
7779+
}
77517780
if (isJavaLike)
77527781
{
77537782
qualifiedName=substitute(qualifiedName,"::",".");

0 commit comments

Comments
 (0)