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 = c2->getDefLine()-c1->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
137 case MemberType::Property: numDecMembers++;
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;
148 case MemberType::Enumeration:
150 break;
151 case MemberType::EnumValue: numDecEnumValues++;
153 break;
154 case MemberType::Typedef: numDecMembers++;
155 break;
156 case MemberType::Sequence: numDecMembers++;
157 break;
158 case MemberType::Dictionary: numDecMembers++;
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;
166 case MemberType::Friend: numDecMembers++;
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 for (const auto &md : m_members)
251 {
253 if (mdm)
254 {
256 }
257 }
258 for (const auto &mg : m_memberGroupRefList)
259 {
260 mg->setAnonymousMemberPrefix(prefix);
261 }
262}
263
265{
266 int numEnumValues=0;
267 QCString name(md->name());
268 int i=name.findRev("::");
269 if (i!=-1) name=name.right(name.length()-i-2);
270 if (name[0]=='@')
271 {
272 for (const auto &vmd : m_members)
273 {
274 QCString vtype=vmd->typeString();
275 if ((vtype.find(name))!=-1)
276 {
277 numEnumValues++;
278 }
279 }
280 }
281 return numEnumValues;
282}
283
285{
286 for (const auto &md : m_members)
287 {
288 if (md->isBriefSectionVisible())
289 {
290 switch (md->memberType())
291 {
292 case MemberType::Define: // fall through
293 case MemberType::Typedef: // fall through
294 case MemberType::Variable: // fall through
295 case MemberType::Function: // fall through
296 case MemberType::Signal: // fall through
297 case MemberType::Slot: // fall through
298 case MemberType::DCOP: // fall through
299 case MemberType::Property: // fall through
300 case MemberType::Interface: // fall through
301 case MemberType::Service: // fall through
302 case MemberType::Sequence: // fall through
303 case MemberType::Dictionary: // fall through
304 case MemberType::Event:
305 return TRUE;
306 case MemberType::Enumeration:
307 {
308 // if this is an anonymous enum and there are variables of this
309 // enum type (i.e. enumVars>0), then we do not show the enum here.
310 if (countEnumValues(md)==0) // show enum here
311 {
312 return TRUE;
313 }
314 }
315 break;
316 case MemberType::Friend:
317 return TRUE;
318 case MemberType::EnumValue:
319 {
321 {
322 return TRUE;
323 }
324 }
325 break;
326 }
327 }
328 }
329 return FALSE;
330}
331
333 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd, const GroupDef *gd,const ModuleDef *mod,
334 int indentLevel, const ClassDef *inheritedFrom,const QCString &inheritId
335 ) const
336{
337 //printf("----- writePlainDeclaration() ----\n");
338 if (numDecMembers()==-1)
339 {
340 err("MemberList::numDecMembers()==-1, so the members of this list have not been counted. Please report as a bug.\n");
341 abort();
342 }
344 {
345 //printf(" --> no members!\n");
346 return; // no members in this list
347 }
348 //printf(" --> writePlainDeclaration() numDecMembers()=%d\n",
349 // numDecMembers());
350
352
353 bool first=TRUE;
354 for (const auto &md : m_members)
355 {
356 //printf(">>> Member '%s' type=%d visible=%d inheritedFrom=%p inheritId=%s\n",
357 // qPrint(md->name()),md->memberType(),md->isBriefSectionVisible(),(void*)inheritedFrom,qPrint(inheritId));
358 if ((inheritedFrom==nullptr || !md->isReimplementedBy(inheritedFrom)) &&
359 md->isBriefSectionVisible())
360 {
361 //printf(">>> rendering\n");
362 switch(md->memberType())
363 {
364 case MemberType::Define: // fall through
365 //case MemberType::Prototype: // fall through
366 case MemberType::Typedef: // fall through
367 case MemberType::Variable: // fall through
368 case MemberType::Function: // fall through
369 case MemberType::Signal: // fall through
370 case MemberType::Slot: // fall through
371 case MemberType::DCOP: // fall through
372 case MemberType::Property: // fall through
373 case MemberType::Interface: // fall through
374 case MemberType::Service: // fall through
375 case MemberType::Sequence: // fall through
376 case MemberType::Dictionary: // fall through
377 case MemberType::Event:
378 {
379 if (first) ol.startMemberList(),first=FALSE;
380 md->writeDeclaration(ol,cd,nd,fd,gd,mod,inGroup,indentLevel,inheritedFrom,inheritId);
381 break;
382 }
383 case MemberType::Enumeration:
384 {
385 // if this is an anonymous enum and there are variables of this
386 // enum type (i.e. enumVars>0), then we do not show the enum here.
387 if (countEnumValues(md)==0) // show enum here
388 {
389 //printf("Enum!!\n");
390 if (first)
391 {
392 ol.startMemberList();
393 first=FALSE;
394 }
397 bool detailsLinkable = md->hasDetailedDescription();
398 if (!detailsLinkable)
399 {
400 ol.startDoxyAnchor(md->getOutputFileBase(),QCString(),md->anchor(),md->name(),QCString());
401 ol.addLabel(md->getOutputFileBase(),md->anchor());
402 }
403 if (md->isSliceLocal())
404 {
405 ol.writeString("local ");
406 }
407 ol.writeString("enum ");
408 if (md->getLanguage()==SrcLangExt::Cpp && md->isStrong())
409 {
410 if (md->isEnumStruct())
411 {
412 ol.writeString("struct ");
413 }
414 else
415 {
416 ol.writeString("class ");
417 }
418 }
420 md->writeEnumDeclaration(ol,cd,nd,fd,gd,mod);
421 if (!detailsLinkable)
422 {
423 ol.endDoxyAnchor(md->getOutputFileBase(),md->anchor());
424 }
426 if (!md->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
427 {
428 auto parser { createDocParser() };
429 auto ast { validatingParseDoc(*parser.get(),
430 md->briefFile(),
431 md->briefLine(),
432 cd ? cd : md->getOuterScope(),
433 md,
434 md->briefDescription(),
435 DocOptions()
436 .setIndexWords(true)
437 .setSingleLine(true))
438 };
439 if (!ast->isEmpty())
440 {
441 ol.startMemberDescription(md->anchor(),inheritId);
442 ol.writeDoc(ast.get(),cd,md);
443 if (md->hasDetailedDescription())
444 {
446 ol.docify(" ");
447 ol.startTextLink(md->getOutputFileBase(),
448 md->anchor());
449 ol.parseText(theTranslator->trMore());
450 ol.endTextLink();
451 ol.enableAll();
452 }
454 }
455 }
456 ol.endMemberDeclaration(md->anchor(),inheritId);
457 }
458 md->warnIfUndocumented();
459 break;
460 }
461 case MemberType::Friend:
462 if (inheritedFrom==nullptr)
463 {
464 if (first)
465 {
466 ol.startMemberList();
467 first=FALSE;
468 }
469 md->writeDeclaration(ol,cd,nd,fd,gd,mod,inGroup,indentLevel,inheritedFrom,inheritId);
470 break;
471 }
472 case MemberType::EnumValue:
473 {
474 if (inGroup)
475 {
476 //printf("EnumValue!\n");
477 if (first) ol.startMemberList(),first=FALSE;
478 md->writeDeclaration(ol,cd,nd,fd,gd,mod,true,indentLevel,inheritedFrom,inheritId);
479 }
480 }
481 break;
482 }
483 }
484 }
485
486 if (!first)
487 {
488 ol.endMemberList();
489 }
490
492 //printf("----- end writePlainDeclaration() ----\n");
493}
494
495/** Writes the list of members to the output.
496 * @param ol Output list to write to
497 * @param cd non-null if this list is part of class documentation.
498 * @param nd non-null if this list is part of namespace documentation.
499 * @param fd non-null if this list is part of file documentation.
500 * @param gd non-null if this list is part of group documentation.
501 * @param mod non-null if this list is part of module documentation.
502 * @param title Title to use for the member list.
503 * @param subtitle Sub title to use for the member list.
504 * @param showEnumValues Obsolete, always set to FALSE.
505 * @param showInline if set to TRUE if title is rendered differently
506 * @param inheritedFrom if not 0, the list is shown inside the
507 * given class as inherited members, parameter cd points to the
508 * class containing the members.
509 * @param lt Type of list that is inherited from.
510 * @param showSectionTitle do we show the "additional members" header or not?
511 * When combining public and protected inherited members under a single header only for the first list it should be shown
512 */
514 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
515 const QCString &title,const QCString &subtitle, bool /*showEnumValues*/,
516 bool showInline,const ClassDef *inheritedFrom,MemberListType lt,bool showSectionTitle) const
517{
518 //printf("----- writeDeclaration() this=%p ---- inheritedFrom=%p\n",this,inheritedFrom);
519 bool optimizeVhdl = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
520 QCString inheritId;
521
522 const Definition *ctx = cd;
523 if (ctx==nullptr && nd) ctx = nd;
524 if (ctx==nullptr && gd) ctx = gd;
525 if (ctx==nullptr && mod) ctx = mod;
526 if (ctx==nullptr && fd) ctx = fd;
527
528 //printf("%p: MemberList::writeDeclaration(title='%s',subtitle='%s')=%d inheritedFrom=%p\n",
529 // (void*)this,qPrint(title),qPrint(subtitle),numDecMembers(),(void*)inheritedFrom);
530
531 int num = numDecMembers(inheritedFrom);
532 int numEnumValues = numDecEnumValues();
533 if (inheritedFrom && num>0)
534 {
535 if (cd && !optimizeVhdl)
536 {
537 inheritId = substitute(lt.toLabel(),"-","_")+"_"+
539 if (showSectionTitle && !title.isEmpty())
540 {
541 ol.writeInheritedSectionTitle(inheritId,cd->getReference(),
542 cd->getOutputFileBase(),
543 cd->anchor(),title,cd->displayName());
544 }
545 }
546 }
547 else if (num>numEnumValues)
548 {
549 if (!title.isEmpty())
550 {
551 if (showInline)
552 {
554 }
555 else
556 {
557 ol.startMemberHeader(m_listType.toLabel());
558 }
559 ol.parseText(title);
560 if (showInline)
561 {
562 ol.endInlineHeader();
563 }
564 else
565 {
566 ol.endMemberHeader();
567 }
568 }
569 if (!subtitle.stripWhiteSpace().isEmpty())
570 {
572 ol.generateDoc("[generated]", -1, ctx, nullptr, subtitle, DocOptions());
574 }
575 }
576 if (num>numEnumValues)
577 {
579 // TODO: Two things need to be worked out for proper VHDL output:
580 // 1. Signals and types under the group need to be
581 // formatted to associate them with the group somehow
582 // indentation, or at the very least, extra space after
583 // the group is done
584 // 2. This might need to be repeated below for memberGroupLists
585 if (optimizeVhdl) // use specific declarations function
586 {
587 VhdlDocGen::writeVhdlDeclarations(this,ol,nullptr,cd,nullptr,nullptr,nullptr);
588 }
589 else
590 {
591 writePlainDeclarations(ol,inGroup,cd,nd,fd,gd,mod,0,inheritedFrom,inheritId);
592 }
593
594 //printf("memberGroupList=%p\n",memberGroupList);
595 int groupId=0;
596 for (const auto &mg : m_memberGroupRefList)
597 {
598 bool hasHeader=!mg->header().isEmpty();
599 if (inheritId.isEmpty())
600 {
601 QCString groupAnchor = QCString(listType().toLabel())+"-"+QCString().setNum(groupId++);
602 //printf("mg->header=%s hasHeader=%d\n",qPrint(mg->header()),hasHeader);
603 ol.startMemberGroupHeader(groupAnchor,hasHeader);
604 if (hasHeader)
605 {
606 ol.parseText(mg->header());
607 }
608 ol.endMemberGroupHeader(hasHeader);
609 if (!mg->documentation().isEmpty())
610 {
611 //printf("Member group has docs!\n");
613 ol.generateDoc(mg->docFile(),
614 mg->docLine(),
615 mg->memberContainer(),
616 nullptr,
617 mg->documentation()+"\n",
618 DocOptions());
620 }
621 ol.startMemberGroup();
622 }
623 //printf("--- mg->writePlainDeclarations ---\n");
624 mg->writePlainDeclarations(ol,inGroup,cd,nd,fd,gd,mod,0,inheritedFrom,inheritId);
625 if (inheritId.isEmpty())
626 {
627 ol.endMemberGroup(hasHeader);
628 }
629 }
630 }
631 if (inheritedFrom && cd)
632 {
633 // also add members that of this list type, that are grouped together
634 // in a separate list in class 'inheritedFrom'
635 cd->addGroupedInheritedMembers(ol,m_listType,inheritedFrom,inheritId);
636 }
637 //printf("----- end writeDeclaration() ----\n");
638}
639
641 const QCString &scopeName, const Definition *container,
642 const QCString &title,const QCString &anchor,
643 bool showEnumValues,bool showInline) const
644{
645 if (numDocMembers()==-1)
646 {
647 err("MemberList::numDocMembers()==-1, so the members of this list have not been counted. Please report as a bug.\n");
648 abort();
649 }
650
651 if (numDocMembers()==0) return;
652 if (!showEnumValues && numDocMembers()<=numDocEnumValues()) return;
653
654 if (!title.isEmpty())
655 {
658 ol.writeRuler();
660 if (container) ol.writeAnchor(container->getOutputFileBase(),anchor);
661 ol.startGroupHeader(anchor,showInline ? 2 : 0);
662 ol.parseText(title);
663 ol.endGroupHeader(showInline ? 2 : 0);
664 }
666
667 struct OverloadInfo
668 {
669 uint32_t count = 1;
670 uint32_t total = 0;
671 };
672 std::unordered_map<std::string,OverloadInfo> overloadInfo;
673 // count the number of overloaded members
674 for (const auto &md : m_members)
675 {
676 if (md->isDetailedSectionVisible(m_container) &&
677 !(md->isEnumValue() && !showInline))
678 {
679 auto it = overloadInfo.emplace(md->name().str(),OverloadInfo()).first;
680 it->second.total++;
681 }
682 }
683
684 for (const auto &md : m_members)
685 {
686 if (md->isDetailedSectionVisible(m_container) &&
687 !(md->isEnumValue() && !showInline))
688 {
689 auto it = overloadInfo.find(md->name().str());
690 uint32_t overloadCount = it->second.total;
691 uint32_t &count = it->second.count;
693 if (mdm)
694 {
695 mdm->writeDocumentation(this,count++,overloadCount,ol,scopeName,container,
696 m_container==MemberListContainer::Group,showEnumValues,showInline);
697 }
698 }
699 }
700 //printf("MemberList::writeDocumentation() -- member groups %d\n",memberGroupList->count());
701 for (const auto &mg : m_memberGroupRefList)
702 {
703 mg->writeDocumentation(ol,scopeName,container,showEnumValues,showInline);
704 }
705 ol.endMemberDocList();
706}
707
708// members in a table
710 const Definition *container) const
711{
712 //printf("MemberList count=%d enumValues=%d\n",numDocMembers(),numDocEnumValues());
713 if (numDocMembers()<=numDocEnumValues()) return; // only enum values and they should be excluded
714
715 const ClassDef *cd = nullptr;
716 if (container && container->definitionType()==Definition::TypeClass)
717 {
718 cd = toClassDef(container);
719 }
720 ol.startMemberDocSimple(cd && cd->isJavaEnum());
721 for (const auto &md : m_members)
722 {
724 if (mdm)
725 {
727 }
728 }
729 ol.endMemberDocSimple(cd && cd->isJavaEnum());
730}
731
732// separate member pages
734 const QCString &scopeName, const DefinitionMutable *container, int hierarchyLevel) const
735{
736 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
737
738 struct OverloadInfo
739 {
740 uint32_t count = 1;
741 uint32_t total = 0;
742 };
743 std::unordered_map<std::string,OverloadInfo> overloadInfo;
744
745 // count the number of overloaded members
746 for (const auto &imd : m_members)
747 {
749
750 if (md && md->hasDetailedDescription())
751 {
752 auto it = overloadInfo.emplace(md->name().str(),OverloadInfo()).first;
753 it->second.total++;
754 }
755 }
756
757 for (const auto &imd : m_members)
758 {
759 Definition *container_d = toDefinition(const_cast<DefinitionMutable*>(container));
761 if (md && md->hasDetailedDescription())
762 {
763 auto it = overloadInfo.find(md->name().str());
764 uint32_t overloadCount = it->second.total;
765 uint32_t &count = it->second.count;
766 QCString diskName=md->getOutputFileBase();
767 QCString title=md->qualifiedName();
768 startFile(ol,diskName,false,md->name(),title,HighlightedItem::None,!generateTreeView,diskName, hierarchyLevel);
769 if (!generateTreeView)
770 {
771 container->writeNavigationPath(ol);
772 ol.endQuickIndices();
773 }
774 ol.startContents();
775
776 if (generateTreeView)
777 {
778 md->writeDocumentation(this,count++,overloadCount,ol,scopeName,container_d,m_container==MemberListContainer::Group);
779
780 ol.endContents();
782 }
783 else
784 {
785 ol.writeString("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n"
786 " <tr>\n"
787 " <td valign=\"top\">\n");
788
789 container->writeQuickMemberLinks(ol,md);
790
791 ol.writeString(" </td>\n");
792 ol.writeString(" <td valign=\"top\" class=\"mempage\">\n");
793
794 md->writeDocumentation(this,count++,overloadCount,ol,scopeName,container_d,m_container==MemberListContainer::Group);
795
796 ol.writeString(" </td>\n");
797 ol.writeString(" </tr>\n");
798 ol.writeString("</table>\n");
799
800 endFile(ol);
801 }
802 }
803 }
804 for (const auto &mg : m_memberGroupRefList)
805 {
806 mg->writeDocumentationPage(ol,scopeName,container);
807 }
808}
809
811{
812 m_memberGroupRefList.push_back(mg);
813}
814
816{
817 for (const auto &imd : m_members)
818 {
820 if (md && !md->isAlias() && (md->getGroupDef()==nullptr || def->definitionType()==Definition::TypeGroup))
821 {
822 md->addListReference(def);
823 const MemberVector &enumFields = md->enumFieldList();
824 if (md->memberType()==MemberType::Enumeration && !enumFields.empty())
825 {
826 //printf(" Adding enum values!\n");
827 for (const auto &vmd : enumFields)
828 {
830 if (vmdm)
831 {
832 //printf(" adding %s\n",qPrint(vmd->name()));
833 vmdm->addListReference(def);
834 }
835 }
836 }
837 }
838 }
839 for (const auto &mg : m_memberGroupRefList)
840 {
841 mg->addListReferences(def);
842 }
843}
844
846{
847 for (const auto &imd : m_members)
848 {
850 if (md && !md->isAlias() && (md->getGroupDef()==nullptr || def->definitionType()==Definition::TypeGroup))
851 {
853 const MemberVector &enumFields = md->enumFieldList();
854 if (md->memberType()==MemberType::Enumeration && !enumFields.empty())
855 {
856 //printf(" Adding enum values!\n");
857 for (const auto &vmd : enumFields)
858 {
860 if (vmdm)
861 {
862 //printf(" adding %s\n",qPrint(vmd->name()));
863 vmdm->addRequirementReferences(def);
864 }
865 }
866 }
867 }
868 }
869 for (const auto &mg : m_memberGroupRefList)
870 {
871 mg->addRequirementReferences(def);
872 }
873}
874
876{
877 for (const auto &imd : m_members)
878 {
880 if (md)
881 {
883 }
884 }
885 for (const auto &mg : m_memberGroupRefList)
886 {
887 mg->findSectionsInDocumentation(d);
888 }
889}
890
892{
893 m_needsSorting = b;
894}
895
896void MemberList::writeTagFile(TextStream &tagFile,bool useQualifiedName,bool showNamespaceMembers)
897{
898 for (const auto &imd : m_members)
899 {
901 if (md)
902 {
903 if (md->getLanguage()!=SrcLangExt::VHDL)
904 {
905 md->writeTagFile(tagFile,useQualifiedName,showNamespaceMembers);
906 if (md->memberType()==MemberType::Enumeration && !md->isStrong())
907 {
908 for (const auto &ivmd : md->enumFieldList())
909 {
911 if (vmd)
912 {
913 vmd->writeTagFile(tagFile,useQualifiedName,showNamespaceMembers);
914 }
915 }
916 }
917 }
918 else
919 {
920 VhdlDocGen::writeTagFile(md,tagFile);
921 }
922 }
923 }
924 for (const auto &mg : m_memberGroupRefList)
925 {
926 mg->writeTagFile(tagFile,useQualifiedName);
927 }
928}
929
930// compute the HTML anchors for a list of members
932{
933 //int count=0;
934 for (const auto &md : m_members)
935 {
937 if (mdm && !md->isReference())
938 {
939 mdm->setAnchor();
940 }
941 }
942}
943
constexpr auto prefix
Definition anchor.cpp:44
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:77
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 Definition * getOuterScope() 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(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 setAnonymousMemberPrefix(const QCString &prefix)=0
virtual void addRequirementReferences(const Definition *)=0
virtual void setAnchor()=0
A class representing a group of members.
Definition membergroup.h:44
void addListReferences(const Definition *def)
int numDecEnumValues() const
Definition memberlist.h:137
int m_numDecEnumValues
Definition memberlist.h:174
int numDocMembers() const
Definition memberlist.h:138
int numDocEnumValues() const
Definition memberlist.h:139
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:175
int m_numDecMembers
Definition memberlist.h:173
MemberListContainer container() const
Definition memberlist.h:131
MemberList(MemberListType lt, MemberListContainer container)
int numDecMembers() const
Definition memberlist.h:135
MemberGroupRefList m_memberGroupRefList
Definition memberlist.h:177
bool m_needsSorting
Definition memberlist.h:180
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:176
void setAnonymousMemberPrefix(const QCString &prefix)
MemberListContainer m_container
Definition memberlist.h:178
void setNeedsSorting(bool b)
void writeSimpleDocumentation(OutputList &ol, const Definition *container) const
MemberListType listType() const
Definition memberlist.h:130
void writeDocumentation(OutputList &ol, const QCString &scopeName, const Definition *container, const QCString &title, const QCString &anchor, bool showEnumValues=FALSE, bool showInline=FALSE) const
void addRequirementReferences(const Definition *def)
void countDecMembers() const
void countDocMembers()
MemberListType m_listType
Definition memberlist.h:179
void findSectionsInDocumentation(const Definition *d)
void addMemberGroup(MemberGroup *mg)
void setAnchors()
int numDecMembers(const ClassDef *inheritedFrom) const
Definition memberlist.h:133
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 noexcept
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:315
void writeDoc(const IDocNodeAST *ast, const Definition *ctx, const MemberDef *md, int sectionLevel=-1)
Definition outputlist.h:383
void writeString(const QCString &text)
Definition outputlist.h:411
void startMemberDeclaration()
Definition outputlist.h:569
void disable(OutputType o)
void writeRuler()
Definition outputlist.h:521
void startGroupHeader(const QCString &id=QCString(), int extraLevels=0)
Definition outputlist.h:453
void endContents()
Definition outputlist.h:620
void endMemberDescription()
Definition outputlist.h:567
void endInlineHeader()
Definition outputlist.h:487
void endMemberGroupDocs()
Definition outputlist.h:511
void startMemberDescription(const QCString &anchor, const QCString &inheritId=QCString(), bool typ=false)
Definition outputlist.h:565
void endMemberGroupHeader(bool b)
Definition outputlist.h:507
void endDoxyAnchor(const QCString &fn, const QCString &anchor)
Definition outputlist.h:541
void docify(const QCString &s)
Definition outputlist.h:437
void generateDoc(const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &docStr, const DocOptions &options)
void endMemberDocList()
Definition outputlist.h:479
void startMemberGroup()
Definition outputlist.h:513
void startMemberList()
Definition outputlist.h:481
void endTextLink()
Definition outputlist.h:444
void endMemberItem(OutputGenerator::MemberItemType type)
Definition outputlist.h:495
void endMemberList()
Definition outputlist.h:483
void addLabel(const QCString &fName, const QCString &anchor)
Definition outputlist.h:543
void pushGeneratorState()
void insertMemberAlign(bool templ=FALSE)
Definition outputlist.h:517
void startInlineHeader()
Definition outputlist.h:485
void disableAllBut(OutputType o)
void popGeneratorState()
void writeAnchor(const QCString &fileName, const QCString &name)
Definition outputlist.h:523
void endGroupHeader(int extraLevels=0)
Definition outputlist.h:455
void startDoxyAnchor(const QCString &fName, const QCString &manName, const QCString &anchor, const QCString &name, const QCString &args)
Definition outputlist.h:537
void endQuickIndices()
Definition outputlist.h:604
void endMemberGroup(bool last)
Definition outputlist.h:515
void startMemberGroupDocs()
Definition outputlist.h:509
void startContents()
Definition outputlist.h:618
void startMemberDocSimple(bool b)
Definition outputlist.h:722
void endMemberDeclaration(const QCString &anchor, const QCString &inheritId)
Definition outputlist.h:571
void enableAll()
void endMemberHeader()
Definition outputlist.h:471
void endMemberSubtitle()
Definition outputlist.h:475
void startMemberItem(const QCString &anchor, OutputGenerator::MemberItemType type, const QCString &id=QCString())
Definition outputlist.h:493
void startMemberDocList()
Definition outputlist.h:477
void endMemberDocSimple(bool b)
Definition outputlist.h:724
void startMemberSubtitle()
Definition outputlist.h:473
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:573
void startMemberGroupHeader(const QCString &id, bool b)
Definition outputlist.h:505
void startTextLink(const QCString &file, const QCString &anchor)
Definition outputlist.h:442
void startMemberHeader(const QCString &anchor, int typ=2)
Definition outputlist.h:469
This is an alternative implementation of QCString.
Definition qcstring.h:103
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:170
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:167
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition qcstring.h:264
const std::string & str() const
Definition qcstring.h:556
QCString & setNum(short n)
Definition qcstring.h:463
QCString right(size_t len) const
Definition qcstring.h:238
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition qcstring.cpp:96
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)
IDocNodeASTPtr validatingParseDoc(IDocParser &parserIntf, const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &input, const DocOptions &options)
IDocParserPtr createDocParser()
factory function to create a parser
Definition docparser.cpp:55
void endFile(OutputList &ol, bool skipNavIndex, bool skipEndContents, const QCString &navPath)
Definition index.cpp:429
void startFile(OutputList &ol, const QCString &name, bool isSource, const QCString &manName, const QCString &title, HighlightedItem hli, bool additionalIndices, const QCString &altSidebarName, int hierarchyLevel, const QCString &allMembersFile)
Definition index.cpp:403
void endFileWithNavPath(OutputList &ol, const DefinitionMutable *d, bool showPageNavigation)
Definition index.cpp:450
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:571
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
MemberListContainer
Definition types.h:472
QCString stripPath(const QCString &s)
Definition util.cpp:4973
A bunch of utility functions.