Functions
groupdef.cpp File Reference
#include <ctype.h>
#include <qregexp.h>
#include "groupdef.h"
#include "classdef.h"
#include "filedef.h"
#include "classlist.h"
#include "outputlist.h"
#include "namespacedef.h"
#include "language.h"
#include "util.h"
#include "memberlist.h"
#include "message.h"
#include "membergroup.h"
#include "doxygen.h"
#include "pagedef.h"
#include "docparser.h"
#include "searchindex.h"
#include "dot.h"
#include "vhdldocgen.h"
#include "layout.h"
#include "arguments.h"
#include "entry.h"
#include "membername.h"
#include "dirdef.h"
#include "config.h"

Go to the source code of this file.

Functions

void addClassToGroups (Entry *root, ClassDef *cd)
 
void addNamespaceToGroups (Entry *root, NamespaceDef *nd)
 
void addDirToGroups (Entry *root, DirDef *dd)
 
void addGroupToGroups (Entry *root, GroupDef *subGroup)
 
void addMemberToGroups (Entry *root, MemberDef *md)
 
void addExampleToGroups (Entry *root, PageDef *eg)
 

Function Documentation

void addClassToGroups ( Entry root,
ClassDef cd 
)

Definition at line 1306 of file groupdef.cpp.

1307 {
1308  QListIterator<Grouping> gli(*root->groups);
1309  Grouping *g;
1310  for (;(g=gli.current());++gli)
1311  {
1312  GroupDef *gd=0;
1313  if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g->groupname)))
1314  {
1315  if (gd->addClass(cd))
1316  {
1317  cd->makePartOfGroup(gd);
1318  }
1319  //printf("Compound %s: in group %s\n",cd->name().data(),gd->groupTitle());
1320  }
1321  }
1322 }
Definition: types.h:61
static GroupSDict * groupSDict
Definition: doxygen.h:119
static constexpr double g
Definition: Units.h:144
bool isEmpty() const
Definition: qcstring.h:189
bool addClass(const ClassDef *def)
Definition: groupdef.cpp:149
QList< Grouping > * groups
list of groups this entry belongs to
Definition: entry.h:280
void makePartOfGroup(GroupDef *gd)
QCString groupname
name of the group
Definition: types.h:93
T * find(const char *key)
Definition: sortdict.h:232
void addDirToGroups ( Entry root,
DirDef dd 
)

Definition at line 1341 of file groupdef.cpp.

1342 {
1343  //printf("*** root->groups->count()=%d\n",root->groups->count());
1344  QListIterator<Grouping> gli(*root->groups);
1345  Grouping *g;
1346  for (;(g=gli.current());++gli)
1347  {
1348  GroupDef *gd=0;
1349  //printf("group `%s'\n",g->groupname.data());
1350  if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g->groupname)))
1351  {
1352  gd->addDir(dd);
1353  dd->makePartOfGroup(gd);
1354  //printf("Dir %s: in group %s\n",dd->name().data(),g->groupname.data());
1355  }
1356  }
1357 }
Definition: types.h:61
static GroupSDict * groupSDict
Definition: doxygen.h:119
static constexpr double g
Definition: Units.h:144
bool isEmpty() const
Definition: qcstring.h:189
void addDir(const DirDef *dd)
Definition: groupdef.cpp:213
QList< Grouping > * groups
list of groups this entry belongs to
Definition: entry.h:280
void makePartOfGroup(GroupDef *gd)
QCString groupname
name of the group
Definition: types.h:93
T * find(const char *key)
Definition: sortdict.h:232
void addExampleToGroups ( Entry root,
PageDef eg 
)

Definition at line 1496 of file groupdef.cpp.

1497 {
1498  QListIterator<Grouping> gli(*root->groups);
1499  Grouping *g;
1500  for (;(g=gli.current());++gli)
1501  {
1502  GroupDef *gd=0;
1503  if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g->groupname)))
1504  {
1505  gd->addExample(eg);
1506  eg->makePartOfGroup(gd);
1507  //printf("Example %s: in group %s\n",eg->name().data(),s->data());
1508  }
1509  }
1510 }
Definition: types.h:61
static GroupSDict * groupSDict
Definition: doxygen.h:119
static constexpr double g
Definition: Units.h:144
bool isEmpty() const
Definition: qcstring.h:189
QList< Grouping > * groups
list of groups this entry belongs to
Definition: entry.h:280
void makePartOfGroup(GroupDef *gd)
QCString groupname
name of the group
Definition: types.h:93
void addExample(const PageDef *def)
Definition: groupdef.cpp:230
T * find(const char *key)
Definition: sortdict.h:232
void addGroupToGroups ( Entry root,
GroupDef subGroup 
)

