Thread: [Doxygen-users] grouping patches
Brought to you by:
dimitri
|
From: Patrick O. <Pat...@pa...> - 2001-05-17 16:03:14
|
Hi all,
here are patches for doxygen that enhance (or so I hope) the
grouping capabilities:
There are now three commands to define a group:
\defgroup name title
\addtogroup name [title]
\weakgroup name [title]
\defgroup must be used exactly once for a group, so you should
provide a title. Without the title you will get a warning and
doxygen will use the name as title (this is the old behaviour).
/** \addtogroup name */ can be used to add documentation or
members to a group (as in 1.2.7), but the group is created if
it doesn't exist yet. You can provide the title later
with another block:
/**
* \addgroup name title
* documentation
*/
Setting different titles will trigger a warning without overwriting
the title once more.
\weakgroup is exactly the same as \addtogroup, but if a member
was put into such a group with \weakgroup name @{ @} and into
another group with \[def|addto]group @{ @}, then it will be
placed into the other group without issuing a warning.
Actually there is a four-level hierarchy for grouping with
(from strongest to weakest) \ingroup, \defgroup, \addtogroup,
\weakgroup. You will get warnings when putting members into
groups with commands of the same level, but only when you really
document this member. This will not trigger a warning and put
variable a into Group1:
/** \addtogroup Group1 */
/*@{*/
/** this is the real group */
extern int a;
/*@}*/
/** \addtogroup Group2 */
/*@{*/
extern int a;
/*@}*/
Member groups (i.e. grouping of struct/class members) works as
before.
I have attached the diff and an example that uses the new
features and also triggers some warnings on purpose.
Bye, Patrick
--
// pallas GmbH ............ Patrick Ohly .............
Hermuelheimer Str. 10 Software-Engineer
D-50321 Bruehl, Germany po...@pa...
fax +49-(0)2232-1896-29 phone +49-(0)2232-1896-30
http://www.pallas.com
..........................................................
|
|
From: Ronald v. E. <eij...@iq...> - 2001-05-18 09:58:28
|
DQpQYXRyaWNrIE9obHkgd3JvdGU6DQo+IE1lbWJlciBncm91cHMgKGkuZS4gZ3JvdXBpbmcgb2Yg c3RydWN0L2NsYXNzIG1lbWJlcnMpIHdvcmtzIGFzDQo+IGJlZm9yZS4NCg0KQXJlIHRoZXJlIGFu eSBwbGFucyB0byBhZGQgdGhlIGN1cnJlbnQgZ3JvdXBpbmcgZnVuY3Rpb25zIGZvciBNZW1iZXIg Z3JvdXBzIGFzd2VsbD8NCg0KQyd5YSwNCg0KICAgIFJvbmFsZA0K |
|
From: Patrick O. <Pat...@pa...> - 2001-05-18 10:54:15
|
On Fri, May 18, 2001 at 11:51:42AM +0200, Ronald van Eijck wrote: > > Patrick Ohly wrote: > > Member groups (i.e. grouping of struct/class members) works as > > before. > > Are there any plans to add the current grouping functions for Member groups aswell? I don't have such plans. The two concepts are completely disjunct and supporting member groups that you can refer to later would require some more rewrites. Bye, Patrick -- // pallas GmbH ............ Patrick Ohly ............. Hermuelheimer Str. 10 Software-Engineer D-50321 Bruehl, Germany po...@pa... fax +49-(0)2232-1896-29 phone +49-(0)2232-1896-30 http://www.pallas.com .......................................................... |
|
From: Patrick O. <Pat...@pa...> - 2001-05-18 10:15:07
Attachments:
groupsdiff.gz
|
Hi,
here's the same patch, but this time against 1.2.7 20010517.
On Thu, May 17, 2001 at 06:03:04PM +0200, Patrick Ohly wrote:
> Hi all,
>
> here are patches for doxygen that enhance (or so I hope) the
> grouping capabilities:
>
> There are now three commands to define a group:
> \defgroup name title
> \addtogroup name [title]
> \weakgroup name [title]
>
> \defgroup must be used exactly once for a group, so you should
> provide a title. Without the title you will get a warning and
> doxygen will use the name as title (this is the old behaviour).
>
> /** \addtogroup name */ can be used to add documentation or
> members to a group (as in 1.2.7), but the group is created if
> it doesn't exist yet. You can provide the title later
> with another block:
> /**
> * \addgroup name title
^^^^^^^^^
should be \addtogroup
> * documentation
> */
>
> Setting different titles will trigger a warning without overwriting
> the title once more.
>
> \weakgroup is exactly the same as \addtogroup, but if a member
> was put into such a group with \weakgroup name @{ @} and into
> another group with \[def|addto]group @{ @}, then it will be
> placed into the other group without issuing a warning.
>
> Actually there is a four-level hierarchy for grouping with
> (from strongest to weakest) \ingroup, \defgroup, \addtogroup,
> \weakgroup. You will get warnings when putting members into
> groups with commands of the same level, but only when you really
> document this member. This will not trigger a warning and put
> variable a into Group1:
>
> /** \addtogroup Group1 */
> /*@{*/
> /** this is the real group */
> extern int a;
> /*@}*/
>
> /** \addtogroup Group2 */
> /*@{*/
> extern int a;
> /*@}*/
>
> Member groups (i.e. grouping of struct/class members) works as
> before.
>
> I have attached the diff and an example that uses the new
> features and also triggers some warnings on purpose.
>
> Bye, Patrick
> --
> // pallas GmbH ............ Patrick Ohly .............
> Hermuelheimer Str. 10 Software-Engineer
> D-50321 Bruehl, Germany po...@pa...
> fax +49-(0)2232-1896-29 phone +49-(0)2232-1896-30
> http://www.pallas.com
> ..........................................................
> Index: src//doxygen.cpp
> ===================================================================
> RCS file: /Projects/psp/local/src/CVS-Repository/doxygen/src/doxygen.cpp,v
> retrieving revision 1.1.1.10.2.1
> diff -c -r1.1.1.10.2.1 doxygen.cpp
> *** src//doxygen.cpp 2001/05/09 11:42:32 1.1.1.10.2.1
> --- src//doxygen.cpp 2001/05/17 14:44:45
> ***************
> *** 268,278 ****
> static void addRelatedPage(Entry *root)
> {
> GroupDef *gd=0;
> ! QListIterator<QCString> sli(*root->groups);
> ! QCString *s;
> ! for (;(s=sli.current());++sli)
> {
> ! if (!s->isEmpty() && (gd=Doxygen::groupDict[*s])) break;
> }
> addRelatedPage(root->name,root->args,root->doc,root->anchors,
> root->fileName,root->startLine,root->todoId,
> --- 268,278 ----
> static void addRelatedPage(Entry *root)
> {
> GroupDef *gd=0;
> ! QListIterator<Grouping> gli(*root->groups);
> ! Grouping *g;
> ! for (;(g=gli.current());++gli)
> {
> ! if (!g->groupname.isEmpty() && (gd=Doxygen::groupDict[g->groupname])) break;
> }
> addRelatedPage(root->name,root->args,root->doc,root->anchors,
> root->fileName,root->startLine,root->todoId,
> ***************
> *** 391,400 ****
>
> if ((gd=Doxygen::groupDict[root->name]))
> {
> ! warn(root->fileName,root->startLine,
> ! "Warning: group %s already documented. "
> ! "Skipping documentation.",
> ! root->name.data());
> }
> else
> {
> --- 391,420 ----
>
> if ((gd=Doxygen::groupDict[root->name]))
> {
> ! if ( root->groupdoctype==Entry::GROUPDOC_NORMAL )
> ! {
> ! warn(root->fileName,root->startLine,
> ! "Warning: group %s already documented. "
> ! "Skipping documentation.",
> ! root->name.data());
> ! }
> ! else
> ! {
> ! if ( !gd->hasGroupTitle() )
> ! gd->setGroupTitle( root->type );
> ! else if ( root->type.length() > 0 && root->name != root->type && gd->groupTitle() != root->type )
> ! warn( root->fileName,root->startLine,
> ! "group %s: ignoring title \"%s\" that does not match old title \"%s\"\n",
> ! root->name.data(), root->type.data(), gd->groupTitle() );
> ! if ( gd->briefDescription().isEmpty() )
> ! gd->setBriefDescription(root->brief);
> ! if ( !root->doc.stripWhiteSpace().isEmpty() )
> ! gd->setDocumentation( gd->documentation().isEmpty() ? root->doc :
> ! gd->documentation() + "\n\n" + root->doc );
> ! gd->addSectionsToDefinition(root->anchors);
> ! gd->setRefItems(root->todoId,root->testId,root->bugId);
> ! addGroupToGroups(root,gd);
> ! }
> }
> else
> {
> ***************
> *** 438,467 ****
> }
> }
>
> - static void addToGroupSections(Entry *root)
> - {
> - if (root->section==Entry::ADDGRPDOC_SEC && !root->name.isEmpty())
> - {
> - GroupDef *gd = Doxygen::groupDict[root->name];
> - if (gd)
> - {
> - gd->setDocumentation(gd->documentation()+"<p>"+root->brief+root->doc);
> - }
> - else
> - {
> - warn(root->fileName,root->startLine,
> - "Warning: ignoring addtogroup command for undefined "
> - "group `%s'.",root->name.data());
> - }
> - }
> - EntryListIterator eli(*root->sublist);
> - Entry *e;
> - for (;(e=eli.current());++eli)
> - {
> - addToGroupSections(e);
> - }
> - }
> -
> //----------------------------------------------------------------------
>
> static void buildFileList(Entry *root)
> --- 458,463 ----
> ***************
> *** 494,505 ****
> fd->setBriefDescription(root->brief);
> fd->addSectionsToDefinition(root->anchors);
> fd->setRefItems(root->todoId,root->testId,root->bugId);
> ! QListIterator<QCString> sli(*root->groups);
> ! QCString *s;
> ! for (;(s=sli.current());++sli)
> {
> GroupDef *gd=0;
> ! if (!s->isEmpty() && (gd=Doxygen::groupDict[*s]))
> {
> gd->addFile(fd);
> //printf("File %s: in group %s\n",fd->name().data(),s->data());
> --- 490,501 ----
> fd->setBriefDescription(root->brief);
> fd->addSectionsToDefinition(root->anchors);
> fd->setRefItems(root->todoId,root->testId,root->bugId);
> ! QListIterator<Grouping> gli(*root->groups);
> ! Grouping *g;
> ! for (;(g=gli.current());++gli)
> {
> GroupDef *gd=0;
> ! if (!g->groupname.isEmpty() && (gd=Doxygen::groupDict[g->groupname]))
> {
> gd->addFile(fd);
> //printf("File %s: in group %s\n",fd->name().data(),s->data());
> ***************
> *** 1010,1021 ****
> nd->setBriefDescription(root->brief);
> nd->addSectionsToDefinition(root->anchors);
>
> ! QListIterator<QCString> sli(*root->groups);
> ! QCString *s;
> ! for (;(s=sli.current());++sli)
> {
> GroupDef *gd=0;
> ! if (!s->isEmpty() && (gd=Doxygen::groupDict[*s]))
> gd->addNamespace(nd);
> }
>
> --- 1006,1017 ----
> nd->setBriefDescription(root->brief);
> nd->addSectionsToDefinition(root->anchors);
>
> ! QListIterator<Grouping> gli(*root->groups);
> ! Grouping *g;
> ! for (;(g=gli.current());++gli)
> {
> GroupDef *gd=0;
> ! if (!g->groupname.isEmpty() && (gd=Doxygen::groupDict[g->groupname]))
> gd->addNamespace(nd);
> }
>
> ***************
> *** 1355,1366 ****
> // merge ingroup specifiers
> if (md->getGroupDef()==0 && root->groups->first())
> {
> ! GroupDef *gd=Doxygen::groupDict[root->groups->first()->data()];
> ! md->setGroupDef(gd);
> }
> else if (md->getGroupDef()!=0 && root->groups->count()==0)
> {
> ! root->groups->append(new QCString(md->getGroupDef()->name()));
> }
> }
> }
> --- 1351,1362 ----
> // merge ingroup specifiers
> if (md->getGroupDef()==0 && root->groups->first())
> {
> ! GroupDef *gd=Doxygen::groupDict[root->groups->first()->groupname.data()];
> ! md->setGroupDef(gd, root->groups->first()->pri, root->fileName, root->startLine, root->doc.length() != 0);
> }
> else if (md->getGroupDef()!=0 && root->groups->count()==0)
> {
> ! root->groups->append(new Grouping(md->getGroupDef()->name(), md->getGroupPri()));
> }
> }
> }
> ***************
> *** 1906,1917 ****
> // merge ingroup specifiers
> if (md->getGroupDef()==0 && root->groups->first())
> {
> ! GroupDef *gd=Doxygen::groupDict[root->groups->first()->data()];
> ! md->setGroupDef(gd);
> }
> else if (md->getGroupDef()!=0 && root->groups->count()==0)
> {
> ! root->groups->append(new QCString(md->getGroupDef()->name()));
> }
> }
> }
> --- 1902,1913 ----
> // merge ingroup specifiers
> if (md->getGroupDef()==0 && root->groups->first())
> {
> ! GroupDef *gd=Doxygen::groupDict[root->groups->first()->groupname.data()];
> ! md->setGroupDef(gd, root->groups->first()->pri, root->fileName, root->startLine, root->doc.length() != 0);
> }
> else if (md->getGroupDef()!=0 && root->groups->count()==0)
> {
> ! root->groups->append(new Grouping(md->getGroupDef()->name(), md->getGroupPri()));
> }
> }
> }
> ***************
> *** 6351,6357 ****
> msg("Building group list...\n");
> buildGroupList(root);
> organizeSubGroups(root);
> - addToGroupSections(root);
>
> msg("Building namespace list...\n");
> buildNamespaceList(root);
> --- 6347,6352 ----
> Index: src//entry.cpp
> ===================================================================
> RCS file: /Projects/psp/local/src/CVS-Repository/doxygen/src/entry.cpp,v
> retrieving revision 1.1.1.5
> diff -c -r1.1.1.5 entry.cpp
> *** src//entry.cpp 2001/03/30 15:11:35 1.1.1.5
> --- src//entry.cpp 2001/05/17 08:44:32
> ***************
> *** 29,35 ****
> sublist->setAutoDelete(TRUE);
> extends = new QList<BaseInfo>;
> extends->setAutoDelete(TRUE);
> ! groups = new QList<QCString>;
> groups->setAutoDelete(TRUE);
> anchors = new QList<QCString>;
> anchors->setAutoDelete(TRUE);
> --- 29,35 ----
> sublist->setAutoDelete(TRUE);
> extends = new QList<BaseInfo>;
> extends->setAutoDelete(TRUE);
> ! groups = new QList<Grouping>;
> groups->setAutoDelete(TRUE);
> anchors = new QList<QCString>;
> anchors->setAutoDelete(TRUE);
> ***************
> *** 40,45 ****
> --- 40,46 ----
> mtArgList = 0;
> mGrpId = -1;
> tagInfo = 0;
> + groupdoctype = GROUPDOC_NORMAL;
> reset();
> }
>
> ***************
> *** 82,88 ****
> sublist->setAutoDelete(TRUE);
> extends = new QList<BaseInfo>;
> extends->setAutoDelete(TRUE);
> ! groups = new QList<QCString>;
> groups->setAutoDelete(TRUE);
> anchors = new QList<QCString>;
> anchors->setAutoDelete(TRUE);
> --- 83,89 ----
> sublist->setAutoDelete(TRUE);
> extends = new QList<BaseInfo>;
> extends->setAutoDelete(TRUE);
> ! groups = new QList<Grouping>;
> groups->setAutoDelete(TRUE);
> anchors = new QList<QCString>;
> anchors->setAutoDelete(TRUE);
> ***************
> *** 91,96 ****
> --- 92,98 ----
> //printf("Entry::Entry(copy) tArgList=0\n");
> tArgList = 0;
> mtArgList = 0;
> + groupdoctype = e.groupdoctype;
>
> // deep copy of the child entry list
> QListIterator<Entry> eli(*e.sublist);
> ***************
> *** 109,122 ****
> }
>
> // deep copy group list
> ! QListIterator<QCString> sli(*e.groups);
> ! QCString *s;
> ! for (;(s=sli.current());++sli)
> {
> ! groups->append(new QCString(*s));
> }
>
> QListIterator<QCString> sli2(*e.anchors);
> for (;(s=sli2.current());++sli2)
> {
> anchors->append(new QCString(*s));
> --- 111,125 ----
> }
>
> // deep copy group list
> ! QListIterator<Grouping> gli(*e.groups);
> ! Grouping *g;
> ! for (;(g=gli.current());++gli)
> {
> ! groups->append(new Grouping(*g));
> }
>
> QListIterator<QCString> sli2(*e.anchors);
> + QCString *s;
> for (;(s=sli2.current());++sli2)
> {
> anchors->append(new QCString(*s));
> ***************
> *** 234,239 ****
> --- 237,243 ----
> memSpec = 0;
> subGrouping = TRUE;
> protection = Public;
> + groupdoctype = GROUPDOC_NORMAL;
> sublist->clear();
> extends->clear();
> groups->clear();
> ***************
> *** 270,283 ****
> size+=bi->name.length()+1+sizeof(bi->prot)+sizeof(bi->virt);
> bi=extends->next();
> }
> ! QCString *s=groups->first();
> ! while (s)
> {
> size+=sizeof(QLNode);
> ! size+=s->length()+1;
> ! s=groups->next();
> }
> ! s=anchors->first();
> while (s)
> {
> size+=sizeof(QLNode);
> --- 274,288 ----
> size+=bi->name.length()+1+sizeof(bi->prot)+sizeof(bi->virt);
> bi=extends->next();
> }
> ! Grouping *g=groups->first();
> ! while (g)
> {
> size+=sizeof(QLNode);
> ! size+=g->groupname.length()+1;
> ! size+=sizeof(g->pri);
> ! g=groups->next();
> }
> ! QCString *s=anchors->first();
> while (s)
> {
> size+=sizeof(QLNode);
> Index: src//entry.h
> ===================================================================
> RCS file: /Projects/psp/local/src/CVS-Repository/doxygen/src/entry.h,v
> retrieving revision 1.1.1.6
> diff -c -r1.1.1.6 entry.h
> *** src//entry.h 2001/05/02 12:38:24 1.1.1.6
> --- src//entry.h 2001/05/17 08:49:30
> ***************
> *** 121,126 ****
> --- 121,173 ----
> QCString anchor;
> };
>
> + struct Grouping {
> + typedef enum {
> + GROUPING_LOWEST,
> + GROUPING_AUTO_WEAK =
> + GROUPING_LOWEST, //!< membership in group was defined via @weakgroup @{ @}
> + GROUPING_AUTO_ADD, //!< membership in group was defined via @add[to]group @{ @}
> + GROUPING_AUTO_DEF, //!< membership in group was defined via @defgroup @{ @}
> + GROUPING_AUTO_HIGHEST =
> + GROUPING_AUTO_DEF,
> + GROUPING_INGROUP, //!< membership in group was defined by @ingroup
> + GROUPING_HIGHEST =
> + GROUPING_INGROUP
> + } GroupPri_t;
> +
> + static const char *getGroupPriName( GroupPri_t priority )
> + {
> + switch( priority )
> + {
> + case GROUPING_AUTO_WEAK:
> + return "@weakgroup";
> + break;
> + case GROUPING_AUTO_ADD:
> + return "@addtogroup";
> + break;
> + case GROUPING_AUTO_DEF:
> + return "@defgroup";
> + break;
> + case GROUPING_INGROUP:
> + return "@ingroup";
> + break;
> + default:
> + return "???";
> + break;
> + }
> + }
> +
> + Grouping( const char *gn, GroupPri_t p ) :
> + groupname(gn),
> + pri(p) {}
> + Grouping( const Grouping &g ) :
> + groupname(g.groupname),
> + pri(g.pri) {}
> + QCString groupname; //!< name of the group
> + GroupPri_t pri; //!< priority of this definition
> +
> + };
> +
> /*! \brief Represents an unstructured piece of information, about an
> * entity found in the sources.
> *
> ***************
> *** 176,183 ****
> MAINPAGEDOC_SEC = 0x01200000,
> MEMBERGRP_SEC = 0x01300000,
> USINGDECL_SEC = 0x01400000,
> ! PACKAGE_SEC = 0x01500000,
> ! ADDGRPDOC_SEC = 0x01600000
> };
> enum MemberSpecifier
> {
> --- 223,229 ----
> MAINPAGEDOC_SEC = 0x01200000,
> MEMBERGRP_SEC = 0x01300000,
> USINGDECL_SEC = 0x01400000,
> ! PACKAGE_SEC = 0x01500000
> };
> enum MemberSpecifier
> {
> ***************
> *** 231,238 ****
> int endBodyLine; //!< line number where the definition ends
> int mGrpId; //!< member group id
> QList<Entry> *sublist; //!< entries that are children of this one
> ! QList<BaseInfo> *extends; //!< list of base classes
> ! QList<QCString> *groups; //!< list of groups this entry belongs to
> QList<QCString> *anchors; //!< list of anchors defined in this entry
> QCString fileName; //!< file this entry was extracted from
> int startLine; //!< start line of entry in the source
> --- 277,284 ----
> int endBodyLine; //!< line number where the definition ends
> int mGrpId; //!< member group id
> QList<Entry> *sublist; //!< entries that are children of this one
> ! QList<BaseInfo> *extends; //!< list of base classes
> ! QList<Grouping> *groups; //!< list of groups this entry belongs to
> QList<QCString> *anchors; //!< list of anchors defined in this entry
> QCString fileName; //!< file this entry was extracted from
> int startLine; //!< start line of entry in the source
> ***************
> *** 241,246 ****
> --- 287,333 ----
> int bugId; //!< id of the bug list item of this entry
> TagInfo *tagInfo; //!< tag file info
> static int num; //!< counts the total number of entries
> + enum {
> + GROUPDOC_NORMAL, //<! @defgroup
> + GROUPDOC_ADD, //<! @addgroup
> + GROUPDOC_WEAK //<! @weakgroup
> + } groupdoctype; //!< kind of group
> + /// return the command name used to define GROUPDOC_SEC
> + const char *groupdoccmd() const
> + {
> + switch( this->groupdoctype ) {
> + case GROUPDOC_NORMAL:
> + return "\\defgroup";
> + break;
> + case GROUPDOC_ADD:
> + return "\\addgroup";
> + break;
> + case GROUPDOC_WEAK:
> + return "\\weakgroup";
> + break;
> + default:
> + return "unknown group command";
> + }
> + }
> + Grouping::GroupPri_t groupingpri() const
> + {
> + if( this->section != GROUPDOC_SEC ) {
> + return Grouping::GROUPING_LOWEST;
> + }
> + switch( this->groupdoctype ) {
> + case GROUPDOC_NORMAL:
> + return Grouping::GROUPING_AUTO_DEF;
> + break;
> + case GROUPDOC_ADD:
> + return Grouping::GROUPING_AUTO_ADD;
> + break;
> + case GROUPDOC_WEAK:
> + return Grouping::GROUPING_AUTO_WEAK;
> + break;
> + default:
> + return Grouping::GROUPING_LOWEST;
> + }
> + }
> private:
> Entry &operator=(const Entry &);
> } ;
> Index: src//groupdef.cpp
> ===================================================================
> RCS file: /Projects/psp/local/src/CVS-Repository/doxygen/src/groupdef.cpp,v
> retrieving revision 1.1.1.10
> diff -c -r1.1.1.10 groupdef.cpp
> *** src//groupdef.cpp 2001/05/02 12:38:26 1.1.1.10
> --- src//groupdef.cpp 2001/05/17 15:59:10
> ***************
> *** 44,57 ****
> exampleDict = new PageSDict(257);
> allMemberList = new MemberList;
> allMemberNameInfoDict = new MemberNameInfoDict(1009);
> - if (t)
> - title = t;
> - else
> - {
> - title = na;
> - title.at(0)=toupper(title.at(0));
> - }
> fileName = (QCString)"group_"+na;
> memberGroupList = new MemberGroupList;
> memberGroupList->setAutoDelete(TRUE);
> memberGroupDict = new MemberGroupDict(1009);
> --- 44,51 ----
> exampleDict = new PageSDict(257);
> allMemberList = new MemberList;
> allMemberNameInfoDict = new MemberNameInfoDict(1009);
> fileName = (QCString)"group_"+na;
> + setGroupTitle( t );
> memberGroupList = new MemberGroupList;
> memberGroupList->setAutoDelete(TRUE);
> memberGroupDict = new MemberGroupDict(1009);
> ***************
> *** 90,95 ****
> --- 84,105 ----
> delete memberGroupDict;
> }
>
> + void GroupDef::setGroupTitle( const char *t )
> + {
> + if ( t && strlen(t) )
> + {
> + title = t;
> + titleSet = true;
> + }
> + else
> + {
> + title = name();
> + title.at(0)=toupper(title.at(0));
> + titleSet = false;
> + }
> + }
> +
> +
> void GroupDef::distributeMemberGroupDocumentation()
> {
> MemberGroupListIterator mgli(*memberGroupList);
> ***************
> *** 200,206 ****
>
> void GroupDef::insertMember(MemberDef *md)
> {
> ! //printf("GroupDef::insertMember(%s)\n",md->name().data());
> MemberNameInfo *mni=0;
> if ((mni=(*allMemberNameInfoDict)[md->name()]))
> { // member with this name already found
> --- 210,216 ----
>
> void GroupDef::insertMember(MemberDef *md)
> {
> ! // fprintf(stderr, "GroupDef(%s)::insertMember(%s)\n", title.data(), md->name().data());
> MemberNameInfo *mni=0;
> if ((mni=(*allMemberNameInfoDict)[md->name()]))
> { // member with this name already found
> ***************
> *** 279,284 ****
> --- 289,358 ----
> //addMemberToGroup(md,groupId);
> }
>
> + void GroupDef::removeMember(MemberDef *md)
> + {
> + // fprintf(stderr, "GroupDef(%s)::removeMember( %s )\n", title.data(), md->name().data());
> + MemberNameInfo *mni = allMemberNameInfoDict->find(md->name());
> + if (mni)
> + {
> + MemberNameInfoIterator mnii(*mni);
> + while( mnii.current() )
> + {
> + if( mnii.current()->memberDef == md )
> + {
> + mni->remove(mnii.current());
> + break;
> + }
> + ++mnii;
> + }
> + if( mni->isEmpty() )
> + {
> + allMemberNameInfoDict->remove(md->name());
> + delete mni;
> + }
> +
> + allMemberList->remove(md);
> + switch(md->memberType())
> + {
> + case MemberDef::Variable:
> + decVarMembers.remove(md);
> + docVarMembers.remove(md);
> + break;
> + case MemberDef::Function:
> + decFuncMembers.remove(md);
> + docFuncMembers.remove(md);
> + break;
> + case MemberDef::Typedef:
> + decTypedefMembers.remove(md);
> + docTypedefMembers.remove(md);
> + break;
> + case MemberDef::Enumeration:
> + decEnumMembers.remove(md);
> + docEnumMembers.remove(md);
> + break;
> + case MemberDef::EnumValue:
> + decEnumValMembers.remove(md);
> + docEnumValMembers.remove(md);
> + break;
> + case MemberDef::Prototype:
> + decProtoMembers.remove(md);
> + docProtoMembers.remove(md);
> + break;
> + case MemberDef::Define:
> + decDefineMembers.remove(md);
> + docDefineMembers.remove(md);
> + break;
> + default:
> + err("GroupDef::removeMember(): unexpected member remove in file!\n");
> + }
> + }
> + }
> +
> + bool GroupDef::containsGroup(const GroupDef *def)
> + {
> + return groupList->find(def) >= 0;
> + }
> +
> void GroupDef::addGroup(const GroupDef *def)
> {
> if (Config_getBool("SORT_MEMBER_DOCS"))
> ***************
> *** 552,563 ****
>
> void addClassToGroups(Entry *root,ClassDef *cd)
> {
> ! QListIterator<QCString> sli(*root->groups);
> ! QCString *s;
> ! for (;(s=sli.current());++sli)
> {
> GroupDef *gd=0;
> ! if (!s->isEmpty() && (gd=Doxygen::groupDict[*s]))
> {
> gd->addClass(cd);
> //printf("Compound %s: in group %s\n",cd->name().data(),s->data());
> --- 626,637 ----
>
> void addClassToGroups(Entry *root,ClassDef *cd)
> {
> ! QListIterator<Grouping> gli(*root->groups);
> ! Grouping *g;
> ! for (;(g=gli.current());++gli)
> {
> GroupDef *gd=0;
> ! if (!g->groupname.isEmpty() && (gd=Doxygen::groupDict[g->groupname]))
> {
> gd->addClass(cd);
> //printf("Compound %s: in group %s\n",cd->name().data(),s->data());
> ***************
> *** 568,580 ****
> void addNamespaceToGroups(Entry *root,NamespaceDef *nd)
> {
> //printf("root->groups->count()=%d\n",root->groups->count());
> ! QListIterator<QCString> sli(*root->groups);
> ! QCString *s;
> ! for (;(s=sli.current());++sli)
> {
> GroupDef *gd=0;
> //printf("group `%s'\n",s->data());
> ! if (!s->isEmpty() && (gd=Doxygen::groupDict[*s]))
> {
> gd->addNamespace(nd);
> //printf("Namespace %s: in group %s\n",nd->name().data(),s->data());
> --- 642,654 ----
> void addNamespaceToGroups(Entry *root,NamespaceDef *nd)
> {
> //printf("root->groups->count()=%d\n",root->groups->count());
> ! QListIterator<Grouping> gli(*root->groups);
> ! Grouping *g;
> ! for (;(g=gli.current());++gli)
> {
> GroupDef *gd=0;
> //printf("group `%s'\n",s->data());
> ! if (!g->groupname.isEmpty() && (gd=Doxygen::groupDict[g->groupname]))
> {
> gd->addNamespace(nd);
> //printf("Namespace %s: in group %s\n",nd->name().data(),s->data());
> ***************
> *** 584,595 ****
>
> void addGroupToGroups(Entry *root,GroupDef *subGroup)
> {
> ! QListIterator<QCString> sli(*root->groups);
> ! QCString *s;
> ! for (;(s=sli.current());++sli)
> {
> GroupDef *gd=0;
> ! if (!s->isEmpty() && (gd=Doxygen::groupDict[*s]))
> {
> gd->addGroup(subGroup);
> subGroup->addParentGroup(gd);
> --- 658,670 ----
>
> void addGroupToGroups(Entry *root,GroupDef *subGroup)
> {
> ! QListIterator<Grouping> gli(*root->groups);
> ! Grouping *g;
> ! for (;(g=gli.current());++gli)
> {
> GroupDef *gd=0;
> ! if (!g->groupname.isEmpty() && (gd=Doxygen::groupDict[g->groupname]) &&
> ! !gd->containsGroup(subGroup) )
> {
> gd->addGroup(subGroup);
> subGroup->addParentGroup(gd);
> ***************
> *** 597,627 ****
> }
> }
>
> ! /*! Add a member to all groups it is contained in */
> void addMemberToGroups(Entry *root,MemberDef *md)
> {
> ! QListIterator<QCString> sli(*root->groups);
> ! QCString *s;
> ! for (;(s=sli.current());++sli)
> {
> ! GroupDef *gd=0;
> ! if (!s->isEmpty() && (gd=Doxygen::groupDict[*s]))
> {
> ! GroupDef *mgd = md->getGroupDef();
> ! if (mgd==0)
> ! {
> ! gd->insertMember(md);
> ! md->setGroupDef(gd);
> }
> ! else if (mgd!=gd)
> {
> ! warn(mgd->getDefFileName(),mgd->getDefLine(),
> ! "Warning: Member %s found in multiple groups.!\n"
> ! "The member will be put in group %s, and not in group %s",
> ! md->name().data(),mgd->name().data(),gd->name().data()
> ! );
> }
> - //printf("Member %s: in group %s\n",md->name().data(),s->data());
> }
> }
> }
> --- 672,753 ----
> }
> }
>
> ! /*! Add a member to the group with the highest priority */
> void addMemberToGroups(Entry *root,MemberDef *md)
> {
> ! //printf(" Root 0x%p = %s, md 0x%p %s\n", root, root->name.data(), md, md->name().data() );
> ! QListIterator<Grouping> gli(*root->groups);
> ! Grouping *g;
> !
> ! // Search entry's group list for group with highest pri.
> ! Grouping::GroupPri_t pri = Grouping::GROUPING_LOWEST;
> ! GroupDef *fgd=0;
> ! for (;(g=gli.current());++gli)
> {
> ! GroupDef *gd;
> ! if (!g->groupname.isEmpty() &&
> ! (gd=Doxygen::groupDict[g->groupname]) &&
> ! g->pri >= pri)
> {
> ! if( fgd && g->pri == pri ) {
> ! warn(root->fileName.data(), root->startLine,
> ! "Warning: Member %s found in multiple %s groups! "
> ! "The member will be put in group %s, and not in group %s",
> ! md->name().data(), Grouping::getGroupPriName( pri ),
> ! gd->name().data(), fgd->name().data()
> ! );
> }
> !
> ! fgd = gd;
> ! pri = g->pri;
> ! }
> ! }
> !
> ! // put member into group defined by this entry?
> ! if( fgd )
> ! {
> ! GroupDef *mgd = md->getGroupDef();
> ! if (mgd==0)
> ! {
> ! fgd->insertMember(md);
> ! md->setGroupDef(fgd, pri, root->fileName, root->startLine, root->doc.length() != 0);
> ! }
> ! else if (mgd!=fgd)
> ! {
> ! bool moveit = false;
> !
> ! // move member from one group to another if
> ! // - the new one has a higher priority
> ! // - the new entry has the same priority, but with docs where the old one had no docs
> ! if( md->getGroupPri() < pri )
> ! moveit = true;
> ! else
> {
> ! if( md->getGroupPri() == pri )
> ! {
> !
> ! if( root->doc.length() != 0 && !md->getGroupHasDocs() )
> ! moveit = true;
> ! else if( root->doc.length() != 0 && md->getGroupHasDocs() )
> ! {
> ! warn(md->getGroupFileName(),md->getGroupStartLine(),
> ! "Warning: Member documentation for %s found several times in %s groups!\n"
> ! "%s:%d: The member will remain in group %s, and won't be put into group %s",
> ! md->name().data(), Grouping::getGroupPriName( pri ),
> ! root->fileName.data(), root->startLine,
> ! mgd->name().data(),
> ! fgd->name().data()
> ! );
> ! }
> ! }
> ! }
> !
> ! if( moveit )
> ! {
> ! mgd->removeMember(md);
> ! fgd->insertMember(md);
> ! md->setGroupDef(fgd, pri, root->fileName, root->startLine, root->doc.length() != 0);
> }
> }
> }
> }
> ***************
> *** 629,640 ****
>
> void addExampleToGroups(Entry *root,PageInfo *eg)
> {
> ! QListIterator<QCString> sli(*root->groups);
> ! QCString *s;
> ! for (;(s=sli.current());++sli)
> {
> GroupDef *gd=0;
> ! if (!s->isEmpty() && (gd=Doxygen::groupDict[*s]))
> {
> gd->addExample(eg);
> //printf(...
[truncated message content] |