diff options
Diffstat (limited to 'src/groupdef.cpp')
-rw-r--r-- | src/groupdef.cpp | 76 |
1 files changed, 59 insertions, 17 deletions
diff --git a/src/groupdef.cpp b/src/groupdef.cpp index 9b33356..bad8526 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -45,7 +45,7 @@ //--------------------------------------------------------------------------- -class GroupDefImpl : public DefinitionImpl, public GroupDef +class GroupDefImpl : public DefinitionMixin<GroupDef> { public: GroupDefImpl(const char *fileName,int line,const char *name,const char *title,const char *refFileName=0); @@ -54,7 +54,7 @@ class GroupDefImpl : public DefinitionImpl, public GroupDef virtual DefType definitionType() const { return TypeGroup; } virtual QCString getOutputFileBase() const; virtual QCString anchor() const { return QCString(); } - virtual QCString displayName(bool=TRUE) const { return hasGroupTitle() ? m_title : DefinitionImpl::name(); } + virtual QCString displayName(bool=TRUE) const { return hasGroupTitle() ? m_title : DefinitionMixin::name(); } virtual const char *groupTitle() const { return m_title; } virtual void setGroupTitle( const char *newtitle ); virtual bool hasGroupTitle( ) const { return m_titleSet; } @@ -161,7 +161,7 @@ GroupDef *createGroupDef(const char *fileName,int line,const char *name, //--------------------------------------------------------------------------- GroupDefImpl::GroupDefImpl(const char *df,int dl,const char *na,const char *t, - const char *refFileName) : DefinitionImpl(df,dl,1,na) + const char *refFileName) : DefinitionMixin(df,dl,1,na) { m_fileList = new FileList; m_classSDict = new ClassSDict(17); @@ -228,6 +228,7 @@ void GroupDefImpl::distributeMemberGroupDocumentation() void GroupDefImpl::findSectionsInDocumentation() { + docFindSections(briefDescription(),this,docFile()); docFindSections(documentation(),this,docFile()); MemberGroupSDict::Iterator mgli(*m_memberGroupSDict); MemberGroup *mg; @@ -395,13 +396,14 @@ bool GroupDefImpl::insertMember(MemberDef *md,bool docOnly) sameScope // both are found in the same scope ) { - if (srcMd->getGroupAlias()==0) + MemberDefMutable *mdm = toMemberDefMutable(md); + if (mdm && srcMd->getGroupAlias()==0) { - md->setGroupAlias(srcMd); + mdm->setGroupAlias(srcMd); } - else if (md!=srcMd->getGroupAlias()) + else if (mdm && md!=srcMd->getGroupAlias()) { - md->setGroupAlias(srcMd->getGroupAlias()); + mdm->setGroupAlias(srcMd->getGroupAlias()); } return FALSE; // member is the same as one that is already added } @@ -663,7 +665,7 @@ int GroupDefImpl::numDocMembers() const void GroupDefImpl::computeAnchors() { //printf("GroupDefImpl::computeAnchors()\n"); - setAnchors(m_allMemberList); + m_allMemberList->setAnchors(); } void GroupDefImpl::writeTagFile(FTextStream &tagFile) @@ -1436,9 +1438,10 @@ void addClassToGroups(const Entry *root,ClassDef *cd) GroupDef *gd=0; if (!g.groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g.groupname))) { - if (gd->addClass(cd)) + ClassDefMutable *cdm = toClassDefMutable(cd); + if (cdm && gd->addClass(cdm)) { - cd->makePartOfGroup(gd); + cdm->makePartOfGroup(gd); } //printf("Compound %s: in group %s\n",cd->name().data(),gd->groupTitle()); } @@ -1454,7 +1457,14 @@ void addNamespaceToGroups(const Entry *root,NamespaceDef *nd) //printf("group '%s'\n",s->data()); if (!g.groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g.groupname))) { - if (gd->addNamespace(nd)) nd->makePartOfGroup(gd); + if (gd->addNamespace(nd)) + { + NamespaceDefMutable *ndm = toNamespaceDefMutable(nd); + if (ndm) + { + ndm->makePartOfGroup(gd); + } + } //printf("Namespace %s: in group %s\n",nd->name().data(),s->data()); } } @@ -1594,13 +1604,16 @@ void addMemberToGroups(const Entry *root,MemberDef *md) bool success = fgd->insertMember(md); if (success) { - //printf("insertMember successful\n"); - md->setGroupDef(fgd,pri,root->fileName,root->startLine, - !root->doc.isEmpty()); - ClassDef *cd = md->getClassDefOfAnonymousType(); - if (cd) + MemberDefMutable *mdm = toMemberDefMutable(md); + if (mdm) + { + //printf("insertMember successful\n"); + mdm->setGroupDef(fgd,pri,root->fileName,root->startLine,!root->doc.isEmpty()); + } + ClassDefMutable *cdm = toClassDefMutable(mdm->getClassDefOfAnonymousType()); + if (cdm) { - cd->setGroupDefForAllMembers(fgd,pri,root->fileName,root->startLine,root->doc.length() != 0); + cdm->setGroupDefForAllMembers(fgd,pri,root->fileName,root->startLine,root->doc.length() != 0); } } } @@ -1774,3 +1787,32 @@ bool GroupDefImpl::hasDetailedDescription() const !documentation().isEmpty()); } +// --- Cast functions + +GroupDef *toGroupDef(Definition *d) +{ + if (d==0) return 0; + if (d && typeid(*d)==typeid(GroupDefImpl)) + { + return static_cast<GroupDef*>(d); + } + else + { + return 0; + } +} + +const GroupDef *toGroupDef(const Definition *d) +{ + if (d==0) return 0; + if (d && typeid(*d)==typeid(GroupDefImpl)) + { + return static_cast<const GroupDef*>(d); + } + else + { + return 0; + } +} + + |