Definition at line 1359 of file groupdef.cpp.

1360 {
1361  //printf("addGroupToGroups for %s groups=%d\n",root->name.data(),
1362  // root->groups?root->groups->count():-1);
1363  QListIterator<Grouping> gli(*root->groups);
1364  Grouping *g;
1365  for (;(g=gli.current());++gli)
1366  {
1367  GroupDef *gd=0;
1368  if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g->groupname)))
1369  {
1370  if (gd==subGroup)
1371  {
1372  warn(root->fileName,root->startLine,"Refusing to add group %s to itself",
1373  gd->name().data());
1374  }
1375  else if (subGroup->findGroup(gd))
1376  {
1377  warn(root->fileName,root->startLine,"Refusing to add group %s to group %s, since the latter is already a "
1378  "subgroup of the former\n", subGroup->name().data(),gd->name().data());
1379  }
1380  else if (!gd->findGroup(subGroup))
1381  {
1382  gd->addGroup(subGroup);
1383  subGroup->makePartOfGroup(gd);
1384  }
1385  }
1386  }
1387 }
Definition: types.h:61
static GroupSDict * groupSDict
Definition: doxygen.h:119
static constexpr double g
Definition: Units.h:144
bool isEmpty() const
Definition: qcstring.h:189
void addGroup(const GroupDef *def)
Definition: groupdef.cpp:532
const QCString & name() const
Definition: definition.h:114
QList< Grouping > * groups
list of groups this entry belongs to
Definition: entry.h:280
bool findGroup(const GroupDef *def) const
Definition: groupdef.cpp:511
int startLine
start line of entry in the source
Definition: entry.h:283
void makePartOfGroup(GroupDef *gd)
const char * data() const
Definition: qcstring.h:207
void warn(const char *file, int line, const char *fmt,...)
Definition: message.cpp:183
QCString groupname
name of the group
Definition: types.h:93
QCString fileName
file this entry was extracted from
Definition: entry.h:282
T * find(const char *key)
Definition: sortdict.h:232
void addMemberToGroups ( Entry root,
MemberDef md 
)

Add a member to the group with the highest priority

Definition at line 1390 of file groupdef.cpp.

