memberlist.cpp
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  *
4  *
5  * Copyright (C) 1997-2015 by Dimitri van Heesch.
6  *
7  * Permission to use, copy, modify, and distribute this software and its
8  * documentation under the terms of the GNU General Public License is hereby
9  * granted. No representations are made about the suitability of this software
10  * for any purpose. It is provided "as is" without express or implied warranty.
11  * See the GNU General Public License for more details.
12  *
13  * Documents produced by Doxygen are derivative works derived from the
14  * input used in their production; they are not affected by this license.
15  *
16  */
17 
18 #include <qregexp.h>
19 
20 #include "memberlist.h"
21 #include "classdef.h"
22 #include "message.h"
23 #include "util.h"
24 #include "language.h"
25 #include "doxygen.h"
26 #include "outputlist.h"
27 #include "groupdef.h"
28 #include "marshal.h"
29 #include "vhdldocgen.h"
30 #include "namespacedef.h"
31 #include "filedef.h"
32 #include "membergroup.h"
33 #include "config.h"
34 #include "docparser.h"
35 
37 {
39  m_varCnt=0;
40  m_funcCnt=0;
41  m_enumCnt=0;
42  m_enumValCnt=0;
43  m_typeCnt=0;
44  m_protoCnt=0;
45  m_defCnt=0;
46  m_friendCnt=0;
47  m_numDecMembers=-1; // special value indicating that value needs to be computed
48  m_numDocMembers=-1; // special value indicating that value needs to be computed
52 }
53 
55 {
57  m_varCnt=0;
58  m_funcCnt=0;
59  m_enumCnt=0;
60  m_enumValCnt=0;
61  m_typeCnt=0;
62  m_protoCnt=0;
63  m_defCnt=0;
64  m_friendCnt=0;
65  m_numDecMembers=-1; // special value indicating that value needs to be computed
66  m_numDocMembers=-1; // special value indicating that value needs to be computed
70 }
71 
73 {
74  delete memberGroupList;
75 }
76 
77 int MemberList::compareValues(const MemberDef *c1, const MemberDef *c2) const
78 {
79  static bool sortConstructorsFirst = Config_getBool("SORT_MEMBERS_CTORS_1ST");
80  if (sortConstructorsFirst) {
81  int ord1 = c1->isConstructor() ? 2 : (c1->isDestructor() ? 1 : 0);
82  int ord2 = c2->isConstructor() ? 2 : (c2->isDestructor() ? 1 : 0);
83  if (ord1 > ord2)
84  return -1;
85  else if (ord2 > ord1)
86  return 1;
87  }
88  int cmp = qstricmp(c1->name(),c2->name());
89  return cmp!=0 ? cmp : c1->getDefLine()-c2->getDefLine();
90 }
91 
93 {
94  int count=0;
95  QListIterator<MemberDef> mli(*this);
96  MemberDef *md;
97  for (mli.toFirst();(md=mli.current());++mli)
98  {
99  if (md->isBriefSectionVisible())
100  {
101  if (md->memberType()!=MemberType_Friend &&
103  {
104  //printf("member %s: isReimplementedBy(%s)=%d\n",md->name().data(),
105  // inheritedFrom->name().data(),
106  // md->isReimplementedBy(inheritedFrom));
107  if (md->memberType()==MemberType_Function)
108  {
109  if (!md->isReimplementedBy(inheritedFrom)) count++;
110  }
111  else
112  {
113  count++;
114  }
115  }
116  }
117  }
118  if (memberGroupList)
119  {
121  MemberGroup *mg;
122  for (;(mg=mgli.current());++mgli)
123  {
124  count+=mg->countInheritableMembers(inheritedFrom);
125  }
126  }
127  //printf("%s::countInheritableMembers(%s)=%d\n",
128  // listTypeAsString().data(),
129  // inheritedFrom->name().data(),count);
130  return count;
131 }
132 
133 /*! Count the number of members in this list that are visible in
134  * the declaration part of a compound's documentation page.
135  */
136 void MemberList::countDecMembers(bool countEnumValues,GroupDef *gd)
137 {
138  if (m_numDecMembers!=-1) return;
139 
140  //printf("----- countDecMembers count=%d ----\n",count());
143  m_numDecMembers=0;
144  QListIterator<MemberDef> mli(*this);
145  MemberDef *md;
146  for (mli.toFirst();(md=mli.current());++mli)
147  {
148  //printf("MemberList::countDecMembers(md=%s,%d)\n",md->name().data(),md->isBriefSectionVisible());
149  if (md->isBriefSectionVisible())
150  {
151  switch(md->memberType())
152  {
153  case MemberType_Variable: // fall through
154  case MemberType_Event: // fall through
156  break;
157 // apparently necessary to get this to show up in declarations section?
158  case MemberType_Interface: // fall through
159  case MemberType_Service: // fall through
160  case MemberType_Function: // fall through
161  case MemberType_Signal: // fall through
162  case MemberType_DCOP: // fall through
163  case MemberType_Slot: if (!md->isRelated() || md->getClassDef())
164  m_funcCnt++,m_numDecMembers++;
165  break;
166  case MemberType_Enumeration: m_enumCnt++,m_numDecMembers++; break;
167  case MemberType_EnumValue: if (countEnumValues)
168  m_enumValCnt++,m_numDecMembers++;
169  break;
170  case MemberType_Typedef: m_typeCnt++,m_numDecMembers++; break;
171  //case MemberType_Prototype: m_protoCnt++,m_numDecMembers++; break;
172  case MemberType_Define: if (Config_getBool("EXTRACT_ALL") ||
173  md->argsString() ||
174  !md->initializer().isEmpty() ||
175  md->hasDocumentation()
176  ) m_defCnt++,m_numDecMembers++;
177  break;
178  case MemberType_Friend: m_friendCnt++,m_numDecMembers++;
179  break;
180  default:
181  err("Unknown member type found for member `%s'\n!",md->name().data());
182  }
183  }
184  }
185  if (memberGroupList)
186  {
188  MemberGroup *mg;
189  for (;(mg=mgli.current());++mgli)
190  {
191  mg->countDecMembers(gd);
192  m_varCnt+=mg->varCount();
193  m_funcCnt+=mg->funcCount();
194  m_enumCnt+=mg->enumCount();
196  m_typeCnt+=mg->typedefCount();
197  m_protoCnt+=mg->protoCount();
198  m_defCnt+=mg->defineCount();
199  m_friendCnt+=mg->friendCount();
201  }
202  }
203  //printf("----- end countDecMembers ----\n");
204 
205  //printf("MemberList::countDecMembers()=%d\n",m_numDecMembers);
206 }
207 
208 void MemberList::countDocMembers(bool countEnumValues)
209 {
210  if (m_numDocMembers!=-1) return; // used cached value
211  m_numDocMembers=0;
212  QListIterator<MemberDef> mli(*this);
213  MemberDef *md;
214  for (mli.toFirst();(md=mli.current());++mli)
215  {
217  {
218  // do not count enum values, since they do not produce entries of their own
219  if (countEnumValues || md->memberType()!=MemberType_EnumValue)
220  m_numDocMembers++;
221  }
222  }
223  if (memberGroupList)
224  {
226  MemberGroup *mg;
227  for (;(mg=mgli.current());++mgli)
228  {
229  mg->countDocMembers();
231  }
232  }
233  //printf("MemberList::countDocMembers()=%d memberGroupList=%p\n",m_numDocMembers,memberGroupList);
234 }
235 
237 {
238  return QList<MemberDef>::insert(index,md);
239 }
240 
242 {
244 }
245 
247 {
249 }
250 
253 {
254 }
255 
257 {
258  MemberListIterator mli(*this);
259  MemberDef *md;
260  for ( ; (md=mli.current()); ++mli )
261  {
262  if (md->isBriefSectionVisible())
263  {
264  switch (md->memberType())
265  {
266  case MemberType_Define: // fall through
267  case MemberType_Typedef: // fall through
268  case MemberType_Variable: // fall through
269  case MemberType_Function: // fall through
270  case MemberType_Signal: // fall through
271  case MemberType_Slot: // fall through
272  case MemberType_DCOP: // fall through
273  case MemberType_Property: // fall through
274  case MemberType_Interface: // fall through
275  case MemberType_Service: // fall through
276  case MemberType_Event:
277  return TRUE;
279  {
280  int enumVars=0;
281  MemberListIterator vmli(*this);
282  MemberDef *vmd;
283  QCString name(md->name());
284  int i=name.findRev("::");
285  if (i!=-1) name=name.right(name.length()-i-2); // strip scope (TODO: is this needed?)
286  if (name[0]=='@') // anonymous enum => append variables
287  {
288  for ( ; (vmd=vmli.current()) ; ++vmli)
289  {
290  QCString vtype=vmd->typeString();
291  if ((vtype.find(name))!=-1)
292  {
293  enumVars++;
294  }
295  }
296  }
297  // if this is an anonymous enum and there are variables of this
298  // enum type (i.e. enumVars>0), then we do not show the enum here.
299  if (enumVars==0) // show enum here
300  {
301  return TRUE;
302  }
303  }
304  break;
305  case MemberType_Friend:
306  return TRUE;
307  case MemberType_EnumValue:
308  {
309  if (m_inGroup)
310  {
311  return TRUE;
312  }
313  }
314  break;
315  }
316  }
317  }
318  return FALSE;
319 }
320 
322  ClassDef *cd,NamespaceDef *nd,FileDef *fd,
323  GroupDef *gd,ClassDef *inheritedFrom,const char *inheritId
324  )
325 {
326  //printf("----- writePlainDeclaration() ----\n");
327  static bool hideUndocMembers = Config_getBool("HIDE_UNDOC_MEMBERS");
328  countDecMembers();
329  if (numDecMembers()==0)
330  {
331  //printf(" --> no members!\n");
332  return; // no members in this list
333  }
334  //printf(" --> writePlainDeclaration() numDecMembers()=%d\n",
335  // numDecMembers());
336 
337  ol.pushGeneratorState();
338 
339  bool first=TRUE;
340  MemberDef *md;
341  MemberListIterator mli(*this);
342  for ( ; (md=mli.current()); ++mli )
343  {
344  //printf(">>> Member `%s' type=%d visible=%d\n",
345  // md->name().data(),md->memberType(),md->isBriefSectionVisible());
346  if ((inheritedFrom==0 || !md->isReimplementedBy(inheritedFrom)) &&
347  md->isBriefSectionVisible())
348  {
349  //printf(">>> rendering\n");
350  switch(md->memberType())
351  {
352  case MemberType_Define: // fall through
353  //case MemberType_Prototype: // fall through
354  case MemberType_Typedef: // fall through
355  case MemberType_Variable: // fall through
356  case MemberType_Function: // fall through
357  case MemberType_Signal: // fall through
358  case MemberType_Slot: // fall through
359  case MemberType_DCOP: // fall through
360  case MemberType_Property: // fall through
361  case MemberType_Interface: // fall through
362  case MemberType_Service: // fall through
363  case MemberType_Event:
364  {
365  if (first) ol.startMemberList(),first=FALSE;
366  md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup,inheritedFrom,inheritId);
367  break;
368  }
370  {
371  int enumVars=0;
372  MemberListIterator vmli(*this);
373  MemberDef *vmd;
374  QCString name(md->name());
375  int i=name.findRev("::");
376  if (i!=-1) name=name.right(name.length()-i-2); // strip scope (TODO: is this needed?)
377  if (name[0]=='@') // anonymous enum => append variables
378  {
379  for ( ; (vmd=vmli.current()) ; ++vmli)
380  {
381  QCString vtype=vmd->typeString();
382  if ((vtype.find(name))!=-1)
383  {
384  enumVars++;
385  vmd->setAnonymousEnumType(md);
386  }
387  }
388  }
389  // if this is an anonymous enum and there are variables of this
390  // enum type (i.e. enumVars>0), then we do not show the enum here.
391  if (enumVars==0 && !hideUndocMembers) // show enum here
392  {
393  //printf("Enum!!\n");
394  if (first)
395  {
396  ol.startMemberList();
397  first=FALSE;
398  }
400  ol.startMemberItem(md->anchor(),0,inheritId);
401  bool detailsLinkable = md->isDetailedSectionLinkable();
402  if (!detailsLinkable)
403  {
404  ol.startDoxyAnchor(md->getOutputFileBase(),0,md->anchor(),md->name(),QCString());
405  }
406  ol.writeString("enum ");
407  ol.insertMemberAlign();
408  md->writeEnumDeclaration(ol,cd,nd,fd,gd);
409  if (!detailsLinkable)
410  {
411  ol.endDoxyAnchor(md->getOutputFileBase(),md->anchor());
412  }
413  if (!md->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
414  {
415  DocRoot *rootNode = validatingParseDoc(
416  md->briefFile(),md->briefLine(),
417  cd,md,
418  md->briefDescription(),
419  TRUE,FALSE,0,TRUE,FALSE
420  );
421  if (rootNode && !rootNode->isEmpty())
422  {
423  ol.startMemberDescription(md->anchor());
424  ol.writeDoc(rootNode,cd,md);
425  if (md->isDetailedSectionLinkable())
426  {
428  ol.docify(" ");
429  ol.startTextLink(md->getOutputFileBase(),
430  md->anchor());
432  ol.endTextLink();
433  ol.enableAll();
434  }
436  }
437  delete rootNode;
438  }
439  ol.endMemberItem();
440  ol.endMemberDeclaration(md->anchor(),inheritId);
441  }
442  md->warnIfUndocumented();
443  break;
444  }
445  case MemberType_Friend:
446  if (inheritedFrom==0)
447  {
448  if (first)
449  {
450  ol.startMemberList();
451  first=FALSE;
452  }
453  md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup,inheritedFrom,inheritId);
454  break;
455  }
456  case MemberType_EnumValue:
457  {
458  if (m_inGroup)
459  {
460  //printf("EnumValue!\n");
461  if (first) ol.startMemberList(),first=FALSE;
462  md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup,inheritedFrom,inheritId);
463  }
464  }
465  break;
466  }
467  }
468  }
469 
470  // handle members that are inside anonymous compounds and for which
471  // no variables of the anonymous compound type exist.
472  if (cd)
473  {
474  MemberListIterator mli(*this);
475  for ( ; (md=mli.current()) ; ++mli )
476  {
477  if (md->fromAnonymousScope() && !md->anonymousDeclShown())
478  {
480  //printf("anonymous compound members\n");
481  if (md->isBriefSectionVisible())
482  {
483  if (first)
484  {
485  ol.startMemberList();
486  first=FALSE;
487  }
488  md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup);
489  }
491  }
492  }
493  }
494 
495  if (!first)
496  {
497  ol.endMemberList();
498  }
499 
500  ol.popGeneratorState();
501  //printf("----- end writePlainDeclaration() ----\n");
502 }
503 
504 /** Writes the list of members to the output.
505  * @param ol Output list to write to
506  * @param cd non-null if this list is part of class documentation.
507  * @param nd non-null if this list is part of namespace documentation.
508  * @param fd non-null if this list is part of file documentation.
509  * @param gd non-null if this list is part of group documentation.
510  * @param title Title to use for the member list.
511  * @param subtitle Sub title to use for the member list.
512  * @param showEnumValues Obsolete, always set to FALSE.
513  * @param showInline if set to TRUE if title is rendered differently
514  * @param inheritedFrom if not 0, the list is shown inside the
515  * given class as inherited members, parameter cd points to the
516  * class containing the members.
517  * @param lt Type of list that is inherited from.
518  */
520  ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd,
521  const char *title,const char *subtitle, bool showEnumValues,
522  bool showInline,ClassDef *inheritedFrom,MemberListType lt)
523 {
524  (void)showEnumValues; // unused
525 
526  //printf("----- writeDeclaration() this=%p ---- inheritedFrom=%p\n",this,inheritedFrom);
527  static bool optimizeVhdl = Config_getBool("OPTIMIZE_OUTPUT_VHDL");
528  QCString inheritId;
529 
530  countDecMembers(/*showEnumValues*/FALSE,gd); // count members shown in this section
531  Definition *ctx = cd;
532  if (ctx==0 && nd) ctx = nd;
533  if (ctx==0 && gd) ctx = gd;
534  if (ctx==0 && fd) ctx = fd;
535 
536  //printf("%p: MemberList::writeDeclaration(title=`%s',subtitle=`%s')=%d inheritedFrom=%p\n",
537  // this,title,subtitle,numDecMembers(),inheritedFrom);
538 
539  int num = numDecMembers();
540  if (inheritedFrom)
541  {
542  //if ( cd && !optimizeVhdl && countInheritableMembers(inheritedFrom)>0 )
543  if ( cd && !optimizeVhdl && cd->countMembersIncludingGrouped(
544  m_listType,inheritedFrom,TRUE)>0 )
545  {
546  ol.pushGeneratorState();
548  inheritId = substitute(listTypeAsString(lt),"-","_")+"_"+
550  if (title)
551  {
552  ol.writeInheritedSectionTitle(inheritId,cd->getReference(),
553  cd->getOutputFileBase(),
554  cd->anchor(),title,cd->displayName());
555  }
556  ol.popGeneratorState();
557  }
558  }
559  else if (num>0)
560  {
561  if (title)
562  {
563  if (showInline)
564  {
565  ol.startInlineHeader();
566  }
567  else
568  {
569  ol.startMemberHeader(listTypeAsString(m_listType));
570  }
571  ol.parseText(title);
572  if (showInline)
573  {
574  ol.endInlineHeader();
575  }
576  else
577  {
578  ol.endMemberHeader();
579  }
580  }
581  if (subtitle)
582  {
583  QCString st=subtitle;
584  st = st.stripWhiteSpace();
585  if (!st.isEmpty())
586  {
587  ol.startMemberSubtitle();
588  ol.generateDoc("[generated]",-1,ctx,0,subtitle,FALSE,FALSE,0,FALSE,FALSE);
589  ol.endMemberSubtitle();
590  }
591  }
592  }
593  if (num>0)
594  {
595  // TODO: Two things need to be worked out for proper VHDL output:
596  // 1. Signals and types under the group need to be
597  // formatted to associate them with the group somehow
598  // indentation, or at the very least, extra space after
599  // the group is done
600  // 2. This might need to be repeated below for memberGroupLists
601  if (optimizeVhdl) // use specific declarations function
602  {
603  VhdlDocGen::writeVhdlDeclarations(this,ol,0,cd,0,0);
604  }
605  else
606  {
607  writePlainDeclarations(ol,cd,nd,fd,gd,inheritedFrom,inheritId);
608  }
609 
610  //printf("memberGroupList=%p\n",memberGroupList);
611  if (memberGroupList)
612  {
613  MemberGroupListIterator mgli(*memberGroupList);
614  MemberGroup *mg;
615  while ((mg=mgli.current()))
616  {
617  bool hasHeader=!mg->header().isEmpty() && mg->header()!="[NOHEADER]";
618  if (inheritId.isEmpty())
619  {
620  //printf("mg->header=%s hasHeader=%d\n",mg->header().data(),hasHeader);
621  ol.startMemberGroupHeader(hasHeader);
622  if (hasHeader)
623  {
624  ol.parseText(mg->header());
625  }
627  if (!mg->documentation().isEmpty())
628  {
629  //printf("Member group has docs!\n");
631  ol.generateDoc(mg->docFile(),mg->docLine(),ctx,0,mg->documentation()+"\n",FALSE,FALSE);
632  ol.endMemberGroupDocs();
633  }
634  ol.startMemberGroup();
635  }
636  //printf("--- mg->writePlainDeclarations ---\n");
637  mg->writePlainDeclarations(ol,cd,nd,fd,gd,inheritedFrom,inheritId);
638  if (inheritId.isEmpty())
639  {
640  ol.endMemberGroup(hasHeader);
641  }
642  ++mgli;
643  }
644  }
645  }
646  if (inheritedFrom && cd)
647  {
648  // also add members that of this list type, that are grouped together
649  // in a separate list in class 'inheritedFrom'
650  cd->addGroupedInheritedMembers(ol,m_listType,inheritedFrom,inheritId);
651  }
652  //printf("----- end writeDeclaration() ----\n");
653 }
654 
656  const char *scopeName, Definition *container,
657  const char *title,bool showEnumValues,bool showInline)
658 {
659  //printf("MemberList::writeDocumentation()\n");
660 
661  countDocMembers(showEnumValues);
662  if (numDocMembers()==0) return;
663 
664  if (title)
665  {
666  ol.pushGeneratorState();
668  ol.writeRuler();
669  ol.popGeneratorState();
670  ol.startGroupHeader(showInline ? 2 : 0);
671  ol.parseText(title);
672  ol.endGroupHeader(showInline ? 2 : 0);
673  }
674  ol.startMemberDocList();
675 
676  MemberListIterator mli(*this);
677  MemberDef *md;
678  for ( ; (md=mli.current()) ; ++mli)
679  {
680  md->writeDocumentation(this,ol,scopeName,container,
681  m_inGroup,showEnumValues,showInline);
682  }
683  if (memberGroupList)
684  {
685  printf("MemberList::writeDocumentation() -- member groups %d\n",memberGroupList->count());
686  MemberGroupListIterator mgli(*memberGroupList);
687  MemberGroup *mg;
688  for (;(mg=mgli.current());++mgli)
689  {
690  mg->writeDocumentation(ol,scopeName,container,showEnumValues,showInline);
691  }
692  }
693  ol.endMemberDocList();
694 }
695 
696 // members in a table
698  Definition *container)
699 {
700  countDocMembers(FALSE);
701  //printf("MemberList count=%d\n",numDocMembers());
702  if (numDocMembers()==0) return;
703 
705  MemberListIterator mli(*this);
706  MemberDef *md;
707  for ( ; (md=mli.current()) ; ++mli)
708  {
709  md->writeMemberDocSimple(ol,container);
710  }
711  ol.endMemberDocSimple();
712 }
713 
714 // separate member pages
716  const char *scopeName, Definition *container)
717 {
718  static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW");
719  MemberListIterator mli(*this);
720  MemberDef *md;
721  for ( ; (md=mli.current()) ; ++mli)
722  {
723  if (md->isDetailedSectionLinkable())
724  {
725  QCString diskName=md->getOutputFileBase();
727  startFile(ol,diskName,md->name(),title,HLI_None,!generateTreeView,diskName);
728  if (!generateTreeView)
729  {
730  container->writeNavigationPath(ol);
731  ol.endQuickIndices();
732  }
733  ol.startContents();
734 
735  if (generateTreeView)
736  {
737  md->writeDocumentation(this,ol,scopeName,container,m_inGroup);
738  ol.endContents();
739  endFileWithNavPath(container,ol);
740  }
741  else
742  {
743  ol.writeString("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n"
744  " <tr>\n"
745  " <td valign=\"top\">\n");
746 
747  container->writeQuickMemberLinks(ol,md);
748 
749  ol.writeString(" </td>\n");
750  ol.writeString(" <td valign=\"top\" class=\"mempage\">\n");
751 
752  md->writeDocumentation(this,ol,scopeName,container,m_inGroup);
753 
754  ol.writeString(" </td>\n");
755  ol.writeString(" </tr>\n");
756  ol.writeString("</table>\n");
757 
758  endFile(ol);
759  }
760  }
761  if (memberGroupList)
762  {
763  //printf("MemberList::writeDocumentation() -- member groups\n");
764  MemberGroupListIterator mgli(*memberGroupList);
765  MemberGroup *mg;
766  for (;(mg=mgli.current());++mgli)
767  {
768  mg->writeDocumentationPage(ol,scopeName,container);
769  }
770  }
771  }
772 }
773 
775 {
776  if (memberGroupList==0)
777  {
778  memberGroupList=new MemberGroupList;
779  }
780  //printf("addMemberGroup: this=%p mg=%p\n",this,mg);
781  memberGroupList->append(mg);
782 }
783 
785 {
786  MemberListIterator mli(*this);
787  MemberDef *md;
788  for ( ; (md=mli.current()) ; ++mli)
789  {
790  if (md->getGroupDef()==0 || def->definitionType()==Definition::TypeGroup)
791  {
792  md->addListReference(def);
793  MemberList *enumFields = md->enumFieldList();
794  if (md->memberType()==MemberType_Enumeration && enumFields)
795  {
796  //printf(" Adding enum values!\n");
797  MemberListIterator vmli(*enumFields);
798  MemberDef *vmd;
799  for ( ; (vmd=vmli.current()) ; ++vmli)
800  {
801  //printf(" adding %s\n",vmd->name().data());
802  vmd->addListReference(def);
803  }
804  }
805  }
806  }
807  if (memberGroupList)
808  {
809  MemberGroupListIterator mgli(*memberGroupList);
810  MemberGroup *mg;
811  for (;(mg=mgli.current());++mgli)
812  {
813  mg->addListReferences(def);
814  }
815  }
816 }
817 
819 {
820  MemberListIterator mli(*this);
821  MemberDef *md;
822  for ( ; (md=mli.current()) ; ++mli)
823  {
825  }
826  if (memberGroupList)
827  {
828  MemberGroupListIterator mgli(*memberGroupList);
829  MemberGroup *mg;
830  for (;(mg=mgli.current());++mgli)
831  {
833  }
834  }
835 }
836 
838 {
839  marshalInt(s,(int)m_listType);
840  marshalInt(s,m_varCnt);
841  marshalInt(s,m_funcCnt);
842  marshalInt(s,m_enumCnt);
843  marshalInt(s,m_enumValCnt);
844  marshalInt(s,m_typeCnt);
845  marshalInt(s,m_protoCnt);
846  marshalInt(s,m_defCnt);
847  marshalInt(s,m_friendCnt);
848  marshalInt(s,m_numDecMembers);
849  marshalInt(s,m_numDocMembers);
850  marshalBool(s,m_inGroup);
851  marshalBool(s,m_inFile);
852  marshalBool(s,m_needsSorting);
853  if (memberGroupList==0)
854  {
855  marshalUInt(s,NULL_LIST); // null pointer representation
856  }
857  else
858  {
859  marshalUInt(s,memberGroupList->count());
860  QListIterator<MemberGroup> mgi(*memberGroupList);
861  MemberGroup *mg=0;
862  for (mgi.toFirst();(mg=mgi.current());++mgi)
863  {
864  mg->marshal(s);
865  }
866  }
867 }
868 
870 {
871  m_listType = (MemberListType)unmarshalInt(s);
872  m_varCnt = unmarshalInt(s);
873  m_funcCnt = unmarshalInt(s);
874  m_enumCnt = unmarshalInt(s);
875  m_enumValCnt = unmarshalInt(s);
876  m_typeCnt = unmarshalInt(s);
877  m_protoCnt = unmarshalInt(s);
878  m_defCnt = unmarshalInt(s);
879  m_friendCnt = unmarshalInt(s);
880  m_numDecMembers = unmarshalInt(s);
881  m_numDocMembers = unmarshalInt(s);
882  m_inGroup = unmarshalBool(s);
883  m_inFile = unmarshalBool(s);
884  m_needsSorting = unmarshalBool(s);
885  uint i,count = unmarshalUInt(s);
886  if (count==NULL_LIST) // empty list
887  {
888  memberGroupList = 0;
889  }
890  else // add member groups
891  {
892  memberGroupList = new MemberGroupList;
893  for (i=0;i<count;i++)
894  {
895  MemberGroup *mg = new MemberGroup;
896  mg->unmarshal(s);
897  memberGroupList->append(mg);
898  }
899  }
900 }
901 
903 {
904  m_needsSorting = b;
905 }
906 
908 {
909  switch(type)
910  {
911  case MemberListType_pubMethods: return "pub-methods";
912  case MemberListType_proMethods: return "pro-methods";
913  case MemberListType_pacMethods: return "pac-methods";
914  case MemberListType_priMethods: return "pri-methods";
915  case MemberListType_pubStaticMethods: return "pub-static-methods";
916  case MemberListType_proStaticMethods: return "pro-static-methods";
917  case MemberListType_pacStaticMethods: return "pac-static-methods";
918  case MemberListType_priStaticMethods: return "pri-static-methods";
919  case MemberListType_pubSlots: return "pub-slots";
920  case MemberListType_proSlots: return "pro-slots";
921  case MemberListType_priSlots: return "pri-slots";
922  case MemberListType_pubAttribs: return "pub-attribs";
923  case MemberListType_proAttribs: return "pro-attribs";
924  case MemberListType_pacAttribs: return "pac-attribs";
925  case MemberListType_priAttribs: return "pri-attribs";
926  case MemberListType_pubStaticAttribs: return "pub-static-attribs";
927  case MemberListType_proStaticAttribs: return "pro-static-attribs";
928  case MemberListType_pacStaticAttribs: return "pac-static-attribs";
929  case MemberListType_priStaticAttribs: return "pri-static-attribs";
930  case MemberListType_pubTypes: return "pub-types";
931  case MemberListType_proTypes: return "pro-types";
932  case MemberListType_pacTypes: return "pac-types";
933  case MemberListType_priTypes: return "pri-types";
934  case MemberListType_related: return "related";
935  case MemberListType_signals: return "signals";
936  case MemberListType_friends: return "friends";
937  case MemberListType_dcopMethods: return "dcop-methods";
938  case MemberListType_properties: return "properties";
939  case MemberListType_events: return "events";
940  case MemberListType_interfaces: return "interfaces";
941  case MemberListType_services: return "services";
942  case MemberListType_decDefineMembers: return "define-members";
943  case MemberListType_decProtoMembers: return "proto-members";
944  case MemberListType_decTypedefMembers: return "typedef-members";
945  case MemberListType_decEnumMembers: return "enum-members";
946  case MemberListType_decFuncMembers: return "func-members";
947  case MemberListType_decVarMembers: return "var-members";
948  case MemberListType_decEnumValMembers: return "enumval-members";
949  case MemberListType_decPubSlotMembers: return "pub-slot-members";
950  case MemberListType_decProSlotMembers: return "pro-slot-members";
951  case MemberListType_decPriSlotMembers: return "pri-slot-members";
952  case MemberListType_decSignalMembers: return "signal-members";
953  case MemberListType_decEventMembers: return "event-members";
954  case MemberListType_decFriendMembers: return "friend-members";
955  case MemberListType_decPropMembers: return "prop-members";
956  case MemberListType_enumFields: return "enum-fields";
957  case MemberListType_memberGroup: return "member-group";
958  default: break;
959  }
960  return "";
961 }
962 
964 {
965  MemberListIterator mli(*this);
966  MemberDef *md;
967  for ( ; (md=mli.current()) ; ++mli)
968  {
969  if (md->getLanguage()!=SrcLangExt_VHDL)
970  {
971  md->writeTagFile(tagFile);
972  if (md->memberType()==MemberType_Enumeration && md->enumFieldList() && !md->isStrong())
973  {
974  MemberListIterator vmli(*md->enumFieldList());
975  MemberDef *vmd;
976  for ( ; (vmd=vmli.current()) ; ++vmli)
977  {
978  vmd->writeTagFile(tagFile);
979  }
980  }
981  }
982  else
983  {
984  VhdlDocGen::writeTagFile(md,tagFile);
985  }
986  }
987  if (memberGroupList)
988  {
989  MemberGroupListIterator mgli(*memberGroupList);
990  MemberGroup *mg;
991  for (;(mg=mgli.current());++mgli)
992  {
993  mg->writeTagFile(tagFile);
994  }
995  }
996 }
997 
998 //--------------------------------------------------------------------------
999 
1000 int MemberSDict::compareValues(const MemberDef *c1, const MemberDef *c2) const
1001 {
1002  //printf("MemberSDict::compareValues(%s,%s)\n",c1->name().data(),c2->name().data());
1003  int cmp = qstricmp(c1->name(),c2->name());
1004  if (cmp)
1005  {
1006  return cmp;
1007  }
1008  else
1009  {
1010  return c1->getDefLine()-c2->getDefLine();
1011  }
1012 }
1013 
1014 
static QCString name
Definition: declinfo.cpp:673
int m_numDocMembers
Definition: memberlist.h:94
void endMemberGroupDocs()
Definition: outputlist.h:232
void startMemberItem(const char *anchor, int i1, const char *id=0)
Definition: outputlist.h:218
void writeRuler()
Definition: outputlist.h:240
void endMemberDeclaration(const char *anchor, const char *inheritId)
Definition: outputlist.h:314
bool anonymousDeclShown() const
Definition: memberdef.cpp:4547
bool m_inGroup
Definition: memberlist.h:96
int typedefCount() const
void findSectionsInDocumentation()
Definition: memberdef.cpp:3918
void startMemberDocList()
Definition: outputlist.h:202
void append(const MemberDef *md)
Definition: memberlist.cpp:246
QCString header() const
Definition: membergroup.h:47
void writeDocumentation(MemberList *ml, OutputList &ol, const char *scopeName, Definition *container, bool inGroup, bool showEnumValues=FALSE, bool showInline=FALSE)
Definition: memberdef.cpp:2526
bool isDetailedSectionVisible(bool inGroup, bool inFile) const
Definition: memberdef.cpp:1920
void endFile(OutputList &ol, bool skipNavIndex, bool skipEndContents, const QCString &navPath)
Definition: index.cpp:263
void endMemberItem()
Definition: outputlist.h:220
void endFileWithNavPath(Definition *d, OutputList &ol)
Definition: index.cpp:282
void endGroupHeader(int extraLevels=0)
Definition: outputlist.h:178
QCString stripWhiteSpace() const
Definition: qcstring.cpp:295
void startMemberDocSimple()
Definition: outputlist.h:450
bool m_needsSorting
Definition: memberlist.h:99
void setFromAnonymousScope(bool b)
Definition: memberdef.cpp:4750
bool m_inFile
Definition: memberlist.h:97
void writeTagFile(FTextStream &)
Definition: memberdef.cpp:3580
bool isEmpty() const
Definition: qcstring.h:189
bool hasDocumentation() const
Definition: memberdef.cpp:3274
void startFile(OutputList &ol, const char *name, const char *manName, const char *title, HighlightedItem hli, bool additionalIndices, const char *altSidebarName)
Definition: index.cpp:244
void endInlineHeader()
Definition: outputlist.h:212
MemberListIterator(const QList< MemberDef > &list)
Definition: memberlist.cpp:251
int countDecMembers(GroupDef *gd=0)
#define NULL_LIST
Definition: marshal.h:41
uint length() const
Definition: qcstring.h:195
void append(const type *d)
Definition: qlist.h:73
int enumValueCount() const
int m_typeCnt
Definition: memberlist.h:89
void writePlainDeclarations(OutputList &ol, ClassDef *cd, NamespaceDef *nd, FileDef *fd, GroupDef *gd, ClassDef *inheritedFrom, const char *inheritId)
void writeTagFile(FTextStream &)
void writeString(const char *text)
Definition: outputlist.h:119
int m_funcCnt
Definition: memberlist.h:86
bool generateDoc(const char *fileName, int startLine, Definition *ctx, MemberDef *md, const QCString &docStr, bool indexWords, bool isExample, const char *exampleName=0, bool singleLine=FALSE, bool linkFromIndex=FALSE)
Definition: outputlist.cpp:131
void disableAllBut(OutputGenerator::OutputType o)
Definition: outputlist.cpp:49
void addGroupedInheritedMembers(OutputList &ol, MemberListType lt, ClassDef *inheritedFrom, const QCString &inheritId)
Definition: classdef.cpp:4339
void writeNavigationPath(OutputList &ol) const
void writeDocumentation(OutputList &ol, const char *scopeName, Definition *container, const char *title, bool showEnumValues=FALSE, bool showInline=FALSE)
Definition: memberlist.cpp:655
bool fromAnonymousScope() const
Definition: memberdef.cpp:4542
const bool FALSE
Definition: qglobal.h:370
Abstract interface for file based memory storage operations.
Definition: store.h:27
int countDocMembers()
MemberList * enumFieldList() const
Definition: memberdef.cpp:4497
void addListReference(Definition *d)
Definition: memberdef.cpp:3481
int m_numDecMembers
Definition: memberlist.h:93
int compareValues(const MemberDef *item1, const MemberDef *item2) const
Definition: memberlist.cpp:77
void startMemberDescription(const char *anchor, const char *inheritId=0)
Definition: outputlist.h:308
int compareValues(const MemberDef *item1, const MemberDef *item2) const
static QCString stripPath(const QCString &s)
Definition: tagreader.cpp:1287
int unmarshalInt(StorageIntf *s)
Definition: marshal.cpp:418
int countMembersIncludingGrouped(MemberListType lt, ClassDef *inheritedFrom, bool additional)
Definition: classdef.cpp:4213
DocRoot * validatingParseDoc(const char *fileName, int startLine, Definition *ctx, MemberDef *md, const char *input, bool indexWords, bool isExample, const char *exampleName, bool singleLine, bool linkFromIndex)
Definition: docparser.cpp:7179
int briefLine() const
void writeTagFile(FTextStream &)
Definition: memberlist.cpp:963
void endMemberGroup(bool last)
Definition: outputlist.h:236
Simplified and optimized version of QTextStream.
Definition: ftextstream.h:11
void marshalInt(StorageIntf *s, int v)
Definition: marshal.cpp:16
int numDocMembers() const
QCString displayName(bool includeScope=TRUE) const
Definition: classdef.cpp:312
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:41
void startMemberList()
Definition: outputlist.h:206
int enumCount() const
static constexpr double mg
Definition: Units.h:145
static QStrList * l
Definition: config.cpp:1044
QCString getReference() const
Definition: classdef.cpp:3814
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:95
void startTextLink(const char *file, const char *anchor)
Definition: outputlist.h:159
bool parseText(const QCString &textStr)
Definition: outputlist.cpp:175
int defineCount() const
void addMemberGroup(MemberGroup *mg)
Definition: memberlist.cpp:774
bool declVisible() const
Definition: memberlist.cpp:256
bool insert(uint i, const type *d)
Definition: qlist.h:70
void warnIfUndocumented()
Definition: memberdef.cpp:3210
int numDecMembers() const
bool isBriefSectionVisible() const
Definition: memberdef.cpp:1289
void marshalBool(StorageIntf *s, bool b)
Definition: marshal.cpp:42
int m_friendCnt
Definition: memberlist.h:92
void writeDocumentation(OutputList &ol, const char *scopeName, Definition *container, bool showEnumValues, bool showInline)
void countDocMembers(bool countEnumValues=FALSE)
Definition: memberlist.cpp:208
void startMemberGroup()
Definition: outputlist.h:234
void popGeneratorState()
Definition: outputlist.cpp:121
void endMemberHeader()
Definition: outputlist.h:196
virtual DefType definitionType() const =0
const char * typeString() const
Definition: memberdef.cpp:4035
uint count() const
Definition: qlist.h:66
void marshal(StorageIntf *s)
Definition: memberlist.cpp:837
const QCString & name() const
Definition: definition.h:114
bool isDetailedSectionLinkable() const
Definition: memberdef.cpp:1852
int getDefLine() const
Definition: definition.h:188
int qstricmp(const char *str1, const char *str2)
Definition: qcstring.cpp:567
void inSort(const type *d)
Definition: qlist.h:71
uint count() const
Definition: qlist.h:131
void findSectionsInDocumentation()
Definition: memberlist.cpp:818
bool unmarshalBool(StorageIntf *s)
Definition: marshal.cpp:443
MemberGroupList * memberGroupList
Definition: memberlist.h:95
void pushGeneratorState()
Definition: outputlist.cpp:111
void startMemberDeclaration()
Definition: outputlist.h:312
int m_defCnt
Definition: memberlist.h:91
int protoCount() const
QCString briefDescription(bool abbr=FALSE) const
Definition: memberdef.cpp:5073
QCString right(uint len) const
Definition: qcstring.cpp:231
static void writeVhdlDeclarations(MemberList *, OutputList &, GroupDef *, ClassDef *, FileDef *, NamespaceDef *)
void inSort(const MemberDef *md)
Definition: memberlist.cpp:241
SrcLangExt getLanguage() const
QCString docFile() const
Definition: membergroup.h:92
QCString anchor() const
Definition: classdef.cpp:4606
bool isConstructor() const
Definition: memberdef.cpp:3702
void disable(OutputGenerator::OutputType o)
Definition: outputlist.cpp:79
void setNeedsSorting(bool b)
Definition: memberlist.cpp:902
A bunch of utility functions.
void writeInheritedSectionTitle(const char *id, const char *ref, const char *file, const char *anchor, const char *title, const char *name)
Definition: outputlist.h:316
const char * data() const
Definition: qcstring.h:207
QCString anchor() const
Definition: memberdef.cpp:1031
type * current() const
Definition: qlist.h:146
void startMemberGroupDocs()
Definition: outputlist.h:230
int funcCount() const
bool isStrong() const
Definition: memberdef.cpp:4345
void writeDoc(DocRoot *root, Definition *ctx, MemberDef *md)
Definition: outputlist.cpp:162
#define Config_getBool(val)
Definition: config.cpp:664
ClassDef * getClassDef() const
Definition: memberdef.cpp:4070
uint unmarshalUInt(StorageIntf *s)
Definition: marshal.cpp:427
QCString briefFile() const
void startMemberSubtitle()
Definition: outputlist.h:198
void writeSimpleDocumentation(OutputList &ol, Definition *container)
Definition: memberlist.cpp:697
void setAnonymousEnumType(MemberDef *md)
Definition: memberdef.cpp:4730
void writeMemberDocSimple(OutputList &ol, Definition *container)
Definition: memberdef.cpp:3096
void err(const char *fmt,...)
Definition: message.cpp:226
virtual void writeQuickMemberLinks(OutputList &, MemberDef *) const
Definition: definition.h:338
void startDoxyAnchor(const char *fName, const char *manName, const char *anchor, const char *name, const char *args)
Definition: outputlist.h:266
MemberType memberType() const
Definition: memberdef.cpp:4125
virtual QCString trMore()=0
void endMemberDocList()
Definition: outputlist.h:204
int m_enumCnt
Definition: memberlist.h:87
void startGroupHeader(int extraLevels=0)
Definition: outputlist.h:176
void endQuickIndices()
Definition: outputlist.h:352
void writeDocumentationPage(OutputList &ol, const char *scopeName, Definition *container)
Definition: memberlist.cpp:715
void endContents()
Definition: outputlist.h:366
QCString getOutputFileBase() const
Definition: classdef.cpp:3533
int countInheritableMembers(ClassDef *inheritedFrom) const
Definition: memberlist.cpp:92
void writeEnumDeclaration(OutputList &typeDecl, ClassDef *cd, NamespaceDef *nd, FileDef *fd, GroupDef *gd)
Definition: memberdef.cpp:3754
GroupDef * getGroupDef() const
Definition: memberdef.cpp:4095
void unmarshal(StorageIntf *s)
Definition: memberlist.cpp:869
void marshalUInt(StorageIntf *s, uint v)
Definition: marshal.cpp:26
QCString qualifiedName() const
Definition: memberdef.cpp:3968
void countDecMembers(bool countEnumValues=FALSE, GroupDef *gd=0)
Definition: memberlist.cpp:136
void endDoxyAnchor(const char *fn, const char *anchor)
Definition: outputlist.h:270
static void writeTagFile(MemberDef *mdef, FTextStream &tagFile)
const QCString & initializer() const
Definition: memberdef.cpp:4055
void startInlineHeader()
Definition: outputlist.h:210
void enableAll()
Definition: outputlist.cpp:59
void writeDocumentationPage(OutputList &ol, const char *scopeName, Definition *container)
QCString getOutputFileBase() const
Definition: memberdef.cpp:941
int countInheritableMembers(ClassDef *inheritedFrom) const
void endMemberDescription()
Definition: outputlist.h:310
static bool * b
Definition: config.cpp:1043
Translator * theTranslator
Definition: language.cpp:157
const QCString & documentation() const
Definition: membergroup.h:66
static QCString listTypeAsString(MemberListType type)
Definition: memberlist.cpp:907
MemberListType
Definition: types.h:104
bool isReimplementedBy(ClassDef *cd) const
Definition: memberdef.cpp:888
void writeDeclarations(OutputList &ol, ClassDef *cd, NamespaceDef *nd, FileDef *fd, GroupDef *gd, const char *title, const char *subtitle, bool showEnumValues=FALSE, bool showInline=FALSE, ClassDef *inheritedFrom=0, MemberListType lt=MemberListType_pubMethods)
Definition: memberlist.cpp:519
bool isEmpty() const
Definition: docparser.h:1409
int docLine() const
Definition: membergroup.h:93
void endMemberDocSimple()
Definition: outputlist.h:452
bool isRelated() const
Definition: memberdef.cpp:4195
const char * argsString() const
Definition: memberdef.cpp:4040
void startMemberHeader(const char *anchor)
Definition: outputlist.h:194
void endMemberSubtitle()
Definition: outputlist.h:200
void docify(const char *s)
Definition: outputlist.h:145
void insertMemberAlign(bool templ=FALSE)
Definition: outputlist.h:238
void findSectionsInDocumentation()
void marshal(StorageIntf *s)
unsigned uint
Definition: qglobal.h:351
void endTextLink()
Definition: outputlist.h:161
int m_enumValCnt
Definition: memberlist.h:88
void addListReferences(Definition *def)
Definition: memberlist.cpp:784
static QCString * s
Definition: config.cpp:1042
void endMemberGroupHeader()
Definition: outputlist.h:228
MemberListType m_listType
Definition: memberlist.h:98
const bool TRUE
Definition: qglobal.h:371
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition: util.cpp:5088
void endMemberList()
Definition: outputlist.h:208
int varCount() const
bool insert(uint index, const MemberDef *md)
Definition: memberlist.cpp:236
void unmarshal(StorageIntf *s)
void writeDeclaration(OutputList &ol, ClassDef *cd, NamespaceDef *nd, FileDef *fd, GroupDef *gd, bool inGroup, ClassDef *inheritFrom=0, const char *inheritId=0)
Definition: memberdef.cpp:1411
void writePlainDeclarations(OutputList &ol, ClassDef *cd, NamespaceDef *nd, FileDef *fd, GroupDef *gd, ClassDef *inheritedFrom, const char *inheritId)
Definition: memberlist.cpp:321
void startContents()
Definition: outputlist.h:364
bool isDestructor() const
Definition: memberdef.cpp:3743
void addListReferences(Definition *d)
void startMemberGroupHeader(bool b)
Definition: outputlist.h:226
int m_varCnt
Definition: memberlist.h:85
int friendCount() const
type * toFirst()
Definition: qlist.h:135
int m_protoCnt
Definition: memberlist.h:90