Doxygen
Loading...
Searching...
No Matches
memberlist.cpp
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Copyright (C) 1997-2026 by Dimitri van Heesch.
4 *
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation under the terms of the GNU General Public License is hereby
7 * granted. No representations are made about the suitability of this software
8 * for any purpose. It is provided "as is" without express or implied warranty.
9 * See the GNU General Public License for more details.
10 *
11 * Documents produced by Doxygen are derivative works derived from the
12 * input used in their production; they are not affected by this license.
13 *
14 */
15
16// own header
17#include "memberlist.h"
18
19// other includes
20#include "classdef.h"
21#include "config.h"
22#include "docparser.h"
23#include "doxygen.h"
24#include "filedef.h"
25#include "groupdef.h"
26#include "language.h"
27#include "md5hash.h"
28#include "membergroup.h"
29#include "message.h"
30#include "moduledef.h"
31#include "namespacedef.h"
32#include "outputlist.h"
33#include "util.h"
34#include "vhdldocgen.h"
35
37{
38 //printf("%p: MemberList::MemberList(%d)\n",this,lt);
39 m_numDecMembers=-1; // special value indicating that value needs to be computed
41 m_numDocMembers=-1; // special value indicating that value needs to be computed
43 m_needsSorting=false;
44}
45
49
51{
52 bool sortConstructorsFirst = Config_getBool(SORT_MEMBERS_CTORS_1ST);
53 if (sortConstructorsFirst)
54 {
55 int ord1 = c1->isConstructor() ? 2 : (c1->isDestructor() ? 1 : 0);
56 int ord2 = c2->isConstructor() ? 2 : (c2->isDestructor() ? 1 : 0);
57 if (ord1 > ord2)
58 return -1;
59 else if (ord2 > ord1)
60 return 1;
61 }
62 // sort on name, first case in-sensitive
63 int cmp = dstricmp_sort(c1->name(),c2->name());
64 // then on qualified name
65 if (cmp==0)
66 {
67 cmp = dstricmp_sort(c1->qualifiedName(),c2->qualifiedName());
68 }
69 // then on argument list
70 if (cmp==0 && !c1->argsString().empty() && !c2->argsString().empty())
71 {
72 cmp = dstricmp_sort(c1->argsString(),c2->argsString());
73 }
74 // then on file in which the item is defined
75 if (cmp==0)
76 {
78 }
79 // then on line number at which the member is defined
80 if (cmp==0)
81 {
82 cmp = c2->getDefLine()-c1->getDefLine();
83 }
84 return cmp;
85}
86
87int MemberList::countInheritableMembers(const ClassDef *inheritedFrom) const
88{
89 int count=0;
90 for (const auto &md : m_members)
91 {
92 if (md->isBriefSectionVisible())
93 {
94 if (md->memberType()!=MemberType::Friend &&
95 md->memberType()!=MemberType::EnumValue)
96 {
97 //printf("member %s: isReimplementedBy(%s)=%d\n",qPrint(md->name()),
98 // qPrint(inheritedFrom->name()),
99 // md->isReimplementedBy(inheritedFrom));
100 if (md->memberType()==MemberType::Function)
101 {
102 if (!md->isReimplementedBy(inheritedFrom)) count++;
103 }
104 else
105 {
106 count++;
107 }
108 }
109 }
110 }
111 for (const auto &mg : m_memberGroupRefList)
112 {
113 count+=mg->countInheritableMembers(inheritedFrom);
114 }
115 //printf("%s::countInheritableMembers(%s)=%d\n",
116 // qPrint(m_listType.toLabel()),
117 // qPrint(inheritedFrom->name()),count);
118 return count;
119}
120
121/*! Count the number of members in this list that are visible in
122 * the declaration part of a compound's documentation page.
123 */
124std::pair<int,int> MemberList::countDecMembers(const ClassDef *inheritedFrom) const
125{
126 //printf("----- countDecMembers count=%d ----\n",count());
127 int numDecMembers=0;
128 int numDecEnumValues=0;
129 for (const auto &md : m_members)
130 {
131 //printf("MemberList::countDecMembers(md=%s,%d)\n",qPrint(md->name()),md->isBriefSectionVisible());
132 if ((inheritedFrom==nullptr || !md->isReimplementedBy(inheritedFrom)) &&
133 md->isBriefSectionVisible())
134 {
135 switch(md->memberType())
136 {
137 case MemberType::Variable: // fall through
138 case MemberType::Event: // fall through
139 case MemberType::Property: numDecMembers++;
140 break;
141// apparently necessary to get this to show up in declarations section?
142 case MemberType::Interface: // fall through
143 case MemberType::Service: // fall through
144 case MemberType::Function: // fall through
145 case MemberType::Signal: // fall through
146 case MemberType::DCOP: // fall through
147 case MemberType::Slot: if (!md->isRelated() || md->getClassDef())
149 break;
150 case MemberType::Enumeration:
152 break;
153 case MemberType::EnumValue: numDecEnumValues++;
155 break;
156 case MemberType::Typedef: numDecMembers++;
157 break;
158 case MemberType::Sequence: numDecMembers++;
159 break;
160 case MemberType::Dictionary: numDecMembers++;
161 break;
162 case MemberType::Define: if (Config_getBool(EXTRACT_ALL) ||
163 !md->argsString().empty() ||
164 !md->initializer().empty() ||
165 md->hasDocumentation()
166 ) numDecMembers++;
167 break;
168 case MemberType::Friend: numDecMembers++;
169 break;
170 default:
171 err("Unknown member type found for member '{}'!\n",md->name());
172 }
173 }
174 }
175 for (const auto &mg : m_memberGroupRefList)
176 {
177 mg->countDecMembers();
178 numDecMembers+=mg->numDecMembers();
179 numDecEnumValues+=mg->numDecEnumValues();
180 }
181 //printf("----- end countDecMembers ----\n");
182
183 return std::make_pair(numDecMembers,numDecEnumValues);
184}
185
187{
188 if (m_numDecMembers!=-1) return; // already cached
189 std::tie(m_numDecMembers, m_numDecEnumValues) = countDecMembers(nullptr); // cache new values
190}
191
193{
194 if (m_numDocMembers!=-1) return; // used cached value
196 for (const auto &md : m_members)
197 {
198 if (md->isDetailedSectionVisible(m_container) && !md->isAlias())
199 {
200 // do not count enum values, since they do not produce entries of their own
201 if (md->memberType()==MemberType::EnumValue)
202 {
204 }
206 }
207 }
208 for (const auto &mg : m_memberGroupRefList)
209 {
210 mg->countDocMembers();
211 m_numDocMembers+=mg->numDocMembers();
212 m_numDocEnumValues+=mg->numDocEnumValues();
213 }
214 //printf("MemberList::countDocMembers()=%d memberGroupList=%p\n",m_numDocMembers,memberGroupList);
215}
216
218{
219 //printf("MemberList(%p)::setAnonymousEnumType()\n",this);
220 for (const auto &md : m_members)
221 {
222 if (md->isBriefSectionVisible())
223 {
224 DString name(md->name());
225 if (size_t i=name.rfind("::"); i!=DString::npos) name=name.mid(i+2);
226 if (md->memberType()==MemberType::Enumeration && name[0]=='@')
227 {
228 for (const auto &vmd : md->enumFieldList())
229 {
231 if (vmdm)
232 {
233 DString vtype=vmd->typeString();
234 if ((vtype.find(name))!=DString::npos)
235 {
236 vmdm->setAnonymousEnumType(md);
237 }
238 }
239 }
240 }
241 }
242 }
243 for (const auto &mg : m_memberGroupRefList)
244 {
245 mg->setAnonymousEnumType();
246 }
247}
248
250{
251 int numEnumValues=0;
252 DString name(md->name());
253 if (size_t i=name.rfind("::"); i!=DString::npos) name=name.mid(i+2);
254 if (name[0]=='@')
255 {
256 for (const auto &vmd : m_members)
257 {
258 DString vtype=vmd->typeString();
259 if ((vtype.find(name))!=DString::npos)
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
288 case MemberType::Event:
289 return true;
290 case MemberType::Enumeration:
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;
300 case MemberType::Friend:
301 return true;
302 case MemberType::EnumValue:
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 DString &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
361 case MemberType::Event:
362 {
363 if (first) ol.startMemberList(),first=false;
364 md->writeDeclaration(ol,cd,nd,fd,gd,mod,inGroup,indentLevel,inheritedFrom,inheritId);
365 break;
366 }
367 case MemberType::Enumeration:
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(),DString(),md->anchor(),md->name(),DString());
385 ol.addLabel(md->getOutputFileBase(),md->anchor());
386 }
387 if (md->isSliceLocal())
388 {
389 ol.writeString("local ");
390 }
391 DString enumType = "enum ";
392 if (md->getLanguage()==SrcLangExt::Cpp && md->isStrong())
393 {
394 if (md->isEnumStruct())
395 {
396 enumType+="struct ";
397 }
398 else
399 {
400 enumType+="class ";
401 }
402 }
403 if (md->name().startsWith("@"))
404 {
405 ol.writeObjectLink(md->getReference(),md->getOutputFileBase(),md->anchor(),enumType);
406 }
407 else
408 {
409 ol.writeString(enumType);
410 }
412 md->writeEnumDeclaration(ol,cd,nd,fd,gd,mod);
413 if (!detailsLinkable)
414 {
415 ol.endDoxyAnchor(md->getOutputFileBase(),md->anchor());
416 }
418 if (!md->briefDescription().empty() && Config_getBool(BRIEF_MEMBER_DESC))
419 {
420 auto parser { createDocParser() };
421 auto ast { validatingParseDoc(*parser.get(),
422 md->briefFile(),
423 md->briefLine(),
424 cd ? cd : md->getOuterScope(),
425 md,
426 md->briefDescription(),
427 DocOptions()
428 .setIndexWords(true)
429 .setSingleLine(true))
430 };
431 if (!ast->empty())
432 {
433 ol.startMemberDescription(md->anchor(),inheritId);
434 ol.writeDoc(ast.get(),cd,md);
435 if (md->hasDetailedDescription())
436 {
438 ol.docify(" ");
439 ol.startTextLink(md->getOutputFileBase(),
440 md->anchor());
442 ol.endTextLink();
443 ol.enableAll();
444 }
446 }
447 }
448 ol.endMemberDeclaration(md->anchor(),inheritId);
449 }
450 md->warnIfUndocumented();
451 break;
452 }
453 case MemberType::Friend:
454 if (inheritedFrom==nullptr)
455 {
456 if (first)
457 {
458 ol.startMemberList();
459 first=false;
460 }
461 md->writeDeclaration(ol,cd,nd,fd,gd,mod,inGroup,indentLevel,inheritedFrom,inheritId);
462 break;
463 }
464 case MemberType::EnumValue:
465 {
466 if (inGroup)
467 {
468 //printf("EnumValue!\n");
469 if (first) ol.startMemberList(),first=false;
470 md->writeDeclaration(ol,cd,nd,fd,gd,mod,true,indentLevel,inheritedFrom,inheritId);
471 }
472 }
473 break;
474 }
475 }
476 }
477
478 if (!first)
479 {
480 ol.endMemberList();
481 }
482
484 //printf("----- end writePlainDeclaration() ----\n");
485}
486
487/** Writes the list of members to the output.
488 * @param ol Output list to write to
489 * @param cd non-null if this list is part of class documentation.
490 * @param nd non-null if this list is part of namespace documentation.
491 * @param fd non-null if this list is part of file documentation.
492 * @param gd non-null if this list is part of group documentation.
493 * @param mod non-null if this list is part of module documentation.
494 * @param title Title to use for the member list.
495 * @param subtitle Sub title to use for the member list.
496 * @param showEnumValues Obsolete, always set to false.
497 * @param showInline if set to true if title is rendered differently
498 * @param inheritedFrom if not 0, the list is shown inside the
499 * given class as inherited members, parameter cd points to the
500 * class containing the members.
501 * @param lt Type of list that is inherited from.
502 * @param showSectionTitle do we show the "additional members" header or not?
503 * When combining public and protected inherited members under a single header only for the first list it should be shown
504 */
506 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
507 const DString &title,const DString &subtitle, bool /*showEnumValues*/,
508 bool showInline,const ClassDef *inheritedFrom,MemberListType lt,bool showSectionTitle) const
509{
510 //printf("----- writeDeclaration() this=%p ---- inheritedFrom=%p\n",this,inheritedFrom);
511 bool optimizeVhdl = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
512 DString inheritId;
513
514 const Definition *ctx = cd;
515 if (ctx==nullptr && nd) ctx = nd;
516 if (ctx==nullptr && gd) ctx = gd;
517 if (ctx==nullptr && mod) ctx = mod;
518 if (ctx==nullptr && fd) ctx = fd;
519
520 //printf("%p: MemberList::writeDeclaration(title='%s',subtitle='%s')=%d inheritedFrom=%p\n",
521 // (void*)this,qPrint(title),qPrint(subtitle),numDecMembers(),(void*)inheritedFrom);
522
523 int num = numDecMembers(inheritedFrom);
524 int numEnumValues = numDecEnumValues();
525 if (inheritedFrom && num>0)
526 {
527 if (cd && !optimizeVhdl)
528 {
529 inheritId = substitute(lt.toLabel(),"-","_")+"_"+
531 if (showSectionTitle && !title.empty())
532 {
533 ol.writeInheritedSectionTitle(inheritId,cd->getReference(),
534 cd->getOutputFileBase(),
535 cd->anchor(),title,cd->displayName());
536 }
537 }
538 }
539 else if (num>numEnumValues)
540 {
541 if (!title.empty())
542 {
543 if (showInline)
544 {
546 }
547 else
548 {
549 DString anchor = m_listType.toLabel();
550 if (m_listType.isMemberGroup()) anchor += "-" + md5str(title.view());
551 ol.startMemberHeader(anchor);
552 }
553 ol.parseText(title);
554 if (showInline)
555 {
556 ol.endInlineHeader();
557 }
558 else
559 {
560 ol.endMemberHeader();
561 }
562 }
563 if (!subtitle.stripWhiteSpace().empty())
564 {
566 ol.generateDoc("[generated]", -1, ctx, nullptr, subtitle, DocOptions());
568 }
569 }
570 if (num>numEnumValues)
571 {
573 // TODO: Two things need to be worked out for proper VHDL output:
574 // 1. Signals and types under the group need to be
575 // formatted to associate them with the group somehow
576 // indentation, or at the very least, extra space after
577 // the group is done
578 // 2. This might need to be repeated below for memberGroupLists
579 if (optimizeVhdl) // use specific declarations function
580 {
581 VhdlDocGen::writeVhdlDeclarations(this,ol,nullptr,cd,nullptr,nullptr,nullptr);
582 }
583 else
584 {
585 writePlainDeclarations(ol,inGroup,cd,nd,fd,gd,mod,0,inheritedFrom,inheritId);
586 }
587
588 //printf("memberGroupList=%p\n",memberGroupList);
589 int groupId=0;
590 for (const auto &mg : m_memberGroupRefList)
591 {
592 bool hasHeader=!mg->header().empty();
593 if (inheritId.empty())
594 {
595 DString groupAnchor = DString(listType().toLabel())+"-"+DString().setNum(groupId++);
596 //printf("mg->header=%s hasHeader=%d\n",qPrint(mg->header()),hasHeader);
597 ol.startMemberGroupHeader(groupAnchor,hasHeader);
598 if (hasHeader)
599 {
600 ol.parseText(mg->header());
601 }
602 ol.endMemberGroupHeader(hasHeader);
603 if (!mg->documentation().empty())
604 {
605 //printf("Member group has docs!\n");
607 ol.generateDoc(mg->docFile(),
608 mg->docLine(),
609 mg->memberContainer(),
610 nullptr,
611 mg->documentation()+"\n",
612 DocOptions());
614 }
615 ol.startMemberGroup();
616 }
617 //printf("--- mg->writePlainDeclarations ---\n");
618 mg->writePlainDeclarations(ol,inGroup,cd,nd,fd,gd,mod,0,inheritedFrom,inheritId);
619 if (inheritId.empty())
620 {
621 ol.endMemberGroup(hasHeader);
622 }
623 }
624 }
625 if (inheritedFrom && cd)
626 {
627 // also add members that of this list type, that are grouped together
628 // in a separate list in class 'inheritedFrom'
629 cd->addGroupedInheritedMembers(ol,m_listType,inheritedFrom,inheritId);
630 }
631 //printf("----- end writeDeclaration() ----\n");
632}
633
635 const DString &scopeName, const Definition *container,
636 const DString &title,const DString &anchor,
637 bool showEnumValues,bool showInline) const
638{
639 if (numDocMembers()==-1)
640 {
641 err("MemberList::numDocMembers()==-1, so the members of this list have not been counted. Please report as a bug.\n");
642 abort();
643 }
644
645 if (numDocMembers()==0) return;
646 if (!showEnumValues && numDocMembers()<=numDocEnumValues()) return;
647
648 if (!title.empty())
649 {
652 ol.writeRuler();
655 ol.startGroupHeader(anchor,showInline ? 2 : 0);
656 ol.parseText(title);
657 ol.endGroupHeader(showInline ? 2 : 0);
658 }
660
661 struct OverloadInfo
662 {
663 uint32_t count = 1;
664 uint32_t total = 0;
665 };
666 std::unordered_map<std::string,OverloadInfo> overloadInfo;
667 // count the number of overloaded members
668 for (const auto &md : m_members)
669 {
670 if (md->isDetailedSectionVisible(m_container) &&
671 !(md->isEnumValue() && !showInline))
672 {
673 auto it = overloadInfo.emplace(md->name().str(),OverloadInfo()).first;
674 it->second.total++;
675 }
676 }
677
678 for (const auto &md : m_members)
679 {
680 if (md->isDetailedSectionVisible(m_container) &&
681 !(md->isEnumValue() && !showInline))
682 {
683 auto it = overloadInfo.find(md->name().str());
684 uint32_t overloadCount = it->second.total;
685 uint32_t &count = it->second.count;
687 if (mdm)
688 {
689 mdm->writeDocumentation(this,count++,overloadCount,ol,scopeName,container,
690 m_container==MemberListContainer::Group,showEnumValues,showInline);
691 }
692 }
693 }
694 //printf("MemberList::writeDocumentation() -- member groups %d\n",memberGroupList->count());
695 for (const auto &mg : m_memberGroupRefList)
696 {
697 mg->writeDocumentation(ol,scopeName,container,showEnumValues,showInline);
698 }
699 ol.endMemberDocList();
700}
701
702// members in a table
704 const Definition *container) const
705{
706 //printf("MemberList count=%d enumValues=%d\n",numDocMembers(),numDocEnumValues());
707 if (numDocMembers()<=numDocEnumValues()) return; // only enum values and they should be excluded
708
709 const ClassDef *cd = nullptr;
711 {
712 cd = toClassDef(container);
713 }
714 ol.startMemberDocSimple(cd && cd->isJavaEnum());
715 for (const auto &md : m_members)
716 {
718 if (mdm)
719 {
721 }
722 }
723 ol.endMemberDocSimple(cd && cd->isJavaEnum());
724}
725
726// separate member pages
728 const DString &scopeName, const DefinitionMutable *container, int hierarchyLevel) const
729{
730 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
731
732 struct OverloadInfo
733 {
734 uint32_t count = 1;
735 uint32_t total = 0;
736 };
737 std::unordered_map<std::string,OverloadInfo> overloadInfo;
738
739 // count the number of overloaded members
740 for (const auto &imd : m_members)
741 {
743
744 if (md && md->hasDetailedDescription())
745 {
746 auto it = overloadInfo.emplace(md->name().str(),OverloadInfo()).first;
747 it->second.total++;
748 }
749 }
750
751 for (const auto &imd : m_members)
752 {
753 Definition *container_d = toDefinition(const_cast<DefinitionMutable*>(container));
755 if (md && md->hasDetailedDescription())
756 {
757 auto it = overloadInfo.find(md->name().str());
758 uint32_t overloadCount = it->second.total;
759 uint32_t &count = it->second.count;
760 DString diskName=md->getOutputFileBase();
761 DString title=md->qualifiedName();
762 startFile(ol,diskName,false,md->name(),title,HighlightedItem::None,!generateTreeView,diskName, hierarchyLevel);
763 if (!generateTreeView)
764 {
766 ol.endQuickIndices();
767 }
768 ol.startContents();
769
770 if (generateTreeView)
771 {
772 md->writeDocumentation(this,count++,overloadCount,ol,scopeName,container_d,m_container==MemberListContainer::Group);
773
774 ol.endContents();
776 }
777 else
778 {
779 ol.writeString("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n"
780 " <tr>\n"
781 " <td valign=\"top\">\n");
782
784
785 ol.writeString(" </td>\n");
786 ol.writeString(" <td valign=\"top\" class=\"mempage\">\n");
787
788 md->writeDocumentation(this,count++,overloadCount,ol,scopeName,container_d,m_container==MemberListContainer::Group);
789
790 ol.writeString(" </td>\n");
791 ol.writeString(" </tr>\n");
792 ol.writeString("</table>\n");
793
794 endFile(ol);
795 }
796 }
797 }
798 for (const auto &mg : m_memberGroupRefList)
799 {
800 mg->writeDocumentationPage(ol,scopeName,container);
801 }
802}
803
805{
806 m_memberGroupRefList.push_back(mg);
807}
808
810{
811 for (const auto &imd : m_members)
812 {
814 if (md && !md->isAlias() && (md->getGroupDef()==nullptr || def->definitionType()==Definition::TypeGroup))
815 {
816 md->addListReference(def);
817 const MemberVector &enumFields = md->enumFieldList();
818 if (md->memberType()==MemberType::Enumeration && !enumFields.empty())
819 {
820 //printf(" Adding enum values!\n");
821 for (const auto &vmd : enumFields)
822 {
824 if (vmdm)
825 {
826 //printf(" adding %s\n",qPrint(vmd->name()));
827 vmdm->addListReference(def);
828 }
829 }
830 }
831 }
832 }
833 for (const auto &mg : m_memberGroupRefList)
834 {
835 mg->addListReferences(def);
836 }
837}
838
840{
841 for (const auto &imd : m_members)
842 {
844 if (md && !md->isAlias() && (md->getGroupDef()==nullptr || def->definitionType()==Definition::TypeGroup))
845 {
847 const MemberVector &enumFields = md->enumFieldList();
848 if (md->memberType()==MemberType::Enumeration && !enumFields.empty())
849 {
850 //printf(" Adding enum values!\n");
851 for (const auto &vmd : enumFields)
852 {
854 if (vmdm)
855 {
856 //printf(" adding %s\n",qPrint(vmd->name()));
857 vmdm->addRequirementReferences(def);
858 }
859 }
860 }
861 }
862 }
863 for (const auto &mg : m_memberGroupRefList)
864 {
865 mg->addRequirementReferences(def);
866 }
867}
868
870{
871 for (const auto &imd : m_members)
872 {
874 if (md)
875 {
877 }
878 }
879 for (const auto &mg : m_memberGroupRefList)
880 {
881 mg->findSectionsInDocumentation(d);
882 }
883}
884
886{
887 m_needsSorting = b;
888}
889
890void MemberList::writeTagFile(TextStream &tagFile,bool useQualifiedName,bool showNamespaceMembers)
891{
892 for (const auto &imd : m_members)
893 {
895 if (md)
896 {
897 if (md->getLanguage()!=SrcLangExt::VHDL)
898 {
899 md->writeTagFile(tagFile,useQualifiedName,showNamespaceMembers);
900 if (md->memberType()==MemberType::Enumeration && !md->isStrong())
901 {
902 for (const auto &ivmd : md->enumFieldList())
903 {
905 if (vmd)
906 {
907 vmd->writeTagFile(tagFile,useQualifiedName,showNamespaceMembers);
908 }
909 }
910 }
911 }
912 else
913 {
914 VhdlDocGen::writeTagFile(md,tagFile);
915 }
916 }
917 }
918 for (const auto &mg : m_memberGroupRefList)
919 {
920 mg->writeTagFile(tagFile,useQualifiedName);
921 }
922}
923
924// compute the HTML anchors for a list of members
926{
927 //int count=0;
928 for (const auto &md : m_members)
929 {
931 if (mdm && !md->isReference())
932 {
933 mdm->setAnchor();
934 }
935 }
936}
937
A abstract class representing of a compound symbol.
Definition classdef.h:100
virtual bool isJavaEnum() const =0
virtual void addGroupedInheritedMembers(OutputList &ol, MemberListType lt, const ClassDef *inheritedFrom, const DString &inheritId) const =0
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
Definition dstring.h:84
DString & setNum(short n)
Definition dstring.h:552
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
Definition dstring.h:148
std::string_view view() const
Definition dstring.h:162
static constexpr size_t npos
value used to indicate 'not found' or 'to the end of the string', matching std::string::npos
Definition dstring.h:178
size_t find(char c, size_t pos=0) const
Definition dstring.h:239
DString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition dstring.h:337
const std::string & str() const
Definition dstring.h:645
The common base class of all entity definitions found in the sources.
Definition definition.h:77
virtual DString briefDescription(bool abbreviate=false) const =0
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
virtual DString getDefFileName() const =0
virtual int getDefLine() const =0
virtual DefType definitionType() const =0
virtual const DString & name() const =0
virtual DString displayName(bool includeScope=true) const =0
virtual DString qualifiedName() const =0
virtual DString anchor() const =0
virtual DString getReference() const =0
virtual bool isAlias() const =0
virtual Definition * getOuterScope() const =0
virtual bool isReference() const =0
virtual DString getOutputFileBase() const =0
virtual void writeQuickMemberLinks(OutputList &, const MemberDef *) const =0
virtual void writeNavigationPath(OutputList &ol) const =0
A model of a file symbol.
Definition filedef.h:97
A model of a group of symbols.
Definition groupdef.h:48
A model of a class/file/namespace member symbol.
Definition memberdef.h:45
virtual bool isDestructor() const =0
virtual bool hasDetailedDescription() const =0
virtual bool isConstructor() const =0
virtual DString argsString() const =0
virtual GroupDef * getGroupDef()=0
virtual const MemberVector & enumFieldList() const =0
virtual MemberType memberType() const =0
virtual bool isStrong() const =0
virtual void writeDocumentation(const MemberList *ml, int memCount, int memTotal, OutputList &ol, const DString &scopeName, const Definition *container, bool inGroup, bool showEnumValues=false, bool showInline=false) const =0
virtual void writeMemberDocSimple(OutputList &ol, const Definition *container) const =0
virtual void addListReference(const Definition *)=0
virtual void findSectionsInDocumentation()=0
virtual void setAnonymousEnumType(const MemberDef *md)=0
virtual void writeTagFile(TextStream &, bool useQualifiedName, bool showNamespaceMembers) const =0
virtual void addRequirementReferences(const Definition *)=0
virtual void setAnchor()=0
A class representing a group of members.
Definition membergroup.h:42
void addListReferences(const Definition *def)
int numDecEnumValues() const
Definition memberlist.h:138
int m_numDecEnumValues
Definition memberlist.h:174
int numDocMembers() const
Definition memberlist.h:139
int numDocEnumValues() const
Definition memberlist.h:140
int countEnumValues(const MemberDef *md) const
void writeTagFile(TextStream &, bool useQualifiedName=false, bool showNamespaceMembers=true)
int m_numDocMembers
Definition memberlist.h:175
int m_numDecMembers
Definition memberlist.h:173
MemberListContainer container() const
Definition memberlist.h:132
MemberList(MemberListType lt, MemberListContainer container)
int numDecMembers() const
Definition memberlist.h:136
MemberGroupRefList m_memberGroupRefList
Definition memberlist.h:177
bool m_needsSorting
Definition memberlist.h:180
void writeDocumentationPage(OutputList &ol, const DString &scopeName, const DefinitionMutable *container, int hierarchyLevel=0) const
void setAnonymousEnumType()
int countInheritableMembers(const ClassDef *inheritedFrom) const
int m_numDocEnumValues
Definition memberlist.h:176
MemberListContainer m_container
Definition memberlist.h:178
void setNeedsSorting(bool b)
void writeSimpleDocumentation(OutputList &ol, const Definition *container) const
void writeDeclarations(OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod, const DString &title, const DString &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.
void writeDocumentation(OutputList &ol, const DString &scopeName, const Definition *container, const DString &title, const DString &anchor, bool showEnumValues=false, bool showInline=false) const
MemberListType listType() const
Definition memberlist.h:131
void addRequirementReferences(const Definition *def)
void countDecMembers() const
void countDocMembers()
MemberListType m_listType
Definition memberlist.h:179
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 DString &inheritId) const
void findSectionsInDocumentation(const Definition *d)
void addMemberGroup(MemberGroup *mg)
void setAnchors()
int numDecMembers(const ClassDef *inheritedFrom) const
Definition memberlist.h:134
bool declVisible() const
Wrapper class for the MemberListType type.
Definition types.h:346
constexpr const char * toLabel() const noexcept
Definition types.h:402
A vector of MemberDef object.
Definition memberlist.h:36
bool empty() const noexcept
Definition memberlist.h:61
An abstract interface of a namespace symbol.
Class representing a list of output generators that are written to in parallel.
Definition outputlist.h:311
void writeDoc(const IDocNodeAST *ast, const Definition *ctx, const MemberDef *md, int sectionLevel=-1)
Definition outputlist.h:379
void startMemberDeclaration()
Definition outputlist.h:565
void parseText(const DString &textStr)
void disable(OutputType o)
void writeObjectLink(const DString &ref, const DString &file, const DString &anchor, const DString &name)
Definition outputlist.h:435
void writeRuler()
Definition outputlist.h:517
void endContents()
Definition outputlist.h:616
void endMemberDescription()
Definition outputlist.h:563
void endInlineHeader()
Definition outputlist.h:483
void endMemberGroupDocs()
Definition outputlist.h:507
void endMemberDeclaration(const DString &anchor, const DString &inheritId)
Definition outputlist.h:567
void docify(const DString &s)
Definition outputlist.h:433
void startMemberHeader(const DString &anchor, int typ=2)
Definition outputlist.h:465
void writeAnchor(const DString &fileName, const DString &name)
Definition outputlist.h:519
void endMemberGroupHeader(bool b)
Definition outputlist.h:503
void insertMemberAlign(bool templ=false)
Definition outputlist.h:513
void writeString(const DString &text)
Definition outputlist.h:407
void endDoxyAnchor(const DString &fn, const DString &anchor)
Definition outputlist.h:537
void endMemberDocList()
Definition outputlist.h:475
void startMemberGroup()
Definition outputlist.h:509
void startMemberGroupHeader(const DString &id, bool b)
Definition outputlist.h:501
void startMemberList()
Definition outputlist.h:477
void endTextLink()
Definition outputlist.h:440
void addLabel(const DString &fName, const DString &anchor)
Definition outputlist.h:539
void endMemberItem(OutputGenerator::MemberItemType type)
Definition outputlist.h:491
void endMemberList()
Definition outputlist.h:479
void pushGeneratorState()
void startInlineHeader()
Definition outputlist.h:481
void disableAllBut(OutputType o)
void popGeneratorState()
void startTextLink(const DString &file, const DString &anchor)
Definition outputlist.h:438
void writeInheritedSectionTitle(const DString &id, const DString &ref, const DString &file, const DString &anchor, const DString &title, const DString &name)
Definition outputlist.h:569
void endGroupHeader(int extraLevels=0)
Definition outputlist.h:451
void startMemberItem(const DString &anchor, OutputGenerator::MemberItemType type, const DString &id=DString())
Definition outputlist.h:489
void endQuickIndices()
Definition outputlist.h:600
void startMemberDescription(const DString &anchor, const DString &inheritId=DString(), bool typ=false)
Definition outputlist.h:561
void generateDoc(const DString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const DString &docStr, const DocOptions &options)
void endMemberGroup(bool last)
Definition outputlist.h:511
void startMemberGroupDocs()
Definition outputlist.h:505
void startContents()
Definition outputlist.h:614
void startMemberDocSimple(bool b)
Definition outputlist.h:718
void startGroupHeader(const DString &id=DString(), int extraLevels=0)
Definition outputlist.h:449
void enableAll()
void endMemberHeader()
Definition outputlist.h:467
void endMemberSubtitle()
Definition outputlist.h:471
void startMemberDocList()
Definition outputlist.h:473
void endMemberDocSimple(bool b)
Definition outputlist.h:720
void startMemberSubtitle()
Definition outputlist.h:469
void startDoxyAnchor(const DString &fName, const DString &manName, const DString &anchor, const DString &name, const DString &args)
Definition outputlist.h:533
Text streaming class that buffers data.
Definition textstream.h:36
virtual DString trMore()=0
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:59
IDocNodeASTPtr validatingParseDoc(IDocParser &parserIntf, const DString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const DString &input, const DocOptions &options)
DString substitute(const DString &s, const DString &src, const DString &dst)
substitute all occurrences of src in s by dst
Definition dstring.cpp:485
int dstricmp_sort(const char *str1, const char *str2)
Definition dstring.h:67
void endFileWithNavPath(OutputList &ol, const DefinitionMutable *d, bool showPageNavigation)
Definition index.cpp:458
void endFile(OutputList &ol, bool skipNavIndex, bool skipEndContents, const DString &navPath)
Definition index.cpp:437
void startFile(OutputList &ol, const DString &name, bool isSource, const DString &manName, const DString &title, HighlightedItem hli, bool additionalIndices, const DString &altSidebarName, int hierarchyLevel, const DString &allMembersFile)
Definition index.cpp:411
Translator * theTranslator
Definition language.cpp:76
DString md5str(const std::string_view &str)
Definition md5hash.h:33
MemberDefMutable * toMemberDefMutable(Definition *d)
int genericCompareMembers(const MemberDef *c1, const MemberDef *c2)
#define err(fmt,...)
Definition message.h:127
Helper class to pass options when calling OutputList::generateDoc().
Definition docoptions.h:24
MemberListContainer
Definition types.h:472
DString stripPath(const DString &s)
Definition util.cpp:4092
A bunch of utility functions.