1391 {
1392  //printf("addMemberToGroups: Root %p = %s, md %p=%s groups=%d\n",
1393  // root, root->name.data(), md, md->name().data(), root->groups->count() );
1394  QListIterator<Grouping> gli(*root->groups);
1395  Grouping *g;
1396 
1397  // Search entry's group list for group with highest pri.
1399  GroupDef *fgd=0;
1400  for (;(g=gli.current());++gli)
1401  {
1402  GroupDef *gd=0;
1403  if (!g->groupname.isEmpty() &&
1404  (gd=Doxygen::groupSDict->find(g->groupname)) &&
1405  g->pri >= pri)
1406  {
1407  if (fgd && gd!=fgd && g->pri==pri)
1408  {
1409  warn(root->fileName.data(), root->startLine,
1410  "Member %s found in multiple %s groups! "
1411  "The member will be put in group %s, and not in group %s",
1412  md->name().data(), Grouping::getGroupPriName( pri ),
1413  gd->name().data(), fgd->name().data()
1414  );
1415  }
1416 
1417  fgd = gd;
1418  pri = g->pri;
1419  }
1420  }
1421  //printf("fgd=%p\n",fgd);
1422 
1423  // put member into group defined by this entry?
1424  if (fgd)
1425  {
1426  GroupDef *mgd = md->getGroupDef();
1427  //printf("mgd=%p\n",mgd);
1428  bool insertit = FALSE;
1429  if (mgd==0)
1430  {
1431  insertit = TRUE;
1432  }
1433  else if (mgd!=fgd)
1434  {
1435  bool moveit = FALSE;
1436 
1437  // move member from one group to another if
1438  // - the new one has a higher priority
1439  // - the new entry has the same priority, but with docs where the old one had no docs
1440  if (md->getGroupPri()<pri)
1441  {
1442  moveit = TRUE;
1443  }
1444  else
1445  {
1446  if (md->getGroupPri()==pri)
1447  {
1448  if (!root->doc.isEmpty() && !md->getGroupHasDocs())
1449  {
1450  moveit = TRUE;
1451  }
1452  else if (!root->doc.isEmpty() && md->getGroupHasDocs())
1453  {
1455  "Member documentation for %s found several times in %s groups!\n"
1456  "%s:%d: The member will remain in group %s, and won't be put into group %s",
1457  md->name().data(), Grouping::getGroupPriName( pri ),
1458  root->fileName.data(), root->startLine,
1459  mgd->name().data(),
1460  fgd->name().data()
1461  );
1462  }
1463  }
1464  }
1465 
1466  if (moveit)
1467  {
1468  //printf("removeMember\n");
1469  mgd->removeMember(md);
1470  insertit = TRUE;
1471  }
1472  }
1473 
1474  if (insertit)
1475  {
1476  //printf("insertMember found at %s line %d: %s: related %s\n",
1477  // md->getDefFileName().data(),md->getDefLine(),
1478  // md->name().data(),root->relates.data());
1479  bool success = fgd->insertMember(md);
1480  if (success)
1481  {
1482  //printf("insertMember successful\n");
1483  md->setGroupDef(fgd,pri,root->fileName,root->startLine,
1484  !root->doc.isEmpty());
1486  if (cd)
1487  {
1488  cd->setGroupDefForAllMembers(fgd,pri,root->fileName,root->startLine,root->doc.length() != 0);
1489  }
1490  }
1491  }
1492  }
1493 }
Definition: types.h:61
static GroupSDict * groupSDict
Definition: doxygen.h:119
static constexpr double g
Definition: Units.h:144
bool isEmpty() const
Definition: qcstring.h:189
Grouping::GroupPri_t getGroupPri() const
Definition: memberdef.cpp:4100
uint length() const
Definition: qcstring.h:195
const bool FALSE
Definition: qglobal.h:370
GroupPri_t
Definition: types.h:64
GroupPri_t pri
priority of this definition
Definition: types.h:94
void removeMember(MemberDef *md)
Definition: groupdef.cpp:424
const QCString & name() const
Definition: definition.h:114
QList< Grouping > * groups
list of groups this entry belongs to
Definition: entry.h:280
void setGroupDefForAllMembers(GroupDef *g, Grouping::GroupPri_t pri, const QCString &fileName, int startLine, bool hasDocs)
Definition: classdef.cpp:3615
bool insertMember(MemberDef *def, bool docOnly=FALSE)
Definition: groupdef.cpp:259
int startLine
start line of entry in the source
Definition: entry.h:283
const char * data() const
Definition: qcstring.h:207
void warn(const char *file, int line, const char *fmt,...)
Definition: message.cpp:183
QCString groupname
name of the group
Definition: types.h:93
QCString doc
documentation block (partly parsed)
Definition: entry.h:260
const char * getGroupFileName() const
Definition: memberdef.cpp:4105
GroupDef * getGroupDef() const
Definition: memberdef.cpp:4095
QCString fileName
file this entry was extracted from
Definition: entry.h:282
ClassDef * getClassDefOfAnonymousType()
Definition: memberdef.cpp:1236
static const char * getGroupPriName(GroupPri_t priority)
Definition: types.h:75
int getGroupStartLine() const
Definition: memberdef.cpp:4110
void setGroupDef(GroupDef *gd, Grouping::GroupPri_t pri, const QCString &fileName, int startLine, bool hasDocs, MemberDef *member=0)
Definition: memberdef.cpp:3363
T * find(const char *key)
Definition: sortdict.h:232
const bool TRUE
Definition: qglobal.h:371
bool getGroupHasDocs() const
Definition: memberdef.cpp:4115
void addNamespaceToGroups ( Entry root,
NamespaceDef nd 
)

Definition at line 1324 of file groupdef.cpp.

1325 {
1326  //printf("root->groups->count()=%d\n",root->groups->count());
1327  QListIterator<Grouping> gli(*root->groups);
1328  Grouping *g;
1329  for (;(g=gli.current());++gli)
1330  {
1331  GroupDef *gd=0;
1332  //printf("group `%s'\n",s->data());
1333  if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g->groupname)))
1334  {
1335  if (gd->addNamespace(nd)) nd->makePartOfGroup(gd);
1336  //printf("Namespace %s: in group %s\n",nd->name().data(),s->data());
1337  }
1338  }
1339 }
Definition: types.h:61
static GroupSDict * groupSDict
Definition: doxygen.h:119
static constexpr double g
Definition: Units.h:144
bool isEmpty() const
Definition: qcstring.h:189
QList< Grouping > * groups
list of groups this entry belongs to
Definition: entry.h:280
void makePartOfGroup(GroupDef *gd)
QCString groupname
name of the group
Definition: types.h:93
bool addNamespace(const NamespaceDef *def)
Definition: groupdef.cpp:197
T * find(const char *key)
Definition: sortdict.h:232