Doxygen
Loading...
Searching...
No Matches
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 "memberlist.h"
19#include "classdef.h"
20#include "message.h"
21#include "util.h"
22#include "language.h"
23#include "doxygen.h"
24#include "outputlist.h"
25#include "groupdef.h"
26#include "vhdldocgen.h"
27#include "namespacedef.h"
28#include "filedef.h"
29#include "membergroup.h"
30#include "config.h"
31#include "docparser.h"
32#include "moduledef.h"
33
35{
36 //printf("%p: MemberList::MemberList(%d)\n",this,lt);
37 m_numDecMembers=-1; // special value indicating that value needs to be computed
39 m_numDocMembers=-1; // special value indicating that value needs to be computed
42}
43
47
49{
50 bool sortConstructorsFirst = Config_getBool(SORT_MEMBERS_CTORS_1ST);
51 if (sortConstructorsFirst)
52 {
53 int ord1 = c1->isConstructor() ? 2 : (c1->isDestructor() ? 1 : 0);
54 int ord2 = c2->isConstructor() ? 2 : (c2->isDestructor() ? 1 : 0);
55 if (ord1 > ord2)
56 return -1;
57 else if (ord2 > ord1)
58 return 1;
59 }
60 // sort on name, first case in-sensitive
61 int cmp = qstricmp_sort(c1->name(),c2->name());
62 // then on qualified name
63 if (cmp==0)
64 {
65 cmp = qstricmp_sort(c1->qualifiedName(),c2->qualifiedName());
66 }
67 // then on argument list
68 if (cmp==0 && !c1->argsString().isEmpty() && !c2->argsString().isEmpty())
69 {
70 cmp = qstricmp_sort(c1->argsString(),c2->argsString());
71 }
72 // then on file in which the item is defined
73 if (cmp==0)
74 {
76 }
77 // then on line number at which the member is defined
78 if (cmp==0)
79 {
80 cmp = c1->getDefLine()-c2->getDefLine();
81 }
82 return cmp;
83}
84
85int MemberList::countInheritableMembers(const ClassDef *inheritedFrom) const
86{
87 int count=0;
88 for (const auto &md : m_members)
89 {
90 if (md->isBriefSectionVisible())
91 {
92 if (md->memberType()!=MemberType::Friend &&
93 md->memberType()!=MemberType::EnumValue)
94 {
95 //printf("member %s: isReimplementedBy(%s)=%d\n",qPrint(md->name()),
96 // qPrint(inheritedFrom->name()),
97 // md->isReimplementedBy(inheritedFrom));
98 if (md->memberType()==MemberType::Function)
99 {
100 if (!md->isReimplementedBy(inheritedFrom)) count++;
101 }
102 else
103 {
104 count++;
105 }
106 }
107 }
108 }
109 for (const auto &mg : m_memberGroupRefList)
110 {
111 count+=mg->countInheritableMembers(inheritedFrom);
112 }
113 //printf("%s::countInheritableMembers(%s)=%d\n",
114 // qPrint(m_listType.toLabel()),
115 // qPrint(inheritedFrom->name()),count);
116 return count;
117}
118
119/*! Count the number of members in this list that are visible in
120 * the declaration part of a compound's documentation page.
121 */
122std::pair<int,int> MemberList::countDecMembers(const ClassDef *inheritedFrom) const
123{
124 //printf("----- countDecMembers count=%d ----\n",count());
125 int numDecMembers=0;
126 int numDecEnumValues=0;
127 for (const auto &md : m_members)
128 {
129 //printf("MemberList::countDecMembers(md=%s,%d)\n",qPrint(md->name()),md->isBriefSectionVisible());
130 if ((inheritedFrom==nullptr || !md->isReimplementedBy(inheritedFrom)) &&
131 md->isBriefSectionVisible())
132 {
133 switch(md->memberType())
134 {
135 case MemberType::Variable: // fall through
136 case MemberType::Event: // fall through
138 break;
139// apparently necessary to get this to show up in declarations section?
140 case MemberType::Interface: // fall through
141 case MemberType::Service: // fall through
142 case MemberType::Function: // fall through
143 case MemberType::Signal: // fall through
144 case MemberType::DCOP: // fall through
145 case MemberType::Slot: if (!md->isRelated() || md->getClassDef())
147 break;
150 break;
153 break;
155 break;
157 break;
159 break;
160 case MemberType::Define: if (Config_getBool(EXTRACT_ALL) ||
161 !md->argsString().isEmpty() ||
162 !md->initializer().isEmpty() ||
163 md->hasDocumentation()
164 ) numDecMembers++;
165 break;
167 break;
168 default:
169 err("Unknown member type found for member '{}'!\n",md->name());
170 }
171 }
172 }
173 for (const auto &mg : m_memberGroupRefList)
174 {
175 mg->countDecMembers();
176 numDecMembers+=mg->numDecMembers();
177 numDecEnumValues+=mg->numDecEnumValues();
178 }
179 //printf("----- end countDecMembers ----\n");
180
181 return std::make_pair(numDecMembers,numDecEnumValues);
182}
183
185{
186 if (m_numDecMembers!=-1) return; // already cached
187 std::tie(m_numDecMembers, m_numDecEnumValues) = countDecMembers(nullptr); // cache new values
188}
189
191{
192 if (m_numDocMembers!=-1) return; // used cached value
194 for (const auto &md : m_members)
195 {
196 if (md->isDetailedSectionVisible(m_container) && !md->isAlias())
197 {
198 // do not count enum values, since they do not produce entries of their own
199 if (md->memberType()==MemberType::EnumValue)
200 {
202 }
204 }
205 }
206 for (const auto &mg : m_memberGroupRefList)
207 {
208 mg->countDocMembers();
209 m_numDocMembers+=mg->numDocMembers();
210 m_numDocEnumValues+=mg->numDocEnumValues();
211 }
212 //printf("MemberList::countDocMembers()=%d memberGroupList=%p\n",m_numDocMembers,memberGroupList);
213}
214
216{
217 //printf("MemberList(%p)::setAnonymousEnumType()\n",this);
218 for (const auto &md : m_members)
219 {
220 if (md->isBriefSectionVisible())
221 {
222 QCString name(md->name());
223 int i=name.findRev("::");
224 if (i!=-1) name=name.right(name.length()-i-2);
225 if (md->memberType()==MemberType::Enumeration && name[0]=='@')
226 {
227 for (const auto &vmd : md->enumFieldList())
228 {
230 if (vmdm)
231 {
232 QCString vtype=vmd->typeString();
233 if ((vtype.find(name))!=-1)
234 {
235 vmdm->setAnonymousEnumType(md);
236 }
237 }
238 }
239 }
240 }
241 }
242 for (const auto &mg : m_memberGroupRefList)
243 {
244 mg->setAnonymousEnumType();
245 }
246}
247
249{
250 int numEnumValues=0;
251 QCString name(md->name());
252 int i=name.findRev("::");
253 if (i!=-1) name=name.right(name.length()-i-2);
254 if (name[0]=='@')
255 {
256 for (const auto &vmd : m_members)
257 {
258 QCString vtype=vmd->typeString();
259 if ((vtype.find(name))!=-1)
260 {
261 numEnumValues++;
262 }
263 }
264 }
265 return numEnumValues;
266}
267
269{
270 for (const auto &md : m_members)
271 {
272 if (md->isBriefSectionVisible())
273 {
274 switch (md->memberType())
275 {
276 case MemberType::Define: // fall through
277 case MemberType::Typedef: // fall through
278 case MemberType::Variable: // fall through
279 case MemberType::Function: // fall through
280 case MemberType::Signal: // fall through
281 case MemberType::Slot: // fall through
282 case MemberType::DCOP: // fall through
283 case MemberType::Property: // fall through
284 case MemberType::Interface: // fall through
285 case MemberType::Service: // fall through
286 case MemberType::Sequence: // fall through
287 case MemberType::Dictionary: // fall through
289 return TRUE;
291 {
292 // if this is an anonymous enum and there are variables of this
293 // enum type (i.e. enumVars>0), then we do not show the enum here.
294 if (countEnumValues(md)==0) // show enum here
295 {
296 return TRUE;
297 }
298 }
299 break;
301 return TRUE;
303 {
305 {
306 return TRUE;
307 }
308 }
309 break;
310 }
311 }
312 }
313 return FALSE;
314}
315
317 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd, const GroupDef *gd,const ModuleDef *mod,
318 int indentLevel, const ClassDef *inheritedFrom,const QCString &inheritId
319 ) const
320{
321 //printf("----- writePlainDeclaration() ----\n");
322 if (numDecMembers()==-1)
323 {
324 err("MemberList::numDecMembers()==-1, so the members of this list have not been counted. Please report as a bug.\n");
325 abort();
326 }
328 {
329 //printf(" --> no members!\n");
330 return; // no members in this list
331 }
332 //printf(" --> writePlainDeclaration() numDecMembers()=%d\n",
333 // numDecMembers());
334
336
337 bool first=TRUE;
338 for (const auto &md : m_members)
339 {
340 //printf(">>> Member '%s' type=%d visible=%d inheritedFrom=%p inheritId=%s\n",
341 // qPrint(md->name()),md->memberType(),md->isBriefSectionVisible(),(void*)inheritedFrom,qPrint(inheritId));
342 if ((inheritedFrom==nullptr || !md->isReimplementedBy(inheritedFrom)) &&
343 md->isBriefSectionVisible())
344 {
345 //printf(">>> rendering\n");
346 switch(md->memberType())
347 {
348 case MemberType::Define: // fall through
349 //case MemberType::Prototype: // fall through
350 case MemberType::Typedef: // fall through
351 case MemberType::Variable: // fall through
352 case MemberType::Function: // fall through
353 case MemberType::Signal: // fall through
354 case MemberType::Slot: // fall through
355 case MemberType::DCOP: // fall through
356 case MemberType::Property: // fall through
357 case MemberType::Interface: // fall through
358 case MemberType::Service: // fall through
359 case MemberType::Sequence: // fall through
360 case MemberType::Dictionary: // fall through
362 {
363 if (first) ol.startMemberList(),first=FALSE;
364 md->writeDeclaration(ol,cd,nd,fd,gd,mod,inGroup,indentLevel,inheritedFrom,inheritId);
365 break;
366 }
368 {
369 // if this is an anonymous enum and there are variables of this
370 // enum type (i.e. enumVars>0), then we do not show the enum here.
371 if (countEnumValues(md)==0) // show enum here
372 {
373 //printf("Enum!!\n");
374 if (first)
375 {
376 ol.startMemberList();
377 first=FALSE;
378 }
381 bool detailsLinkable = md->hasDetailedDescription();
382 if (!detailsLinkable)
383 {
384 ol.startDoxyAnchor(md->getOutputFileBase(),QCString(),md->anchor(),md->name(),QCString());
385 ol.addLabel(md->getOutputFileBase(),md->anchor());
386 }
387 if (md->isSliceLocal())
388 {
389 ol.writeString("local ");
390 }
391 ol.writeString("enum ");
392 if (md->getLanguage()==SrcLangExt::Cpp && md->isStrong())
393 {
394 if (md->isEnumStruct())
395 {
396 ol.writeString("struct ");
397 }
398 else
399 {
400 ol.writeString("class ");
401 }
402 }
404 md->writeEnumDeclaration(ol,cd,nd,fd,gd,mod);
405 if (!detailsLinkable)
406 {
407 ol.endDoxyAnchor(md->getOutputFileBase(),md->anchor());
408 }
410 if (!md->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
411 {
412 auto parser { createDocParser() };
413 auto ast { validatingParseDoc(*parser.get(),
414 md->briefFile(),md->briefLine(),
415 cd,md,
416 md->briefDescription(),
417 TRUE,FALSE,
419 Config_getBool(MARKDOWN_SUPPORT)) };
420 if (!ast->isEmpty())
421 {
422 ol.startMemberDescription(md->anchor());
423 ol.writeDoc(ast.get(),cd,md);
424 if (md->hasDetailedDescription())
425 {
427 ol.docify(" ");
428 ol.startTextLink(md->getOutputFileBase(),
429 md->anchor());
430 ol.parseText(theTranslator->trMore());
431 ol.endTextLink();
432 ol.enableAll();
433 }
435 }
436 }
437 ol.endMemberDeclaration(md->anchor(),inheritId);
438 }
439 md->warnIfUndocumented();
440 break;
441 }
443 if (inheritedFrom==nullptr)
444 {
445 if (first)
446 {
447 ol.startMemberList();
448 first=FALSE;
449 }
450 md->writeDeclaration(ol,cd,nd,fd,gd,mod,inGroup,indentLevel,inheritedFrom,inheritId);
451 break;
452 }
454 {
455 if (inGroup)
456 {
457 //printf("EnumValue!\n");
458 if (first) ol.startMemberList(),first=FALSE;
459 md->writeDeclaration(ol,cd,nd,fd,gd,mod,true,indentLevel,inheritedFrom,inheritId);
460 }
461 }
462 break;
463 }
464 }
465 }
466
467 if (!first)
468 {
469 ol.endMemberList();
470 }
471
473 //printf("----- end writePlainDeclaration() ----\n");
474}
475
476/** Writes the list of members to the output.
477 * @param ol Output list to write to
478 * @param cd non-null if this list is part of class documentation.
479 * @param nd non-null if this list is part of namespace documentation.
480 * @param fd non-null if this list is part of file documentation.
481 * @param gd non-null if this list is part of group documentation.
482 * @param mod non-null if this list is part of module documentation.
483 * @param title Title to use for the member list.
484 * @param subtitle Sub title to use for the member list.
485 * @param showEnumValues Obsolete, always set to FALSE.
486 * @param showInline if set to TRUE if title is rendered differently
487 * @param inheritedFrom if not 0, the list is shown inside the
488 * given class as inherited members, parameter cd points to the
489 * class containing the members.
490 * @param lt Type of list that is inherited from.
491 * @param showSectionTitle do we show the "additional members" header or not?
492 * When combining public and protected inherited members under a single header only for the first list it should be shown
493 */
495 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
496 const QCString &title,const QCString &subtitle, bool showEnumValues,
497 bool showInline,const ClassDef *inheritedFrom,MemberListType lt,bool showSectionTitle) const
498{
499 (void)showEnumValues; // unused
500
501 //printf("----- writeDeclaration() this=%p ---- inheritedFrom=%p\n",this,inheritedFrom);
502 bool optimizeVhdl = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
503 QCString inheritId;
504
505 const Definition *ctx = cd;
506 if (ctx==nullptr && nd) ctx = nd;
507 if (ctx==nullptr && gd) ctx = gd;
508 if (ctx==nullptr && mod) ctx = mod;
509 if (ctx==nullptr && fd) ctx = fd;
510
511 //printf("%p: MemberList::writeDeclaration(title='%s',subtitle='%s')=%d inheritedFrom=%p\n",
512 // (void*)this,qPrint(title),qPrint(subtitle),numDecMembers(),(void*)inheritedFrom);
513
514 int num = numDecMembers(inheritedFrom);
515 int numEnumValues = numDecEnumValues();
516 if (inheritedFrom && num>0)
517 {
518 if (cd && !optimizeVhdl)
519 {
520 inheritId = substitute(lt.toLabel(),"-","_")+"_"+
522 if (showSectionTitle && !title.isEmpty())
523 {
524 ol.writeInheritedSectionTitle(inheritId,cd->getReference(),
525 cd->getOutputFileBase(),
526 cd->anchor(),title,cd->displayName());
527 }
528 }
529 }
530 else if (num>numEnumValues)
531 {
532 if (!title.isEmpty())
533 {
534 if (showInline)
535 {
537 }
538 else
539 {
540 ol.startMemberHeader(m_listType.toLabel());
541 }
542 ol.parseText(title);
543 if (showInline)
544 {
545 ol.endInlineHeader();
546 }
547 else
548 {
549 ol.endMemberHeader();
550 }
551 }
552 if (!subtitle.stripWhiteSpace().isEmpty())
553 {
555 ol.generateDoc("[generated]",-1,ctx,nullptr,subtitle,FALSE,FALSE,
556 QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
558 }
559 }
560 if (num>numEnumValues)
561 {
563 // TODO: Two things need to be worked out for proper VHDL output:
564 // 1. Signals and types under the group need to be
565 // formatted to associate them with the group somehow
566 // indentation, or at the very least, extra space after
567 // the group is done
568 // 2. This might need to be repeated below for memberGroupLists
569 if (optimizeVhdl) // use specific declarations function
570 {
571 VhdlDocGen::writeVhdlDeclarations(this,ol,nullptr,cd,nullptr,nullptr,nullptr);
572 }
573 else
574 {
575 writePlainDeclarations(ol,inGroup,cd,nd,fd,gd,mod,0,inheritedFrom,inheritId);
576 }
577
578 //printf("memberGroupList=%p\n",memberGroupList);
579 int groupId=0;
580 for (const auto &mg : m_memberGroupRefList)
581 {
582 bool hasHeader=!mg->header().isEmpty();
583 if (inheritId.isEmpty())
584 {
585 QCString groupAnchor = QCString(listType().toLabel())+"-"+QCString().setNum(groupId++);
586 //printf("mg->header=%s hasHeader=%d\n",qPrint(mg->header()),hasHeader);
587 ol.startMemberGroupHeader(groupAnchor,hasHeader);
588 if (hasHeader)
589 {
590 ol.parseText(mg->header());
591 }
593 if (!mg->documentation().isEmpty())
594 {
595 //printf("Member group has docs!\n");
597 ol.generateDoc(mg->docFile(),mg->docLine(),mg->memberContainer(),nullptr,mg->documentation()+"\n",FALSE,FALSE,
598 QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
600 }
601 ol.startMemberGroup();
602 }
603 //printf("--- mg->writePlainDeclarations ---\n");
604 mg->writePlainDeclarations(ol,inGroup,cd,nd,fd,gd,mod,0,inheritedFrom,inheritId);
605 if (inheritId.isEmpty())
606 {
607 ol.endMemberGroup(hasHeader);
608 }
609 }
610 }
611 if (inheritedFrom && cd)
612 {
613 // also add members that of this list type, that are grouped together
614 // in a separate list in class 'inheritedFrom'
615 cd->addGroupedInheritedMembers(ol,m_listType,inheritedFrom,inheritId);
616 }
617 //printf("----- end writeDeclaration() ----\n");
618}
619
621 const QCString &scopeName, const Definition *container,
622 const QCString &title,const QCString &anchor,
623 bool showEnumValues,bool showInline) const
624{
625 if (numDocMembers()==-1)
626 {
627 err("MemberList::numDocMembers()==-1, so the members of this list have not been counted. Please report as a bug.\n");
628 abort();
629 }
630
631 if (numDocMembers()==0) return;
632 if (!showEnumValues && numDocMembers()<=numDocEnumValues()) return;
633
634 if (!title.isEmpty())
635 {
638 ol.writeRuler();
640 if (container) ol.writeAnchor(container->getOutputFileBase(),anchor);
641 ol.startGroupHeader(anchor,showInline ? 2 : 0);
642 ol.parseText(title);
643 ol.endGroupHeader(showInline ? 2 : 0);
644 }
646
647 struct OverloadInfo
648 {
649 uint32_t count = 1;
650 uint32_t total = 0;
651 };
652 std::unordered_map<std::string,OverloadInfo> overloadInfo;
653 // count the number of overloaded members
654 for (const auto &md : m_members)
655 {
656 if (md->isDetailedSectionVisible(m_container) &&
657 !(md->isEnumValue() && !showInline))
658 {
659 auto it = overloadInfo.emplace(md->name().str(),OverloadInfo()).first;
660 it->second.total++;
661 }
662 }
663
664 for (const auto &md : m_members)
665 {
666 if (md->isDetailedSectionVisible(m_container) &&
667 !(md->isEnumValue() && !showInline))
668 {
669 auto it = overloadInfo.find(md->name().str());
670 uint32_t overloadCount = it->second.total;
671 uint32_t &count = it->second.count;
673 if (mdm)
674 {
675 mdm->writeDocumentation(this,count++,overloadCount,ol,scopeName,container,
676 m_container==MemberListContainer::Group,showEnumValues,showInline);
677 }
678 }
679 }
680 //printf("MemberList::writeDocumentation() -- member groups %d\n",memberGroupList->count());
681 for (const auto &mg : m_memberGroupRefList)
682 {
683 mg->writeDocumentation(ol,scopeName,container,showEnumValues,showInline);
684 }
685 ol.endMemberDocList();
686}
687
688// members in a table
690 const Definition *container) const
691{
692 //printf("MemberList count=%d enumValues=%d\n",numDocMembers(),numDocEnumValues());
693 if (numDocMembers()<=numDocEnumValues()) return; // only enum values and they should be excluded
694
695 const ClassDef *cd = nullptr;
696 if (container && container->definitionType()==Definition::TypeClass)
697 {
698 cd = toClassDef(container);
699 }
700 ol.startMemberDocSimple(cd && cd->isJavaEnum());
701 for (const auto &md : m_members)
702 {
704 if (mdm)
705 {
707 }
708 }
709 ol.endMemberDocSimple(cd && cd->isJavaEnum());
710}
711
712// separate member pages
714 const QCString &scopeName, const DefinitionMutable *container, int hierarchyLevel) const
715{
716 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
717
718 struct OverloadInfo
719 {
720 uint32_t count = 1;
721 uint32_t total = 0;
722 };
723 std::unordered_map<std::string,OverloadInfo> overloadInfo;
724
725 // count the number of overloaded members
726 for (const auto &imd : m_members)
727 {
729
730 if (md && md->hasDetailedDescription())
731 {
732 auto it = overloadInfo.emplace(md->name().str(),OverloadInfo()).first;
733 it->second.total++;
734 }
735 }
736
737 for (const auto &imd : m_members)
738 {
739 Definition *container_d = toDefinition(const_cast<DefinitionMutable*>(container));
741 if (md && md->hasDetailedDescription())
742 {
743 auto it = overloadInfo.find(md->name().str());
744 uint32_t overloadCount = it->second.total;
745 uint32_t &count = it->second.count;
746 QCString diskName=md->getOutputFileBase();
747 QCString title=md->qualifiedName();
748 startFile(ol,diskName,md->name(),title,HighlightedItem::None,!generateTreeView,diskName, hierarchyLevel);
749 if (!generateTreeView)
750 {
751 container->writeNavigationPath(ol);
752 ol.endQuickIndices();
753 }
754 ol.startContents();
755
756 if (generateTreeView)
757 {
758 md->writeDocumentation(this,count++,overloadCount,ol,scopeName,container_d,m_container==MemberListContainer::Group);
759
760 ol.endContents();
762 }
763 else
764 {
765 ol.writeString("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n"
766 " <tr>\n"
767 " <td valign=\"top\">\n");
768
769 container->writeQuickMemberLinks(ol,md);
770
771 ol.writeString(" </td>\n");
772 ol.writeString(" <td valign=\"top\" class=\"mempage\">\n");
773
774 md->writeDocumentation(this,count++,overloadCount,ol,scopeName,container_d,m_container==MemberListContainer::Group);
775
776 ol.writeString(" </td>\n");
777 ol.writeString(" </tr>\n");
778 ol.writeString("</table>\n");
779
780 endFile(ol);
781 }
782 }
783 }
784 for (const auto &mg : m_memberGroupRefList)
785 {
786 mg->writeDocumentationPage(ol,scopeName,container);
787 }
788}
789
791{
792 m_memberGroupRefList.push_back(mg);
793}
794
796{
797 for (const auto &imd : m_members)
798 {
800 if (md && !md->isAlias() && (md->getGroupDef()==nullptr || def->definitionType()==Definition::TypeGroup))
801 {
802 md->addListReference(def);
803 const MemberVector &enumFields = md->enumFieldList();
804 if (md->memberType()==MemberType::Enumeration && !enumFields.empty())
805 {
806 //printf(" Adding enum values!\n");
807 for (const auto &vmd : enumFields)
808 {
810 if (vmdm)
811 {
812 //printf(" adding %s\n",qPrint(vmd->name()));
813 vmdm->addListReference(def);
814 }
815 }
816 }
817 }
818 }
819 for (const auto &mg : m_memberGroupRefList)
820 {
821 mg->addListReferences(def);
822 }
823}
824
826{
827 for (const auto &imd : m_members)
828 {
830 if (md)
831 {
833 }
834 }
835 for (const auto &mg : m_memberGroupRefList)
836 {
837 mg->findSectionsInDocumentation(d);
838 }
839}
840
842{
843 m_needsSorting = b;
844}
845
846void MemberList::writeTagFile(TextStream &tagFile,bool useQualifiedName,bool showNamespaceMembers)
847{
848 for (const auto &imd : m_members)
849 {
851 if (md)
852 {
853 if (md->getLanguage()!=SrcLangExt::VHDL)
854 {
855 md->writeTagFile(tagFile,useQualifiedName,showNamespaceMembers);
856 if (md->memberType()==MemberType::Enumeration && !md->isStrong())
857 {
858 for (const auto &ivmd : md->enumFieldList())
859 {
861 if (vmd)
862 {
863 vmd->writeTagFile(tagFile,useQualifiedName,showNamespaceMembers);
864 }
865 }
866 }
867 }
868 else
869 {
870 VhdlDocGen::writeTagFile(md,tagFile);
871 }
872 }
873 }
874 for (const auto &mg : m_memberGroupRefList)
875 {
876 mg->writeTagFile(tagFile,useQualifiedName);
877 }
878}
879
880// compute the HTML anchors for a list of members
882{
883 //int count=0;
884 for (const auto &md : m_members)
885 {
887 if (mdm && !md->isReference())
888 {
889 mdm->setAnchor();
890 }
891 }
892}
893
A abstract class representing of a compound symbol.
Definition classdef.h:104
virtual bool isJavaEnum() const =0
virtual void addGroupedInheritedMembers(OutputList &ol, MemberListType lt, const ClassDef *inheritedFrom, const QCString &inheritId) const =0
The common base class of all entity definitions found in the sources.
Definition definition.h:76
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
virtual QCString getDefFileName() const =0
virtual int getDefLine() const =0
virtual DefType definitionType() const =0
virtual QCString anchor() const =0
virtual QCString briefDescription(bool abbreviate=FALSE) const =0
virtual QCString getReference() const =0
virtual QCString qualifiedName() const =0
virtual QCString displayName(bool includeScope=TRUE) const =0
virtual bool isAlias() const =0
virtual QCString getOutputFileBase() const =0
virtual bool isReference() const =0
virtual const QCString & name() const =0
A model of a file symbol.
Definition filedef.h:99
A model of a group of symbols.
Definition groupdef.h:52
A model of a class/file/namespace member symbol.
Definition memberdef.h:48
virtual bool isDestructor() const =0
virtual bool hasDetailedDescription() const =0
virtual bool isConstructor() const =0
virtual GroupDef * getGroupDef()=0
virtual const MemberVector & enumFieldList() const =0
virtual MemberType memberType() const =0
virtual bool isStrong() const =0
virtual QCString argsString() const =0
virtual void writeMemberDocSimple(OutputList &ol, const Definition *container) const =0
virtual void writeDocumentation(const MemberList *ml, int memCount, int memTotal, OutputList &ol, const QCString &scopeName, const Definition *container, bool inGroup, bool showEnumValues=FALSE, bool showInline=FALSE) const =0
virtual void addListReference(Definition *d)=0
virtual void findSectionsInDocumentation()=0
virtual void setAnonymousEnumType(const MemberDef *md)=0
virtual void writeTagFile(TextStream &, bool useQualifiedName, bool showNamespaceMembers) const =0
virtual void setAnchor()=0
A class representing a group of members.
Definition membergroup.h:43
int numDecEnumValues() const
Definition memberlist.h:121
int m_numDecEnumValues
Definition memberlist.h:156
int numDocMembers() const
Definition memberlist.h:122
int numDocEnumValues() const
Definition memberlist.h:123
void writeDeclarations(OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod, const QCString &title, const QCString &subtitle, bool showEnumValues=FALSE, bool showInline=FALSE, const ClassDef *inheritedFrom=nullptr, MemberListType lt=MemberListType::PubMethods(), bool showSectionTitle=true) const
Writes the list of members to the output.
int countEnumValues(const MemberDef *md) const
void writeTagFile(TextStream &, bool useQualifiedName=false, bool showNamespaceMembers=true)
int m_numDocMembers
Definition memberlist.h:157
int m_numDecMembers
Definition memberlist.h:155
MemberListContainer container() const
Definition memberlist.h:115
void addListReferences(Definition *def)
MemberList(MemberListType lt, MemberListContainer container)
int numDecMembers() const
Definition memberlist.h:119
MemberGroupRefList m_memberGroupRefList
Definition memberlist.h:159
bool m_needsSorting
Definition memberlist.h:162
void writePlainDeclarations(OutputList &ol, bool inGroup, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod, int indentLevel, const ClassDef *inheritedFrom, const QCString &inheritId) const
void setAnonymousEnumType()
int countInheritableMembers(const ClassDef *inheritedFrom) const
int m_numDocEnumValues
Definition memberlist.h:158
MemberListContainer m_container
Definition memberlist.h:160
void setNeedsSorting(bool b)
void writeSimpleDocumentation(OutputList &ol, const Definition *container) const
MemberListType listType() const
Definition memberlist.h:114
void writeDocumentation(OutputList &ol, const QCString &scopeName, const Definition *container, const QCString &title, const QCString &anchor, bool showEnumValues=FALSE, bool showInline=FALSE) const
void countDecMembers() const
void countDocMembers()
MemberListType m_listType
Definition memberlist.h:161
void findSectionsInDocumentation(const Definition *d)
void addMemberGroup(MemberGroup *mg)
void setAnchors()
int numDecMembers(const ClassDef *inheritedFrom) const
Definition memberlist.h:117
void writeDocumentationPage(OutputList &ol, const QCString &scopeName, const DefinitionMutable *container, int hierarchyLevel=0) const
bool declVisible() const
Wrapper class for the MemberListType type.
Definition types.h:346
constexpr const char * toLabel() const
Definition types.h:402
A vector of MemberDef object.
Definition memberlist.h:35
bool empty() const noexcept
Definition memberlist.h:60
An abstract interface of a namespace symbol.
Class representing a list of output generators that are written to in parallel.
Definition outputlist.h:314
void writeString(const QCString &text)
Definition outputlist.h:412
void startMemberDeclaration()
Definition outputlist.h:570
void disable(OutputType o)
void writeRuler()
Definition outputlist.h:522
void startGroupHeader(const QCString &id=QCString(), int extraLevels=0)
Definition outputlist.h:454
void endContents()
Definition outputlist.h:621
void endMemberDescription()
Definition outputlist.h:568
void endInlineHeader()
Definition outputlist.h:488
void endMemberGroupDocs()
Definition outputlist.h:512
void writeDoc(const IDocNodeAST *ast, const Definition *ctx, const MemberDef *md)
Definition outputlist.h:384
void startMemberDescription(const QCString &anchor, const QCString &inheritId=QCString(), bool typ=false)
Definition outputlist.h:566
void endDoxyAnchor(const QCString &fn, const QCString &anchor)
Definition outputlist.h:542
void docify(const QCString &s)
Definition outputlist.h:438
void endMemberDocList()
Definition outputlist.h:480
void startMemberGroup()
Definition outputlist.h:514
void startMemberList()
Definition outputlist.h:482
void endTextLink()
Definition outputlist.h:445
void endMemberItem(OutputGenerator::MemberItemType type)
Definition outputlist.h:496
void endMemberList()
Definition outputlist.h:484
void generateDoc(const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &docStr, bool indexWords, bool isExample, const QCString &exampleName, bool singleLine, bool linkFromIndex, bool markdownSupport)
void addLabel(const QCString &fName, const QCString &anchor)
Definition outputlist.h:544
void pushGeneratorState()
void insertMemberAlign(bool templ=FALSE)
Definition outputlist.h:518
void startInlineHeader()
Definition outputlist.h:486
void disableAllBut(OutputType o)
void popGeneratorState()
void writeAnchor(const QCString &fileName, const QCString &name)
Definition outputlist.h:524
void endGroupHeader(int extraLevels=0)
Definition outputlist.h:456
void startDoxyAnchor(const QCString &fName, const QCString &manName, const QCString &anchor, const QCString &name, const QCString &args)
Definition outputlist.h:538
void endQuickIndices()
Definition outputlist.h:605
void endMemberGroupHeader()
Definition outputlist.h:508
void endMemberGroup(bool last)
Definition outputlist.h:516
void startMemberGroupDocs()
Definition outputlist.h:510
void startContents()
Definition outputlist.h:619
void startMemberDocSimple(bool b)
Definition outputlist.h:723
void endMemberDeclaration(const QCString &anchor, const QCString &inheritId)
Definition outputlist.h:572
void enableAll()
void endMemberHeader()
Definition outputlist.h:472
void endMemberSubtitle()
Definition outputlist.h:476
void startMemberItem(const QCString &anchor, OutputGenerator::MemberItemType type, const QCString &id=QCString())
Definition outputlist.h:494
void startMemberDocList()
Definition outputlist.h:478
void endMemberDocSimple(bool b)
Definition outputlist.h:725
void startMemberSubtitle()
Definition outputlist.h:474
void parseText(const QCString &textStr)
void writeInheritedSectionTitle(const QCString &id, const QCString &ref, const QCString &file, const QCString &anchor, const QCString &title, const QCString &name)
Definition outputlist.h:574
void startMemberGroupHeader(const QCString &id, bool b)
Definition outputlist.h:506
void startTextLink(const QCString &file, const QCString &anchor)
Definition outputlist.h:443
void startMemberHeader(const QCString &anchor, int typ=2)
Definition outputlist.h:470
This is an alternative implementation of QCString.
Definition qcstring.h:101
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:153
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition qcstring.h:245
const std::string & str() const
Definition qcstring.h:537
QCString & setNum(short n)
Definition qcstring.h:444
QCString right(size_t len) const
Definition qcstring.h:219
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition qcstring.cpp:91
Text streaming class that buffers data.
Definition textstream.h:36
static void writeTagFile(MemberDefMutable *mdef, TextStream &tagFile)
static void writeVhdlDeclarations(const MemberList *, OutputList &, const GroupDef *, const ClassDef *, const FileDef *, const NamespaceDef *, const ModuleDef *)
ClassDef * toClassDef(Definition *d)
#define Config_getBool(name)
Definition config.h:33
Definition * toDefinition(DefinitionMutable *dm)
IDocParserPtr createDocParser()
factory function to create a parser
Definition docparser.cpp:55
IDocNodeASTPtr validatingParseDoc(IDocParser &parserIntf, const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &input, bool indexWords, bool isExample, const QCString &exampleName, bool singleLine, bool linkFromIndex, bool markdownSupport)
void endFile(OutputList &ol, bool skipNavIndex, bool skipEndContents, const QCString &navPath)
Definition index.cpp:427
void startFile(OutputList &ol, const QCString &name, const QCString &manName, const QCString &title, HighlightedItem hli, bool additionalIndices, const QCString &altSidebarName, int hierarchyLevel, const QCString &allMembersFile)
Definition index.cpp:401
void endFileWithNavPath(OutputList &ol, const DefinitionMutable *d, bool showPageNavigation)
Definition index.cpp:448
Translator * theTranslator
Definition language.cpp:71
MemberDefMutable * toMemberDefMutable(Definition *d)
int genericCompareMembers(const MemberDef *c1, const MemberDef *c2)
#define err(fmt,...)
Definition message.h:127
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition qcstring.cpp:477
int qstricmp_sort(const char *str1, const char *str2)
Definition qcstring.h:86
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
@ Enumeration
Definition types.h:557
@ EnumValue
Definition types.h:558
@ Dictionary
Definition types.h:568
@ Interface
Definition types.h:565
@ Sequence
Definition types.h:567
@ Variable
Definition types.h:555
@ Property
Definition types.h:563
@ Typedef
Definition types.h:556
@ Function
Definition types.h:554
@ Service
Definition types.h:566
MemberListContainer
Definition types.h:472
QCString stripPath(const QCString &s)
Definition util.cpp:5464
A bunch of utility functions.