@@ -717,6 +717,7 @@ QCString stripTemplateSpecifiers(const QCString &s)
717
717
* full qualified name \a name. Creates an artificial scope if the scope is
718
718
* not found and set the parent/child scope relation if the scope is found.
719
719
*/
720
+ [[maybe_unused]]
720
721
static Definition *buildScopeFromQualifiedName (const QCString &name_,SrcLangExt lang,const TagInfo *tagInfo)
721
722
{
722
723
QCString name = stripTemplateSpecifiers (name_);
@@ -2858,16 +2859,27 @@ static void addVariable(const Entry *root,int isFuncPtr=-1)
2858
2859
name=removeRedundantWhiteSpace (name);
2859
2860
2860
2861
// find the scope of this variable
2861
- Entry *p = root->parent ();
2862
- while ((p->section & Entry::SCOPE_MASK))
2862
+ int index = computeQualifiedIndex (name);
2863
+ if (index!=-1 && root->parent ()->section ==Entry::GROUPDOC_SEC && root->parent ()->tagInfo ())
2864
+ // grouped members are stored with full scope
2863
2865
{
2864
- QCString scopeName = p->name ;
2865
- if (!scopeName.isEmpty ())
2866
+ buildScopeFromQualifiedName (name.left (index+2 ),root->lang ,root->tagInfo ());
2867
+ scope=name.left (index);
2868
+ name=name.mid (index+2 );
2869
+ }
2870
+ else
2871
+ {
2872
+ Entry *p = root->parent ();
2873
+ while ((p->section & Entry::SCOPE_MASK))
2866
2874
{
2867
- scope.prepend (scopeName);
2868
- break ;
2875
+ QCString scopeName = p->name ;
2876
+ if (!scopeName.isEmpty ())
2877
+ {
2878
+ scope.prepend (scopeName);
2879
+ break ;
2880
+ }
2881
+ p=p->parent ();
2869
2882
}
2870
- p=p->parent ();
2871
2883
}
2872
2884
2873
2885
MemberType mtype;
@@ -3423,6 +3435,10 @@ static void addGlobalFunction(const Entry *root,const QCString &rname,const QCSt
3423
3435
nd = getResolvedNamespaceMutable (nscope);
3424
3436
}
3425
3437
}
3438
+ else if (root->parent ()->section ==Entry::GROUPDOC_SEC && !scope.isEmpty ())
3439
+ {
3440
+ nd = getResolvedNamespaceMutable (sc);
3441
+ }
3426
3442
3427
3443
if (!scope.isEmpty ())
3428
3444
{
@@ -3450,7 +3466,7 @@ static void addGlobalFunction(const Entry *root,const QCString &rname,const QCSt
3450
3466
" '%s' '%s'::'%s' '%s' proto=%d\n "
3451
3467
" def='%s'\n " ,
3452
3468
qPrint (root->type ),
3453
- qPrint (root-> parent ()-> name ),
3469
+ qPrint (scope ),
3454
3470
qPrint (rname),
3455
3471
qPrint (root->args ),
3456
3472
root->proto ,
@@ -3461,10 +3477,6 @@ static void addGlobalFunction(const Entry *root,const QCString &rname,const QCSt
3461
3477
md->enableCallerGraph (root->callerGraph );
3462
3478
md->enableReferencedByRelation (root->referencedByRelation );
3463
3479
md->enableReferencesRelation (root->referencesRelation );
3464
- // if (root->mGrpId!=-1)
3465
- // {
3466
- // md->setMemberGroup(memberGroupDict[root->mGrpId]);
3467
- // }
3468
3480
3469
3481
md->setRefItems (root->sli );
3470
3482
if (nd && !nd->name ().isEmpty () && nd->name ().at (0 )!=' @' )
@@ -3523,7 +3535,19 @@ static void buildFunctionList(const Entry *root)
3523
3535
QCString rname = removeRedundantWhiteSpace (root->name );
3524
3536
// printf("rname=%s\n",qPrint(rname));
3525
3537
3526
- QCString scope=root->parent ()->name ; // stripAnonymousNamespaceScope(root->parent->name);
3538
+ QCString scope;
3539
+ int index = computeQualifiedIndex (rname);
3540
+ if (index!=-1 && root->parent ()->section ==Entry::GROUPDOC_SEC && root->parent ()->tagInfo ())
3541
+ // grouped members are stored with full scope
3542
+ {
3543
+ buildScopeFromQualifiedName (rname.left (index+2 ),root->lang ,root->tagInfo ());
3544
+ scope=rname.left (index);
3545
+ rname=rname.mid (index+2 );
3546
+ }
3547
+ else
3548
+ {
3549
+ scope=root->parent ()->name ; // stripAnonymousNamespaceScope(root->parent->name);
3550
+ }
3527
3551
if (!rname.isEmpty () && scope.find (' @' )==-1 )
3528
3552
{
3529
3553
ClassDefMutable *cd=0 ;
@@ -7069,7 +7093,10 @@ static void findEnums(const Entry *root)
7069
7093
{
7070
7094
scope=root->name .left (i); // extract scope
7071
7095
name=root->name .right (root->name .length ()-i-2 ); // extract name
7072
- if ((cd=getClassMutable (scope))==0 ) nd=getResolvedNamespaceMutable (scope);
7096
+ if ((cd=getClassMutable (scope))==0 )
7097
+ {
7098
+ nd=toNamespaceDefMutable (buildScopeFromQualifiedName (root->name .left (i+2 ),root->lang ,root->tagInfo ()));
7099
+ }
7073
7100
}
7074
7101
else // no scope, check the scope in which the docs where found
7075
7102
{
@@ -7236,7 +7263,10 @@ static void addEnumValuesToEnums(const Entry *root)
7236
7263
{
7237
7264
scope=root->name .left (i); // extract scope
7238
7265
name=root->name .right (root->name .length ()-i-2 ); // extract name
7239
- if ((cd=getClassMutable (scope))==0 ) nd=getResolvedNamespaceMutable (scope);
7266
+ if ((cd=getClassMutable (scope))==0 )
7267
+ {
7268
+ nd=toNamespaceDefMutable (buildScopeFromQualifiedName (root->name .left (i+2 ),root->lang ,root->tagInfo ()));
7269
+ }
7240
7270
}
7241
7271
else // no scope, check the scope in which the docs where found
7242
7272
{
@@ -7302,30 +7332,26 @@ static void addEnumValuesToEnums(const Entry *root)
7302
7332
// use raw pointer in this loop, since we modify mn and can then invalidate mdp.
7303
7333
if (md && md->isEnumerate () && !root->children ().empty ())
7304
7334
{
7305
- // printf(" enum with %d children\n",root->children()->count ());
7335
+ // printf(" enum with %zu children\n",root->children().size ());
7306
7336
for (const auto &e : root->children ())
7307
7337
{
7308
- SrcLangExt sle;
7309
- if (
7310
- (sle=root->lang )==SrcLangExt_CSharp ||
7311
- sle==SrcLangExt_Java ||
7312
- sle==SrcLangExt_XML ||
7338
+ SrcLangExt sle = root->lang ;
7339
+ bool isJavaLike = sle==SrcLangExt_CSharp || sle==SrcLangExt_Java || sle==SrcLangExt_XML;
7340
+ if ( isJavaLike ||
7313
7341
(root->spec &Entry::Strong)
7314
7342
)
7315
7343
{
7316
7344
// Unlike classic C/C++ enums, for C++11, C# & Java enum
7317
7345
// values are only visible inside the enum scope, so we must create
7318
7346
// them here and only add them to the enum
7319
7347
// printf("md->qualifiedName()=%s e->name=%s tagInfo=%p name=%s\n",
7320
- // qPrint(md->qualifiedName()),qPrint(e->name),e->tagInfo,qPrint(e->name));
7321
- QCString qualifiedName = substitute ( root->name , " :: " , " . " ) ;
7322
- if (!scope. isEmpty () && root-> tagInfo () )
7348
+ // qPrint(md->qualifiedName()),qPrint(e->name),(void*) e->tagInfo() ,qPrint(e->name));
7349
+ QCString qualifiedName = root->name ;
7350
+ if (isJavaLike )
7323
7351
{
7324
- qualifiedName=substitute (scope, " :: " ," . " )+ " . " +qualifiedName ;
7352
+ qualifiedName=substitute (qualifiedName, " . " ," :: " ) ;
7325
7353
}
7326
- if (substitute (md->qualifiedName ()," ::" ," ." )== // TODO: add function to get canonical representation
7327
- qualifiedName // enum value scope matches that of the enum
7328
- )
7354
+ if (md->qualifiedName ()==qualifiedName) // enum value scope matches that of the enum
7329
7355
{
7330
7356
QCString fileName = e->fileName ;
7331
7357
if (fileName.isEmpty () && e->tagInfo ())
0 commit comments