Doxygen
Loading...
Searching...
No Matches
groupdef.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// own header
19#include "groupdef.h"
20
21// standard includes
22#include <algorithm>
23#include <cctype>
24#include <memory>
25#include <vector>
26
27// other includes
28#include "arguments.h"
29#include "classdef.h"
30#include "classlist.h"
31#include "conceptdef.h"
32#include "config.h"
33#include "definitionimpl.h"
34#include "dirdef.h"
35#include "docparser.h"
36#include "dot.h"
38#include "doxygen.h"
39#include "filedef.h"
40#include "language.h"
41#include "layout.h"
42#include "membergroup.h"
43#include "memberlist.h"
44#include "membername.h"
45#include "message.h"
46#include "moduledef.h"
47#include "namespacedef.h"
48#include "outputlist.h"
49#include "pagedef.h"
50#include "util.h"
51#include "vhdldocgen.h"
52
53//---------------------------------------------------------------------------
54
55class GroupDefImpl final : public DefinitionMixin<GroupDef>
56{
57 public:
58 GroupDefImpl(const DString &fileName,int line,const DString &name,const DString &title,const DString &refFileName=DString());
59 ~GroupDefImpl() override;
61
62 DefType definitionType() const override { return TypeGroup; }
64 DString getOutputFileBase() const override;
65 DString anchor() const override { return DString(); }
66 DString displayName(bool=true) const override { return hasGroupTitle() ? m_title : DefinitionMixin::name(); }
67 DString groupTitle() const override { return m_title; }
68 DString groupTitleAsText() const override { return m_titleAsText; }
69 void setGroupTitle( const DString &newtitle ) override;
70 bool hasGroupTitle( ) const override { return m_titleSet; }
71 void addFile(FileDef *def) override;
72 bool containsFile(const FileDef *def) const override;
73 bool addClass(ClassDef *def) override;
74 bool addConcept(ConceptDef *def) override;
75 bool addModule(ModuleDef *def) override;
76 bool addNamespace(NamespaceDef *def) override;
77 void addGroup(GroupDef *def) override;
78 void addPage(PageDef *def) override;
79 void addExample(PageDef *def) override;
80 void addDir(DirDef *dd) override;
81 bool insertMember(MemberDef *def,bool docOnly=false) override;
82 void removeMember(MemberDef *md) override;
83 bool findGroup(const GroupDef *def) const override; // true if def is a subgroup of this group
84 void writeDocumentation(OutputList &ol) override;
85 void writeMemberPages(OutputList &ol, int hierarchyLevel) override;
86 void writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const override;
87 void writeTagFile(TextStream &) override;
88 size_t numDocMembers() const override;
89 bool isLinkableInProject() const override;
90 bool isLinkable() const override;
91 bool isVisibleInHierarchy() const override;
92 bool isASubGroup() const override;
93 void computeAnchors() override;
94 void countMembers() override;
95
96 void addMembersToMemberGroup() override;
98 void findSectionsInDocumentation() override;
99
100 void addListReferences() override;
101 void addRequirementReferences() override;
102 void sortMemberLists() override;
103 bool subGrouping() const override { return m_subGrouping; }
104
105 void setGroupScope(Definition *d) override { m_groupScope = d; }
106 Definition *getGroupScope() const override { return m_groupScope; }
107
108 MemberList *getMemberList(MemberListType lt) const override;
109 const MemberLists &getMemberLists() const override { return m_memberLists; }
110
111 /* user defined member groups */
112 const MemberGroupList &getMemberGroups() const override { return m_memberGroups; }
113
114 const FileList &getFiles() const override { return m_fileList; }
115 const ClassLinkedRefMap &getClasses() const override { return m_classes; }
116 const ConceptLinkedRefMap &getConcepts() const override { return m_concepts; }
117 const ModuleLinkedRefMap &getModules() const override { return m_modules; }
118 const NamespaceLinkedRefMap &getNamespaces() const override { return m_namespaces; }
119 const GroupList &getSubGroups() const override { return m_groups; }
120 const PageLinkedRefMap &getPages() const override { return m_pages; }
121 const DirList & getDirs() const override { return m_dirList; }
122 const PageLinkedRefMap &getExamples() const override { return m_examples; }
123 bool hasDetailedDescription() const override;
124 void sortSubGroups() override;
125 void writeSummaryLinks(OutputList &ol) const override;
126 void writePageNavigation(OutputList &ol) const override;
127
128 bool hasGroupGraph() const override;
129 void overrideGroupGraph(bool e) override;
130 private:
131 void addMemberListToGroup(MemberList *,bool (MemberDef::*)() const);
136 void writeGroupGraph(OutputList &ol);
137 void writeFiles(OutputList &ol,const DString &title);
138 void writeNamespaces(OutputList &ol,const DString &title);
139 void writeNestedGroups(OutputList &ol,const DString &title);
140 void writeDirs(OutputList &ol,const DString &title);
141 void writeClasses(OutputList &ol,const DString &title);
142 void writeConcepts(OutputList &ol,const DString &title);
143 void writeModules(OutputList &ol,const DString &title);
146 void writeDetailedDescription(OutputList &ol,const DString &title);
154 void updateLanguage(const Definition *);
155 void setGroupTitleLocal( const DString &title);
156
157 DString m_title; // title of the group
158 DString m_titleAsText; // title of the group in plain text
159 bool m_titleSet; // true if title is not the same as the name
160 DString m_fileName; // base name of the generated file
161 FileList m_fileList; // list of files in the group
162 ClassLinkedRefMap m_classes; // list of classes in the group
163 ConceptLinkedRefMap m_concepts; // list of concepts in the group
164 ModuleLinkedRefMap m_modules; // list of modules in the group
165 NamespaceLinkedRefMap m_namespaces; // list of namespaces in the group
166 GroupList m_groups; // list of sub groups.
167 PageLinkedRefMap m_pages; // list of pages in the group
168 PageLinkedRefMap m_examples; // list of examples in the group
169 DirList m_dirList; // list of directories in the group
176 bool m_hasGroupGraph = false;
177
178};
179
180std::unique_ptr<GroupDef> createGroupDef(const DString &fileName,int line,const DString &name,
181 const DString &title,const DString &refFileName)
182{
183 return std::make_unique<GroupDefImpl>(fileName,line,name,title,refFileName);
184}
185
186
187//---------------------------------------------------------------------------
188
189GroupDefImpl::GroupDefImpl(const DString &df,int dl,const DString &na,const DString &t,
190 const DString &refFileName) : DefinitionMixin(df,dl,1,na),
192{
193 if (!refFileName.empty())
194 {
195 m_fileName=stripExtension(refFileName);
196 }
197 else
198 {
199 m_fileName = convertNameToFile(DString("group_")+na);
200 }
202
203 //visited = 0;
204 m_groupScope = nullptr;
205 m_subGrouping=Config_getBool(SUBGROUPING);
206 m_hasGroupGraph=Config_getBool(GROUP_GRAPHS);
207}
208
212
214{
215 if ( !t.empty())
216 {
217 m_title = t;
218 m_titleAsText = parseCommentAsText(this,nullptr,t,docFile(),docLine());
219 m_titleSet = true;
220 }
221 else
222 {
223 m_title = name();
224 m_title[0]=static_cast<char>(toupper(m_title[0]));
226 m_titleSet = false;
227 }
228}
229
231{
233}
234
235
237{
238 for (const auto &mg : m_memberGroups)
239 {
240 mg->distributeMemberGroupDocumentation();
241 }
242}
243
245{
249
250 for (const auto &mg : m_memberGroups)
251 {
252 mg->findSectionsInDocumentation(this);
253 }
254
255 for (auto &ml : m_memberLists)
256 {
257 if (ml->listType().isDeclaration())
258 {
259 ml->findSectionsInDocumentation(this);
260 }
261 }
262}
263
265{
266 bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS);
267 if (def->isHidden()) return;
268 updateLanguage(def);
269 if (sortBriefDocs)
270 m_fileList.insert( std::upper_bound( m_fileList.begin(), m_fileList.end(), def,
271 [](const auto &fd1, const auto &fd2)
272 { return dstricmp_sort(fd1->name(),fd2->name())<0; }),
273 def);
274 else
275 m_fileList.push_back(def);
276}
277
279{
280 return std::find(m_fileList.cbegin(),m_fileList.cend(), def) != m_fileList.cend();
281}
282
284{
285 if (cd->isHidden()) return false;
286 updateLanguage(cd);
287 DString qn = cd->name();
288 if (m_classes.find(qn)==nullptr)
289 {
290 m_classes.add(qn,cd);
291 return true;
292 }
293 return false;
294}
295
297{
298 if (cd->isHidden()) return false;
299 DString qn = cd->name();
300 if (m_concepts.find(qn)==nullptr)
301 {
302 m_concepts.add(qn,cd);
303 return true;
304 }
305 return false;
306}
307
309{
310 if (mod->isHidden()) return false;
311 DString qn = mod->name();
312 if (m_modules.find(qn)==nullptr)
313 {
314 m_modules.add(qn,mod);
315 return true;
316 }
317 return false;
318}
319
321{
322 //printf("adding namespace hidden=%d\n",def->isHidden());
323 if (def->isHidden()) return false;
324 if (m_namespaces.find(def->name())==nullptr)
325 {
326 updateLanguage(def);
327 m_namespaces.add(def->name(),def);
328 return true;
329 }
330 return false;
331}
332
334{
335 if (def->isHidden()) return;
336 m_dirList.push_back(def);
337}
338
340{
341 if (def->isHidden()) return;
342 //printf("Making page %s part of a group\n",qPrint(def->name));
343 m_pages.add(def->name(),def);
344 def->makePartOfGroup(this);
345}
346
348{
349 if (def->isHidden()) return;
350 m_examples.add(def->name(),def);
351}
352
353
355{
356 for (auto &ml : m_memberLists)
357 {
358 if (ml->listType().isDeclaration())
359 {
361 }
362 }
363}
364
365
367{
368 if (md->isHidden()) return false;
369 updateLanguage(md);
370 //printf("GroupDef(%s)::insertMember(%s)\n", qPrint(title), qPrint(md->name()));
372 for (auto &srcMi : *mni)
373 {
374 const MemberDef *srcMd = srcMi->memberDef();
375 if (srcMd==md) return false; // already added before!
376
377 bool sameScope = srcMd->getOuterScope()==md->getOuterScope() || // same class or namespace
378 // both inside a file => definition and declaration do not have to be in the same file
381
382 const ArgumentList &srcMdAl = srcMd->argumentList();
383 const ArgumentList &mdAl = md->argumentList();
384 const ArgumentList &tSrcMdAl = srcMd->templateArguments();
385 const ArgumentList &tMdAl = md->templateArguments();
386
387 if (srcMd->isFunction() && md->isFunction() && // both are a function
388 (tSrcMdAl.size()==tMdAl.size()) && // same number of template arguments
389 matchArguments2(srcMd->getOuterScope(),srcMd->getFileDef(),srcMd->typeString(),&srcMdAl,
390 md->getOuterScope(), md->getFileDef(), md->typeString(),&mdAl,
391 true,srcMd->getLanguage()
392 ) && // matching parameters
393 sameScope // both are found in the same scope
394 )
395 {
397 if (mdm && srcMd->getGroupAlias()==nullptr)
398 {
399 mdm->setGroupAlias(srcMd);
400 }
401 else if (mdm && md!=srcMd->getGroupAlias())
402 {
403 mdm->setGroupAlias(srcMd->getGroupAlias());
404 }
405 return false; // member is the same as one that is already added
406 }
407 }
408 mni->push_back(std::make_unique<MemberInfo>(md,md->protection(),md->virtualness(),false,false));
409 //printf("Added member!\n");
411 switch(md->memberType())
412 {
413 case MemberType::Variable:
414 if (!docOnly)
415 {
416 addMemberToList(MemberListType::DecVarMembers(),md);
417 }
418 addMemberToList(MemberListType::DocVarMembers(),md);
419 break;
420 case MemberType::Function:
421 if (!docOnly)
422 {
423 addMemberToList(MemberListType::DecFuncMembers(),md);
424 }
425 addMemberToList(MemberListType::DocFuncMembers(),md);
426 break;
427 case MemberType::Typedef:
428 if (!docOnly)
429 {
430 addMemberToList(MemberListType::DecTypedefMembers(),md);
431 }
432 addMemberToList(MemberListType::DocTypedefMembers(),md);
433 break;
434 case MemberType::Enumeration:
435 if (!docOnly)
436 {
437 addMemberToList(MemberListType::DecEnumMembers(),md);
438 }
439 addMemberToList(MemberListType::DocEnumMembers(),md);
440 break;
441 case MemberType::EnumValue:
442 if (!docOnly)
443 {
444 addMemberToList(MemberListType::DecEnumValMembers(),md);
445 }
446 addMemberToList(MemberListType::DocEnumValMembers(),md);
447 break;
448 case MemberType::Define:
449 if (!docOnly)
450 {
451 addMemberToList(MemberListType::DecDefineMembers(),md);
452 }
453 addMemberToList(MemberListType::DocDefineMembers(),md);
454 break;
455 case MemberType::Signal:
456 if (!docOnly)
457 {
458 addMemberToList(MemberListType::DecSignalMembers(),md);
459 }
460 addMemberToList(MemberListType::DocSignalMembers(),md);
461 break;
462 case MemberType::Slot:
463 if (md->protection()==Protection::Public)
464 {
465 if (!docOnly)
466 {
467 addMemberToList(MemberListType::DecPubSlotMembers(),md);
468 }
469 addMemberToList(MemberListType::DocPubSlotMembers(),md);
470 }
471 else if (md->protection()==Protection::Protected)
472 {
473 if (!docOnly)
474 {
475 addMemberToList(MemberListType::DecProSlotMembers(),md);
476 }
477 addMemberToList(MemberListType::DocProSlotMembers(),md);
478 }
479 else
480 {
481 if (!docOnly)
482 {
483 addMemberToList(MemberListType::DecPriSlotMembers(),md);
484 }
485 addMemberToList(MemberListType::DocPriSlotMembers(),md);
486 }
487 break;
488 case MemberType::Event:
489 if (!docOnly)
490 {
491 addMemberToList(MemberListType::DecEventMembers(),md);
492 }
493 addMemberToList(MemberListType::DocEventMembers(),md);
494 break;
495 case MemberType::Property:
496 if (!docOnly)
497 {
498 addMemberToList(MemberListType::DecPropMembers(),md);
499 }
500 addMemberToList(MemberListType::DocPropMembers(),md);
501 break;
502 case MemberType::Friend:
503 if (!docOnly)
504 {
505 addMemberToList(MemberListType::DecFriendMembers(),md);
506 }
507 addMemberToList(MemberListType::DocFriendMembers(),md);
508 break;
509 default:
510 err("GroupDefImpl::insertMembers(): "
511 "member '{}' (typeid='{}') with scope '{}' inserted in group scope '{}'!\n",
512 md->name(),md->memberTypeName(),
513 md->getClassDef() ? md->getClassDef()->name() : "",
514 name());
515 }
516 return true;
517}
518
520{
521 // fprintf(stderr, "GroupDef(%s)::removeMember( %s )\n", qPrint(title), qPrint(md->name()));
523 if (mni)
524 {
526
527 removeMemberFromList(MemberListType::AllMembersList(),md);
528 switch(md->memberType())
529 {
530 case MemberType::Variable:
531 removeMemberFromList(MemberListType::DecVarMembers(),md);
532 removeMemberFromList(MemberListType::DocVarMembers(),md);
533 break;
534 case MemberType::Function:
535 removeMemberFromList(MemberListType::DecFuncMembers(),md);
536 removeMemberFromList(MemberListType::DocFuncMembers(),md);
537 break;
538 case MemberType::Typedef:
539 removeMemberFromList(MemberListType::DecTypedefMembers(),md);
540 removeMemberFromList(MemberListType::DocTypedefMembers(),md);
541 break;
542 case MemberType::Enumeration:
543 removeMemberFromList(MemberListType::DecEnumMembers(),md);
544 removeMemberFromList(MemberListType::DocEnumMembers(),md);
545 break;
546 case MemberType::EnumValue:
547 removeMemberFromList(MemberListType::DecEnumValMembers(),md);
548 removeMemberFromList(MemberListType::DocEnumValMembers(),md);
549 break;
550 case MemberType::Define:
551 removeMemberFromList(MemberListType::DecDefineMembers(),md);
552 removeMemberFromList(MemberListType::DocDefineMembers(),md);
553 break;
554 case MemberType::Signal:
555 removeMemberFromList(MemberListType::DecSignalMembers(),md);
556 removeMemberFromList(MemberListType::DocSignalMembers(),md);
557 break;
558 case MemberType::Slot:
559 if (md->protection()==Protection::Public)
560 {
561 removeMemberFromList(MemberListType::DecPubSlotMembers(),md);
562 removeMemberFromList(MemberListType::DocPubSlotMembers(),md);
563 }
564 else if (md->protection()==Protection::Protected)
565 {
566 removeMemberFromList(MemberListType::DecProSlotMembers(),md);
567 removeMemberFromList(MemberListType::DocProSlotMembers(),md);
568 }
569 else
570 {
571 removeMemberFromList(MemberListType::DecPriSlotMembers(),md);
572 removeMemberFromList(MemberListType::DocPriSlotMembers(),md);
573 }
574 break;
575 case MemberType::Event:
576 removeMemberFromList(MemberListType::DecEventMembers(),md);
577 removeMemberFromList(MemberListType::DocEventMembers(),md);
578 break;
579 case MemberType::Property:
580 removeMemberFromList(MemberListType::DecPropMembers(),md);
581 removeMemberFromList(MemberListType::DocPropMembers(),md);
582 break;
583 case MemberType::Friend:
584 removeMemberFromList(MemberListType::DecFriendMembers(),md);
585 removeMemberFromList(MemberListType::DocFriendMembers(),md);
586 break;
587 default:
588 err("GroupDefImpl::removeMember(): unexpected member remove in file!\n");
589 }
590 }
591}
592
593bool GroupDefImpl::findGroup(const GroupDef *def) const
594{
595 if (this==def)
596 {
597 return true;
598 }
599 for (const auto &gd : m_groups)
600 {
601 if (gd->findGroup(def))
602 {
603 return true;
604 }
605 }
606 return false;
607}
608
610{
611 //printf("adding group '%s' to group '%s'\n",qPrint(def->name()),qPrint(name()));
612 //if (Config_getBool(SORT_MEMBER_DOCS))
613 // groupList->inSort(def);
614 //else
615 m_groups.push_back(def);
616}
617
619{
620 return !partOfGroups().empty();
621}
622
624{
625 for (auto &ml : m_memberLists)
626 {
627 ml->countDecMembers();
628 ml->countDocMembers();
629 }
630 for (const auto &mg : m_memberGroups)
631 {
632 mg->countDecMembers();
633 mg->countDocMembers();
634 }
635}
636
638{
639 return m_fileList.size()+
640 m_classes.size()+
642 m_groups.size()+
644 m_pages.size()+
646}
647
648/*! Compute the HTML anchor names for all members in the group */
650{
651 //printf("GroupDefImpl::computeAnchors()\n");
653}
654
656{
659 tagFile << " <compound kind=\"group\">\n";
660 tagFile << " <name>" << convertToXML(name()) << "</name>\n";
661 tagFile << " <title>" << convertToXML(m_titleAsText) << "</title>\n";
662 tagFile << " <filename>" << fn << "</filename>\n";
663 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Group))
664 {
665 switch (lde->kind())
666 {
667 case LayoutDocEntry::GroupClasses:
668 {
669 for (const auto &cd : m_classes)
670 {
671 if (cd->isLinkableInProject())
672 {
673 tagFile << " <class kind=\"" << cd->compoundTypeString()
674 << "\">" << convertToXML(cd->name()) << "</class>\n";
675 }
676 }
677 }
678 break;
679 case LayoutDocEntry::GroupConcepts:
680 {
681 for (const auto &cd : m_concepts)
682 {
683 if (cd->isLinkableInProject())
684 {
685 tagFile << " <concept>" << convertToXML(cd->name())
686 << "</concept>\n";
687 }
688 }
689 }
690 break;
691 case LayoutDocEntry::GroupModules:
692 {
693 for (const auto &mod : m_modules)
694 {
695 if (mod->isLinkableInProject())
696 {
697 tagFile << " <module>" << convertToXML(mod->name())
698 << "</module>\n";
699 }
700 }
701 }
702 break;
703 case LayoutDocEntry::GroupNamespaces:
704 {
705 for (const auto &nd : m_namespaces)
706 {
707 if (nd->isLinkableInProject())
708 {
709 tagFile << " <namespace>" << convertToXML(nd->name())
710 << "</namespace>\n";
711 }
712 }
713 }
714 break;
715 case LayoutDocEntry::GroupFiles:
716 {
717 for (const auto &fd : m_fileList)
718 {
719 if (fd->isLinkableInProject())
720 {
721 tagFile << " <file path=\""
722 << convertToXML(stripFromPath(fd->getPath())) << "\">"
723 << convertToXML(fd->name()) << "</file>\n";
724 }
725 }
726 }
727 break;
728 case LayoutDocEntry::GroupPageDocs:
729 {
730 for (const auto &pd : m_pages)
731 {
732 DString pageName = pd->getOutputFileBase();
733 if (pd->isLinkableInProject())
734 {
735 tagFile << " <page>" << convertToXML(pageName) << "</page>\n";
736 }
737 }
738 }
739 break;
740 case LayoutDocEntry::GroupDirs:
741 {
742 for (const auto &dd : m_dirList)
743 {
744 if (dd->isLinkableInProject())
745 {
746 tagFile << " <dir>" << convertToXML(dd->displayName()) << "</dir>\n";
747 }
748 }
749 }
750 break;
751 case LayoutDocEntry::GroupNestedGroups:
752 {
753 for (const auto &gd : m_groups)
754 {
755 if (gd->isVisible())
756 {
757 tagFile << " <subgroup>" << convertToXML(gd->name()) << "</subgroup>\n";
758 }
759 }
760 }
761 break;
762 case LayoutDocEntry::MemberDecl:
763 {
764 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
765 if (lmd)
766 {
767 MemberList * ml = getMemberList(lmd->type);
768 if (ml)
769 {
770 ml->writeTagFile(tagFile,true);
771 }
772 }
773 }
774 break;
775 case LayoutDocEntry::MemberGroups:
776 {
777 for (const auto &mg : m_memberGroups)
778 {
779 mg->writeTagFile(tagFile,true);
780 }
781 }
782 break;
783 default:
784 break;
785 }
786 }
788 tagFile << " </compound>\n";
789}
790
792{
794 {
796 if (m_pages.size()!=numDocMembers()) // not only pages -> classical layout
797 {
800 ol.writeRuler();
804 ol.writeAnchor(DString(),"details");
806 }
807 else
808 {
809 ol.disableAllBut(OutputType::Man); // always print title for man page
810 }
811 ol.startGroupHeader("details");
812 ol.parseText(title);
813 ol.endGroupHeader();
815
816 // repeat brief description
817 ol.startTextBlock();
818 if (!briefDescription().empty() && Config_getBool(REPEAT_BRIEF))
819 {
821 briefLine(),
822 this,
823 nullptr,
825 DocOptions());
826 }
827 // write separator between brief and details
828 if (!briefDescription().empty() && Config_getBool(REPEAT_BRIEF) &&
829 !documentation().empty())
830 {
834 ol.enableAll();
837 ol.writeString("\n\n");
839 }
840
841 // write detailed documentation
842 if (!documentation().empty())
843 {
844 ol.generateDoc(docFile(),
845 docLine(),
846 this,
847 nullptr,
848 documentation()+"\n",
849 DocOptions()
850 .setIndexWords(true));
851 }
852
853 // write inbody documentation
854 if (!inbodyDocumentation().empty())
855 {
857 inbodyLine(),
858 this,
859 nullptr,
860 inbodyDocumentation()+"\n",
861 DocOptions()
862 .setIndexWords(true));
863 }
865 ol.endTextBlock();
866 }
867}
868
870{
872 {
873 auto parser { createDocParser() };
874 auto ast { validatingParseDoc(*parser.get(),
875 briefFile(),
876 briefLine(),
877 this,
878 nullptr,
880 DocOptions()
881 .setIndexWords(true)
882 .setSingleLine(true))
883 };
884 if (!ast->empty())
885 {
886 ol.startParagraph();
889 ol.writeString(" - ");
891 ol.writeDoc(ast.get(),this,nullptr);
894 ol.writeString(" \n");
896
897 if (hasDetailedDescription() && m_pages.size()!=numDocMembers()) // group with non-page members
898 {
900 ol.startTextLink(DString(),"details");
902 ol.endTextLink();
903 }
905 ol.endParagraph();
906 }
907 }
908 ol.writeSynopsis();
909}
910
912{
913 if (Config_getBool(HAVE_DOT) && m_hasGroupGraph /*&& Config_getBool(GROUP_GRAPHS)*/)
914 {
915 DotGroupCollaboration graph(this);
916 if (graph.isTooBig())
917 {
918 warn_uncond("Group dependency graph for '{}' not generated, too many nodes ({}), threshold is {}. Consider increasing DOT_GRAPH_MAX_NODES.\n",
919 name(), graph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
920 }
921 else if (!graph.isTrivial())
922 {
923 msg("Generating dependency graph for group {}\n",qualifiedName());
926 //ol.startParagraph();
929 ol.endGroupCollaboration(graph);
930 //ol.endParagraph();
932 }
933 }
934}
935
937{
938 // write list of files
939 if (!m_fileList.empty())
940 {
941 ol.startMemberHeader("files");
942 ol.parseText(title);
943 ol.endMemberHeader();
944 ol.startMemberList();
945 for (const auto &fd : m_fileList)
946 {
947 if (!fd->hasDocumentation()) continue;
949 DString anc = fd->anchor();
950 if (anc.empty()) anc=fd->docName(); else anc.prepend(fd->docName()+"_");
952 ol.docify(theTranslator->trFile(false,true)+" ");
954 ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),DString(),fd->docName());
956 if (!fd->briefDescription().empty() && Config_getBool(BRIEF_MEMBER_DESC))
957 {
958 ol.startMemberDescription(fd->getOutputFileBase());
960 briefLine(),
961 fd,
962 nullptr,
963 fd->briefDescription(),
964 DocOptions()
965 .setSingleLine(true));
967 }
969 }
970 ol.endMemberList();
971 }
972}
973
975{
976 // write list of namespaces
978}
979
981{
982 // write list of groups
983 int count=0;
984 for (const auto &gd : m_groups)
985 {
986 if (gd->isVisible()) count++;
987 }
988 if (count>0)
989 {
990 ol.startMemberHeader("groups");
991 ol.parseText(title);
992 ol.endMemberHeader();
993 ol.startMemberList();
994 for (const auto &gd : m_groups)
995 {
996 if (gd->isVisible())
997 {
998 if (!gd->hasDocumentation()) continue;
1000 DString anc = gd->anchor();
1001 if (anc.empty()) anc=gd->name(); else anc.prepend(gd->name()+"_");
1003 ol.insertMemberAlign();
1004 ol.writeObjectLink(gd->getReference(),gd->getOutputFileBase(),DString(),gd->groupTitleAsText());
1006 if (!gd->briefDescription().empty() && Config_getBool(BRIEF_MEMBER_DESC))
1007 {
1008 ol.startMemberDescription(gd->getOutputFileBase());
1010 briefLine(),
1011 gd,
1012 nullptr,
1013 gd->briefDescription(),
1014 DocOptions()
1015 .setSingleLine(true));
1017 }
1019 }
1020 }
1021 ol.endMemberList();
1022 }
1023}
1024
1026{
1027 // write list of directories
1028 if (!m_dirList.empty())
1029 {
1030 ol.startMemberHeader("dirs");
1031 ol.parseText(title);
1032 ol.endMemberHeader();
1033 ol.startMemberList();
1034 for(const auto &dd : m_dirList)
1035 {
1036 if (!dd->hasDocumentation()) continue;
1038 DString anc = dd->anchor();
1039 if (anc.empty()) anc=dd->shortName(); else anc.prepend(dd->shortName()+"_");
1041 ol.parseText(theTranslator->trDir(false,true));
1042 ol.insertMemberAlign();
1043 ol.writeObjectLink(dd->getReference(),dd->getOutputFileBase(),DString(),dd->shortName());
1045 if (!dd->briefDescription().empty() && Config_getBool(BRIEF_MEMBER_DESC))
1046 {
1047 ol.startMemberDescription(dd->getOutputFileBase());
1049 briefLine(),
1050 dd,
1051 nullptr,
1052 dd->briefDescription(),
1053 DocOptions()
1054 .setSingleLine(true));
1056 }
1058 }
1059
1060 ol.endMemberList();
1061 }
1062}
1063
1065{
1066 // write list of classes
1067 m_classes.writeDeclaration(ol,nullptr,title,false);
1068}
1069
1071{
1072 // write list of concepts
1073 m_concepts.writeDeclaration(ol,title,false);
1074}
1075
1077{
1078 // write list of modules
1079 m_modules.writeDeclaration(ol,title,false);
1080}
1081
1082
1087
1089{
1090 for (const auto *pd : m_pages)
1091 {
1092 if (!pd->isReference())
1093 {
1094 const SectionInfo *si=nullptr;
1095 if (pd->hasTitle() && !pd->name().empty() &&
1096 (si=SectionManager::instance().find(pd->name()))!=nullptr)
1097 {
1099 ol.docify(si->title());
1101 }
1102 ol.startTextBlock();
1103 ol.generateDoc(pd->docFile(),
1104 pd->docLine(),
1105 pd,
1106 nullptr,
1107 (pd->documentation()+pd->inbodyDocumentation()),
1108 DocOptions()
1109 .setIndexWords(true));
1110 ol.endTextBlock();
1111 }
1112 }
1113}
1114
1116{
1117 /* write user defined member groups */
1118 for (const auto &mg : m_memberGroups)
1119 {
1120 mg->writeDeclarations(ol,nullptr,nullptr,nullptr,this,nullptr);
1121 }
1122}
1123
1128
1133
1135{
1136 //printf("** GroupDefImpl::startMemberDocumentation()\n");
1137 if (Config_getBool(SEPARATE_MEMBER_PAGES))
1138 {
1139 ol.pushGeneratorState();
1142 }
1143}
1144
1146{
1147 //printf("** GroupDefImpl::endMemberDocumentation()\n");
1148 if (Config_getBool(SEPARATE_MEMBER_PAGES))
1149 {
1150 ol.popGeneratorState();
1152 }
1153}
1154
1156{
1157 // write Author section (Man only)
1158 ol.pushGeneratorState();
1160 ol.startGroupHeader();
1161 ol.parseText(theTranslator->trAuthor(true,true));
1162 ol.endGroupHeader();
1164 ol.popGeneratorState();
1165}
1166
1168{
1169 ol.pushGeneratorState();
1171 bool first=true;
1172 SrcLangExt lang = getLanguage();
1173 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Group))
1174 {
1175 if ((lde->kind()==LayoutDocEntry::GroupClasses && m_classes.declVisible()) ||
1176 (lde->kind()==LayoutDocEntry::GroupConcepts && m_concepts.declVisible()) ||
1177 (lde->kind()==LayoutDocEntry::GroupModules && m_modules.declVisible()) ||
1178 (lde->kind()==LayoutDocEntry::GroupNamespaces && m_namespaces.declVisible(false)) ||
1179 (lde->kind()==LayoutDocEntry::GroupFiles && !m_fileList.empty()) ||
1180 (lde->kind()==LayoutDocEntry::GroupNestedGroups && !m_groups.empty()) ||
1181 (lde->kind()==LayoutDocEntry::GroupDirs && !m_dirList.empty())
1182 )
1183 {
1184 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
1185 if (ls)
1186 {
1187 DString label = lde->kind()==LayoutDocEntry::GroupClasses ? "nested-classes" :
1188 lde->kind()==LayoutDocEntry::GroupConcepts ? "concepts" :
1189 lde->kind()==LayoutDocEntry::GroupModules ? "modules" :
1190 lde->kind()==LayoutDocEntry::GroupNamespaces ? "namespaces" :
1191 lde->kind()==LayoutDocEntry::GroupFiles ? "files" :
1192 lde->kind()==LayoutDocEntry::GroupNestedGroups ? "groups" :
1193 "dirs";
1194 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
1195 first=false;
1196 }
1197 }
1198 else if (lde->kind()==LayoutDocEntry::MemberDecl)
1199 {
1200 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
1201 if (lmd)
1202 {
1203 MemberList * ml = getMemberList(lmd->type);
1204 if (ml && ml->declVisible())
1205 {
1206 ol.writeSummaryLink(DString(),ml->listType().toLabel(),lmd->title(lang),first);
1207 first=false;
1208 }
1209 }
1210 }
1211 }
1212 if (!first)
1213 {
1214 ol.writeString(" </div>\n");
1215 }
1216 ol.popGeneratorState();
1217}
1218
1223
1225{
1226 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
1227 ol.pushGeneratorState();
1228
1229 // Find out how deep this group is nested. In case of multiple parents, use the first one.
1230 int hierarchyLevel = 0;
1231 const GroupDef *gd = this;
1232 while (!gd->partOfGroups().empty())
1233 {
1234 gd = gd->partOfGroups().front();
1235 ++hierarchyLevel;
1236 }
1237
1239 false /* additionalIndices*/, DString() /*altSidebarName*/, hierarchyLevel);
1240
1241 ol.startHeaderSection();
1242 bool writeOutlinePanel = generateTreeView && Config_getBool(PAGE_OUTLINE_PANEL);
1243 if (!writeOutlinePanel) writeSummaryLinks(ol);
1245 //1.{
1246 ol.pushGeneratorState();
1248 ol.generateDoc(docFile(),
1250 this,
1251 nullptr,
1252 m_title,
1253 DocOptions()
1254 .setIndexWords(true)
1255 .setSingleLine(true)
1256 .setAutolinkSupport(false));
1257 ol.popGeneratorState();
1258 //1.}
1259 addGroupListToTitle(ol,this);
1260 //2.{
1261 ol.pushGeneratorState();
1264 ol.popGeneratorState();
1265 //2.}
1266 //3.{
1267 ol.pushGeneratorState();
1270 if (!m_titleAsText.empty())
1271 {
1272 ol.writeString(" - ");
1274 }
1275 ol.popGeneratorState();
1276 //3.}
1277 ol.endHeaderSection();
1278 ol.startContents();
1279
1280 //---------------------------------------- start flexible part -------------------------------
1281
1282 SrcLangExt lang=getLanguage();
1283 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Group))
1284 {
1285 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
1286 switch (lde->kind())
1287 {
1288 case LayoutDocEntry::BriefDesc:
1290 break;
1291 case LayoutDocEntry::MemberDeclStart:
1293 break;
1294 case LayoutDocEntry::GroupClasses:
1295 if (ls) writeClasses(ol,ls->title(lang));
1296 break;
1297 case LayoutDocEntry::GroupConcepts:
1298 if (ls) writeConcepts(ol,ls->title(lang));
1299 break;
1300 case LayoutDocEntry::GroupModules:
1301 if (ls) writeModules(ol,ls->title(lang));
1302 break;
1303 case LayoutDocEntry::GroupInlineClasses:
1305 break;
1306 case LayoutDocEntry::GroupNamespaces:
1307 if (ls) writeNamespaces(ol,ls->title(lang));
1308 break;
1309 case LayoutDocEntry::MemberGroups:
1311 break;
1312 case LayoutDocEntry::MemberDecl:
1313 {
1314 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
1315 if (lmd)
1316 {
1317 writeMemberDeclarations(ol,lmd->type,lmd->title(lang));
1318 }
1319 }
1320 break;
1321 case LayoutDocEntry::MemberDeclEnd:
1323 break;
1324 case LayoutDocEntry::DetailedDesc:
1325 if (ls) writeDetailedDescription(ol,ls->title(lang));
1326 break;
1327 case LayoutDocEntry::MemberDefStart:
1329 break;
1330 case LayoutDocEntry::MemberDef:
1331 {
1332 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
1333 if (lmd)
1334 {
1335 writeMemberDocumentation(ol,lmd->type,lmd->title(lang));
1336 }
1337 }
1338 break;
1339 case LayoutDocEntry::MemberDefEnd:
1341 break;
1342 case LayoutDocEntry::GroupNestedGroups:
1343 if (ls) writeNestedGroups(ol,ls->title(lang));
1344 break;
1345 case LayoutDocEntry::GroupPageDocs:
1347 break;
1348 case LayoutDocEntry::GroupDirs:
1349 if (ls) writeDirs(ol,ls->title(lang));
1350 break;
1351 case LayoutDocEntry::GroupFiles:
1352 if (ls) writeFiles(ol,ls->title(lang));
1353 break;
1354 case LayoutDocEntry::GroupGraph:
1355 writeGroupGraph(ol);
1356 break;
1357 case LayoutDocEntry::AuthorSection:
1359 break;
1360 case LayoutDocEntry::ClassIncludes:
1361 case LayoutDocEntry::ClassInheritanceGraph:
1362 case LayoutDocEntry::ClassNestedClasses:
1363 case LayoutDocEntry::ClassCollaborationGraph:
1364 case LayoutDocEntry::ClassAllMembersLink:
1365 case LayoutDocEntry::ClassUsedFiles:
1366 case LayoutDocEntry::ClassInlineClasses:
1367 case LayoutDocEntry::NamespaceNestedNamespaces:
1368 case LayoutDocEntry::NamespaceNestedConstantGroups:
1369 case LayoutDocEntry::NamespaceClasses:
1370 case LayoutDocEntry::NamespaceConcepts:
1371 case LayoutDocEntry::NamespaceInterfaces:
1372 case LayoutDocEntry::NamespaceStructs:
1373 case LayoutDocEntry::NamespaceExceptions:
1374 case LayoutDocEntry::NamespaceInlineClasses:
1375 case LayoutDocEntry::ConceptDefinition:
1376 case LayoutDocEntry::FileClasses:
1377 case LayoutDocEntry::FileConcepts:
1378 case LayoutDocEntry::FileInterfaces:
1379 case LayoutDocEntry::FileStructs:
1380 case LayoutDocEntry::FileExceptions:
1381 case LayoutDocEntry::FileNamespaces:
1382 case LayoutDocEntry::FileConstantGroups:
1383 case LayoutDocEntry::FileIncludes:
1384 case LayoutDocEntry::FileIncludeGraph:
1385 case LayoutDocEntry::FileIncludedByGraph:
1386 case LayoutDocEntry::FileSourceLink:
1387 case LayoutDocEntry::FileInlineClasses:
1388 case LayoutDocEntry::ModuleExports:
1389 case LayoutDocEntry::ModuleClasses:
1390 case LayoutDocEntry::ModuleConcepts:
1391 case LayoutDocEntry::ModuleUsedFiles:
1392 case LayoutDocEntry::DirSubDirs:
1393 case LayoutDocEntry::DirFiles:
1394 case LayoutDocEntry::DirGraph:
1395 err("Internal inconsistency: member '{}' should not be part of "
1396 "LayoutDocManager::Group entry list\n",lde->entryToString());
1397 break;
1398 }
1399 }
1400
1401 //---------------------------------------- end flexible part -------------------------------
1402
1403 for (auto &subgd : getSubGroups())
1404 {
1405 if (!subgd->isReference())
1406 {
1407 if (subgd->partOfGroups().front() == this)
1408 {
1409 ol.writePageLink(subgd->getOutputFileBase(), false);
1410 }
1411 else
1412 {
1413 // Could write a note explaining that the subgroup belongs to another
1414 // group and add a link here.
1415 }
1416 }
1417 }
1418 if (generateTreeView && Config_getBool(PAGE_OUTLINE_PANEL))
1419 {
1420 ol.pushGeneratorState();
1422 ol.endContents();
1423 ol.writeString("</div><!-- doc-content -->\n");
1425 ol.writeString("</div><!-- container -->\n");
1426 ol.popGeneratorState();
1427 endFile(ol,true,true);
1428 }
1429 else
1430 {
1431 endFile(ol);
1432 }
1433
1434 ol.popGeneratorState();
1435
1436 if (Config_getBool(SEPARATE_MEMBER_PAGES))
1437 {
1439 writeMemberPages(ol, hierarchyLevel + 1);
1440 }
1441}
1442
1443void GroupDefImpl::writeMemberPages(OutputList &ol, int hierarchyLevel)
1444{
1445 ol.pushGeneratorState();
1447
1448 for (const auto &ml : m_memberLists)
1449 {
1450 if (ml->listType().isDocumentation())
1451 {
1452 ml->writeDocumentationPage(ol,name(),this,hierarchyLevel);
1453 }
1454 }
1455
1456 ol.popGeneratorState();
1457}
1458
1460{
1461 bool createSubDirs=Config_getBool(CREATE_SUBDIRS);
1462
1463 ol.writeString(" <div class=\"navtab\">\n");
1464 ol.writeString(" <table>\n");
1465
1466 for (const auto *md : m_allMemberList)
1467 {
1468 if (md->getGroupDef()==this && md->isLinkable() && !md->isEnumValue())
1469 {
1470 if (md->isLinkableInProject())
1471 {
1472 DString fn = md->getOutputFileBase();
1474 if (md==currentMd) // selected item => highlight
1475 {
1476 ol.writeString(" <tr><td class=\"navtabHL\">");
1477 }
1478 else
1479 {
1480 ol.writeString(" <tr><td class=\"navtab\">");
1481 }
1482 ol.writeString("<span class=\"label\"><a ");
1483 ol.writeString("href=\"");
1484 if (createSubDirs) ol.writeString("../../");
1485 ol.writeString(fn+"#"+md->anchor());
1486 ol.writeString("\">");
1487 ol.writeString(convertToHtml(md->localName()));
1488 ol.writeString("</a></span>");
1489 ol.writeString("</td></tr>\n");
1490 }
1491 }
1492 }
1493 ol.writeString(" </table>\n");
1494 ol.writeString(" </div>\n");
1495}
1496
1497
1498
1499//---- helper functions ------------------------------------------------------
1500
1501void addClassToGroups(const Entry *root,ClassDef *cd)
1502{
1503 for (const Grouping &g : root->groups)
1504 {
1505 GroupDef *gd=nullptr;
1507 if (gd && gd->addClass(cd))
1508 {
1510 if (cdm)
1511 {
1512 cdm->makePartOfGroup(gd);
1513 }
1514 //printf("Compound %s: in group %s\n",qPrint(cd->name()),gd->groupTitle());
1515 }
1516 else if (!gd && g.pri == Grouping::GROUPING_INGROUP)
1517 {
1518 warn(root->fileName, root->startLine,
1519 "Found non-existing group '{}' for the command '{}', ignoring command",
1521 );
1522 }
1523 }
1524}
1525
1527{
1528 for (const Grouping &g : root->groups)
1529 {
1531 if (gd && gd->addConcept(cd))
1532 {
1534 if (cdm)
1535 {
1536 cdm->makePartOfGroup(gd);
1537 }
1538 //printf("Compound %s: in group %s\n",qPrint(cd->name()),gd->groupTitle());
1539 }
1540 else if (!gd && g.pri == Grouping::GROUPING_INGROUP)
1541 {
1542 warn(root->fileName, root->startLine,
1543 "Found non-existing group '{}' for the command '{}', ignoring command",
1545 );
1546 }
1547 }
1548}
1549
1550void addModuleToGroups(const Entry *root,ModuleDef *mod)
1551{
1552 for (const Grouping &g : root->groups)
1553 {
1555 if (gd && gd->addModule(mod))
1556 {
1557 mod->makePartOfGroup(gd);
1558 //printf("Module %s: in group %s\n",qPrint(mod->name()),gd->groupTitle());
1559 }
1560 else if (!gd && g.pri == Grouping::GROUPING_INGROUP)
1561 {
1562 warn(root->fileName, root->startLine,
1563 "Found non-existing group '{}' for the command '{}', ignoring command",
1565 );
1566 }
1567 }
1568}
1569
1570
1572{
1573 //printf("root->groups.size()=%zu\n",root->groups.size());
1574 for (const Grouping &g : root->groups)
1575 {
1576 GroupDef *gd=nullptr;
1578 //printf("group '%s' gd=%p\n",qPrint(g.groupname),(void*)gd);
1579 if (gd && gd->addNamespace(nd))
1580 {
1582 if (ndm)
1583 {
1584 ndm->makePartOfGroup(gd);
1585 }
1586 //printf("Namespace %s: in group %s\n",qPrint(nd->name()),qPrint(gd->name()));
1587 }
1588 else if (!gd && g.pri == Grouping::GROUPING_INGROUP)
1589 {
1590 warn(root->fileName, root->startLine,
1591 "Found non-existing group '{}' for the command '{}', ignoring command",
1593 );
1594 }
1595 }
1596}
1597
1598void addDirToGroups(const Entry *root,DirDef *dd)
1599{
1600 //printf("*** root->groups.size()=%d\n",root->groups.size());
1601 for (const Grouping &g : root->groups)
1602 {
1604 //printf("group '%s'\n",qPrint(g->groupname));
1605 if (gd)
1606 {
1607 gd->addDir(dd);
1608 dd->makePartOfGroup(gd);
1609 //printf("Dir %s: in group %s\n",qPrint(dd->name()),qPrint(g->groupname));
1610 }
1611 else if (!gd && g.pri == Grouping::GROUPING_INGROUP)
1612 {
1613 warn(root->fileName, root->startLine,
1614 "Found non-existing group '{}' for the command '{}', ignoring command",
1616 );
1617 }
1618 }
1619}
1620
1621void addGroupToGroups(const Entry *root,GroupDef *subGroup)
1622{
1623 //printf("addGroupToGroups for %s groups=%d\n",qPrint(root->name),root->groups.size());
1624 for (const Grouping &g : root->groups)
1625 {
1627 if (gd)
1628 {
1629 if (gd==subGroup)
1630 {
1631 warn(root->fileName,root->startLine,"Refusing to add group {} to itself",
1632 gd->name());
1633 }
1634 else if (subGroup->findGroup(gd))
1635 {
1636 warn(root->fileName,root->startLine,"Refusing to add group {} to group {}, since the latter is already a "
1637 "subgroup of the former", subGroup->name(),gd->name());
1638 }
1639 else if (!gd->findGroup(subGroup))
1640 {
1641 gd->addGroup(subGroup);
1642 subGroup->makePartOfGroup(gd);
1643 }
1644 }
1645 else if (!gd && g.pri == Grouping::GROUPING_INGROUP)
1646 {
1647 warn(root->fileName, root->startLine,
1648 "Found non-existing group '{}' for the command '{}', ignoring command",
1650 );
1651 }
1652 }
1653}
1654
1655/*! Add a member to the group with the highest priority */
1656void addMemberToGroups(const Entry *root,MemberDef *md)
1657{
1658 //printf("addMemberToGroups: Root %p = %s, md %p=%s groups=%zu\n",
1659 // root, qPrint(root->name), md, qPrint(md->name()), root->groups.size() );
1660
1661 // Search entry's group list for group with highest pri.
1663 GroupDef *fgd=nullptr;
1664 for (const Grouping &g : root->groups)
1665 {
1666 GroupDef *gd=nullptr;
1668 if (gd && g.pri >= pri)
1669 {
1670 if (fgd && gd!=fgd && g.pri==pri)
1671 {
1672 warn(root->fileName, root->startLine,
1673 "Member {} found in multiple {} groups! "
1674 "The member will be put in group {}, and not in group {}",
1675 md->name(), Grouping::getGroupPriName( pri ),
1676 gd->name(), fgd->name()
1677 );
1678 }
1679
1680 fgd = gd;
1681 pri = g.pri;
1682 }
1683 else if (!gd && g.pri == Grouping::GROUPING_INGROUP)
1684 {
1685 warn(root->fileName, root->startLine,
1686 "Found non-existing group '{}' for the command '{}', ignoring command",
1688 );
1689 }
1690 }
1691 //printf("fgd=%p\n",fgd);
1692
1693 // put member into group defined by this entry?
1694 if (fgd)
1695 {
1696 GroupDef *mgd = md->getGroupDef();
1697 //printf("mgd=%p\n",mgd);
1698 bool insertit = false;
1699 if (mgd==nullptr)
1700 {
1701 insertit = true;
1702 }
1703 else if (mgd!=fgd)
1704 {
1705 bool moveit = false;
1706
1707 // move member from one group to another if
1708 // - the new one has a higher priority
1709 // - the new entry has the same priority, but with docs where the old one had no docs
1710 if (md->getGroupPri()<pri)
1711 {
1712 moveit = true;
1713 }
1714 else
1715 {
1716 if (md->getGroupPri()==pri)
1717 {
1718 if (!root->doc.empty() && !md->getGroupHasDocs())
1719 {
1720 moveit = true;
1721 }
1722 else if (!root->doc.empty() && md->getGroupHasDocs())
1723 {
1725 "Member documentation for {} found several times in {} groups!\n"
1726 "{}:{}: The member will remain in group {}, and won't be put into group {}",
1727 md->name(), Grouping::getGroupPriName( pri ),
1728 root->fileName, root->startLine,
1729 mgd->name(), fgd->name()
1730 );
1731 }
1732 }
1733 }
1734
1735 if (moveit)
1736 {
1737 //printf("removeMember\n");
1738 mgd->removeMember(md);
1739 insertit = true;
1740 }
1741 }
1742
1743 if (insertit)
1744 {
1745 //printf("insertMember found at %s line %d: %s: related %s\n",
1746 // qPrint(md->getDefFileName()),md->getDefLine(),
1747 // qPrint(md->name()),qPrint(root->relates));
1748 bool success = fgd->insertMember(md);
1749 if (success)
1750 {
1752 if (mdm)
1753 {
1754 //printf("insertMember successful\n");
1755 mdm->setGroupDef(fgd,pri,root->fileName,root->startLine,!root->doc.empty());
1757 if (cdm)
1758 {
1759 cdm->setGroupDefForAllMembers(fgd,pri,root->fileName,root->startLine,root->doc.length() != 0);
1760 }
1761 if (mdm->isEnumerate() && mdm->getGroupDef() && md->isStrong())
1762 {
1763 for (const auto &emd : mdm->enumFieldList())
1764 {
1766 if (emdm && emdm->getGroupDef()==nullptr)
1767 {
1768 emdm->setGroupDef(mdm->getGroupDef(),mdm->getGroupPri(),
1769 mdm->getGroupFileName(),mdm->getGroupStartLine(),
1770 mdm->getGroupHasDocs());
1771 }
1772 }
1773 }
1774 }
1775 }
1776 }
1777 }
1778}
1779
1780
1781void addExampleToGroups(const Entry *root,PageDef *eg)
1782{
1783 for (const Grouping &g : root->groups)
1784 {
1786 if (gd)
1787 {
1788 gd->addExample(eg);
1789 eg->makePartOfGroup(gd);
1790 //printf("Example %s: in group %s\n",qPrint(eg->name()),s->data());
1791 }
1792 else if (!gd && g.pri == Grouping::GROUPING_INGROUP)
1793 {
1794 warn(root->fileName, root->startLine,
1795 "Found non-existing group '{}' for the command '{}', ignoring command",
1797 );
1798 }
1799 }
1800}
1801
1803{
1804 return m_fileName;
1805}
1806
1808{
1811 theTranslator->trGroup(true,true),
1813 DString(),
1814 nullptr
1815 );
1816 for (const auto &mg : m_memberGroups)
1817 {
1818 mg->addListReferences(this);
1819 }
1820 for (auto &ml : m_memberLists)
1821 {
1822 if (ml->listType().isDocumentation())
1823 {
1824 ml->addListReferences(this);
1825 }
1826 }
1827}
1828
1830{
1832 for (const auto &mg : m_memberGroups)
1833 {
1834 mg->addRequirementReferences(this);
1835 }
1836 for (auto &ml : m_memberLists)
1837 {
1838 if (ml->listType().isDocumentation())
1839 {
1840 ml->addRequirementReferences(this);
1841 }
1842 }
1843}
1844
1846{
1847 bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS);
1848 bool sortMemberDocs = Config_getBool(SORT_MEMBER_DOCS);
1849 const auto &ml = m_memberLists.get(lt,MemberListContainer::Group);
1850 ml->setNeedsSorting(
1851 (ml->listType().isDeclaration() && sortBriefDocs) ||
1852 (ml->listType().isDocumentation() && sortMemberDocs));
1853 ml->push_back(md);
1854}
1855
1856// performs a partial reordering to group elements together with the same scope
1857template<class Vec>
1858static void groupClassesWithSameScope(Vec &vec)
1859{
1860 bool done=false;
1861 while (!done) // for each iteration
1862 {
1863 done=true;
1864 for (size_t i=0; i<vec.size(); i++) // go through all items
1865 {
1866 std::string qni = vec[i]->name().str();
1867 size_t posi = qni.rfind("::");
1868 if (posi!=std::string::npos)
1869 {
1870 std::string scope = qni.substr(0,posi);
1871 auto it = std::find_if( vec.begin(), vec.end(),
1872 [&](typename Vec::Ptr &cd)
1873 { return cd->name().str()==scope; });
1874 if (it!=vec.end())
1875 {
1876 size_t idx = std::distance(vec.begin(),it);
1877 if (i<idx) // parent scope located after child scope
1878 {
1879 // to avoid reordering elements with the same parent
1880 // we skip to the last one with the same scope
1881 size_t k = idx;
1882 while (k<vec.size() && vec[k]->name().str().substr(0,posi)==scope)
1883 {
1884 idx = k;
1885 k++;
1886 }
1887 // swap the items such that i is inserted after idx
1888 for (size_t j=i; j<idx; j++)
1889 {
1890 std::swap(vec[j],vec[j+1]);
1891 }
1892 done=false;
1893 }
1894 else if (idx<i && vec[i-1]->name().str().substr(0,posi)!=scope)
1895 {
1896 // parent scope is found before the item, and the item
1897 // has some other item with a different scope in front of it
1898 // move idx to the end of range with the same scope
1899 while (idx<i && vec[idx]->name().str().substr(0,posi)==scope)
1900 {
1901 idx++;
1902 }
1903 // swap the items such that i is just after idx
1904 for (size_t j=idx; j<i; j++)
1905 {
1906 std::swap(vec[j],vec[j+1]);
1907 }
1908 done=false;
1909 }
1910 }
1911 }
1912 }
1913 }
1914}
1915
1917{
1918 for (auto &ml : m_memberLists)
1919 {
1920 if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(false); }
1921 }
1922 if (Config_getBool(SORT_BRIEF_DOCS))
1923 {
1924 std::stable_sort(m_dirList.begin(), m_dirList.end(), compareDirDefs);
1925
1926 auto classComp = [](const ClassLinkedRefMap::Ptr &c1,const ClassLinkedRefMap::Ptr &c2)
1927 {
1928 return Config_getBool(SORT_BY_SCOPE_NAME) ?
1929 dstricmp_sort(c1->name(), c2->name())<0 :
1930 dstricmp_sort(c1->className(), c2->className())<0;
1931 };
1932 std::stable_sort(m_classes.begin(), m_classes.end(), classComp);
1933
1934 auto namespaceComp = [](const NamespaceLinkedRefMap::Ptr &n1,const NamespaceLinkedRefMap::Ptr &n2)
1935 {
1936 return dstricmp_sort(n1->name(),n2->name())<0;
1937 };
1938
1939 std::stable_sort(m_namespaces.begin(),m_namespaces.end(),namespaceComp);
1940
1941 auto moduleComp = [](const ModuleLinkedRefMap::Ptr &m1,const ModuleLinkedRefMap::Ptr &m2)
1942 {
1943 return dstricmp_sort(m1->name(),m2->name())<0;
1944 };
1945
1946 std::stable_sort(m_modules.begin(), m_modules.end(), moduleComp);
1947
1948 auto conceptComp = [](const ConceptLinkedRefMap::Ptr &c1,const ConceptLinkedRefMap::Ptr &c2)
1949 {
1950 return dstricmp_sort(c1->name(),c2->name())<0;
1951 };
1952
1953 std::stable_sort(m_concepts.begin(), m_concepts.end(), conceptComp);
1954
1955 std::stable_sort(m_dirList.begin(), m_dirList.end(), compareDirDefs);
1956 std::stable_sort(m_fileList.begin(), m_fileList.end(), compareFileDefs);
1957
1958 }
1959 else
1960 {
1963 }
1964}
1965
1967{
1968 for (auto &ml : m_memberLists)
1969 {
1970 if (ml->listType()==lt)
1971 {
1972 return ml.get();
1973 }
1974 }
1975 return nullptr;
1976}
1977
1979{
1980 bool optimizeVhdl = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
1981
1982 MemberList * ml = getMemberList(lt);
1983 if (optimizeVhdl && ml)
1984 {
1985 VhdlDocGen::writeVhdlDeclarations(ml,ol,this,nullptr,nullptr,nullptr,nullptr);
1986 return;
1987 }
1988 if (ml)
1989 {
1990 ml->writeDeclarations(ol,nullptr,nullptr,nullptr,this,nullptr,title,DString());
1991 }
1992}
1993
1995{
1996 MemberList * ml = getMemberList(lt);
1997 if (ml) ml->writeDocumentation(ol,name(),this,title,ml->listType().toLabel());
1998}
1999
2001{
2002 MemberList *ml = getMemberList(lt);
2003 if (ml) ml->remove(md);
2004}
2005
2007{
2008 std::stable_sort(m_groups.begin(),
2009 m_groups.end(),
2010 [](const auto &g1,const auto &g2)
2011 { return g1->groupTitle() < g2->groupTitle(); });
2012}
2013
2014static bool hasNonReferenceNestedGroupRec(const GroupDef *gd,int level)
2015{
2016 if (level>30)
2017 {
2018 err("Possible recursive group relation while inside {}\n",gd->name());
2019 return false;
2020 }
2021 bool found=gd->isLinkableInProject();
2022 if (found)
2023 {
2024 return true;
2025 }
2026 else
2027 {
2028 for (const auto &igd : gd->getSubGroups())
2029 {
2030 found = found || hasNonReferenceNestedGroupRec(igd,level+1);
2031 if (found) break;
2032 }
2033 }
2034 return found;
2035}
2036
2038{
2039 bool allExternals = Config_getBool(EXTERNAL_GROUPS);
2040 return (allExternals || hasNonReferenceNestedGroupRec(this,0)) && isLinkable();
2041}
2042
2044{
2045 return !isReference() && isLinkable();
2046}
2047
2049{
2050 return hasUserDocumentation();
2051}
2052
2053// let the "programming language" for a group depend on what is inserted into it.
2054// First item that has an associated languages determines the language for the whole group.
2056{
2057 if (getLanguage()==SrcLangExt::Unknown && d->getLanguage()!=SrcLangExt::Unknown)
2058 {
2060 }
2061}
2062
2064{
2065 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
2066 return ((!briefDescription().empty() && repeatBrief) ||
2067 !documentation().empty() ||
2068 !inbodyDocumentation().empty() ||
2070}
2071
2073{
2075}
2076
2078{
2079 return m_hasGroupGraph;
2080}
2081
2082// --- Cast functions
2083
2085{
2086 if (d==nullptr) return nullptr;
2087 if (d && typeid(*d)==typeid(GroupDefImpl))
2088 {
2089 return static_cast<GroupDef*>(d);
2090 }
2091 else
2092 {
2093 return nullptr;
2094 }
2095}
2096
2098{
2099 if (d==nullptr) return nullptr;
2100 if (d && typeid(*d)==typeid(GroupDefImpl))
2101 {
2102 return static_cast<const GroupDef*>(d);
2103 }
2104 else
2105 {
2106 return nullptr;
2107 }
2108}
2109
2110
This class represents an function or template argument list.
Definition arguments.h:66
size_t size() const
Definition arguments.h:101
A abstract class representing of a compound symbol.
Definition classdef.h:100
virtual DString className() const =0
Returns the name of the class including outer classes, but not including namespaces.
virtual void setGroupDefForAllMembers(GroupDef *g, Grouping::GroupPri_t pri, const DString &fileName, int startLine, bool hasDocs)=0
bool declVisible(const ClassDef::CompoundType *filter=nullptr) const
Definition classlist.cpp:27
void writeDocumentation(OutputList &ol, const Definition *container=nullptr) const
Definition classlist.cpp:72
void writeDeclaration(OutputList &ol, const ClassDef::CompoundType *filter, const DString &header, bool localNames) const
Definition classlist.cpp:51
bool declVisible() const
void writeDeclaration(OutputList &ol, const DString &header, bool localNames) const
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
Definition dstring.h:84
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
Definition dstring.h:148
DString & prepend(const char *s)
Definition dstring.h:515
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition dstring.h:151
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 DefType definitionType() const =0
virtual const DString & name() const =0
virtual bool isLinkableInProject() const =0
virtual bool isHidden() const =0
virtual const GroupList & partOfGroups() const =0
virtual Definition * getOuterScope() const =0
bool isReference() const override
DString docFile() const override
bool hasUserDocumentation() const override
DString qualifiedName() const override
bool hasBriefDescription() const override
DString briefFile() const override
bool hasRequirementRefs() const override
DString briefDescription(bool abbreviate=false) const override
const DString & name() const override
void setLanguage(SrcLangExt lang) override
DString inbodyFile() const override
void writeRequirementRefs(OutputList &ol) const override
const RefItemVector & xrefListItems() const override
DString documentation() const override
const GroupList & partOfGroups() const override
DefinitionMixin(const DString &defFileName, int defLine, size_t defColumn, const DString &name, const char *b=nullptr, const char *d=nullptr, bool isSymbol=true)
DString inbodyDocumentation() const override
int getStartBodyLine() const override
int docLine() const override
int inbodyLine() const override
int briefLine() const override
void writeDocAnchorsToTagFile(TextStream &fs) const override
SrcLangExt getLanguage() const override
virtual void makePartOfGroup(GroupDef *gd)=0
A model of a directory symbol.
Definition dirdef.h:108
A list of directories.
Definition dirdef.h:178
Representation of a group collaboration graph.
static bool suppressDocWarnings
Definition doxygen.h:123
static GroupLinkedMap * groupLinkedMap
Definition doxygen.h:107
Represents an unstructured piece of information, about an entity found in the sources.
Definition entry.h:115
DString fileName
file this entry was extracted from
Definition entry.h:223
DString doc
documentation block (partly parsed)
Definition entry.h:200
std::vector< Grouping > groups
list of groups this entry belongs to
Definition entry.h:221
int startLine
start line of entry in the source
Definition entry.h:224
A model of a file symbol.
Definition filedef.h:97
A model of a group of symbols.
Definition groupdef.h:48
virtual void addDir(DirDef *dd)=0
virtual void addExample(PageDef *def)=0
virtual const GroupList & getSubGroups() const =0
virtual bool addClass(ClassDef *def)=0
virtual bool addModule(ModuleDef *def)=0
virtual void removeMember(MemberDef *md)=0
virtual bool insertMember(MemberDef *def, bool docOnly=false)=0
virtual bool addNamespace(NamespaceDef *def)=0
virtual void addGroup(GroupDef *def)=0
virtual bool findGroup(const GroupDef *def) const =0
virtual bool addConcept(ConceptDef *def)=0
void writeConcepts(OutputList &ol, const DString &title)
ConceptLinkedRefMap m_concepts
Definition groupdef.cpp:163
FileList m_fileList
Definition groupdef.cpp:161
const ModuleLinkedRefMap & getModules() const override
Definition groupdef.cpp:117
void endMemberDeclarations(OutputList &ol)
void startMemberDocumentation(OutputList &ol)
void setGroupScope(Definition *d) override
Definition groupdef.cpp:105
bool isLinkable() const override
bool addNamespace(NamespaceDef *def) override
Definition groupdef.cpp:320
Definition * getGroupScope() const override
Definition groupdef.cpp:106
bool hasGroupTitle() const override
Definition groupdef.cpp:70
void removeMemberFromList(MemberListType lt, MemberDef *md)
bool hasGroupGraph() const override
void writeSummaryLinks(OutputList &ol) const override
void startMemberDeclarations(OutputList &ol)
bool findGroup(const GroupDef *def) const override
Definition groupdef.cpp:593
~GroupDefImpl() override
Definition groupdef.cpp:209
void sortMemberLists() override
DString m_title
Definition groupdef.cpp:157
NamespaceLinkedRefMap m_namespaces
Definition groupdef.cpp:165
void writeInlineClasses(OutputList &ol)
CodeSymbolType codeSymbolType() const override
Definition groupdef.cpp:63
const MemberGroupList & getMemberGroups() const override
Definition groupdef.cpp:112
void removeMember(MemberDef *md) override
Definition groupdef.cpp:519
void addPage(PageDef *def) override
Definition groupdef.cpp:339
MemberList * getMemberList(MemberListType lt) const override
bool isASubGroup() const override
Definition groupdef.cpp:618
bool subGrouping() const override
Definition groupdef.cpp:103
ModuleLinkedRefMap m_modules
Definition groupdef.cpp:164
DString getOutputFileBase() const override
DString displayName(bool=true) const override
Definition groupdef.cpp:66
void addGroup(GroupDef *def) override
Definition groupdef.cpp:609
void addDir(DirDef *dd) override
Definition groupdef.cpp:333
MemberGroupList m_memberGroups
Definition groupdef.cpp:174
bool addModule(ModuleDef *def) override
Definition groupdef.cpp:308
void addMembersToMemberGroup() override
Definition groupdef.cpp:354
PageLinkedRefMap m_examples
Definition groupdef.cpp:168
DString groupTitle() const override
Definition groupdef.cpp:67
void writeTagFile(TextStream &) override
Definition groupdef.cpp:655
MemberList m_allMemberList
Definition groupdef.cpp:170
void writeGroupGraph(OutputList &ol)
Definition groupdef.cpp:911
bool isVisibleInHierarchy() const override
DString m_titleAsText
Definition groupdef.cpp:158
void writeAuthorSection(OutputList &ol)
void endMemberDocumentation(OutputList &ol)
void writeNamespaces(OutputList &ol, const DString &title)
Definition groupdef.cpp:974
void writeMemberDeclarations(OutputList &ol, MemberListType lt, const DString &title)
DirList m_dirList
Definition groupdef.cpp:169
void writeModules(OutputList &ol, const DString &title)
void writeClasses(OutputList &ol, const DString &title)
void sortSubGroups() override
bool m_subGrouping
Definition groupdef.cpp:175
GroupDefImpl(const DString &fileName, int line, const DString &name, const DString &title, const DString &refFileName=DString())
Definition groupdef.cpp:189
bool addClass(ClassDef *def) override
Definition groupdef.cpp:283
GroupList m_groups
Definition groupdef.cpp:166
void updateLanguage(const Definition *)
void writeNestedGroups(OutputList &ol, const DString &title)
Definition groupdef.cpp:980
void findSectionsInDocumentation() override
Definition groupdef.cpp:244
const GroupList & getSubGroups() const override
Definition groupdef.cpp:119
DString m_fileName
Definition groupdef.cpp:160
const DirList & getDirs() const override
Definition groupdef.cpp:121
void addMemberListToGroup(MemberList *, bool(MemberDef::*)() const)
const PageLinkedRefMap & getExamples() const override
Definition groupdef.cpp:122
void addFile(FileDef *def) override
Definition groupdef.cpp:264
bool insertMember(MemberDef *def, bool docOnly=false) override
Definition groupdef.cpp:366
bool hasDetailedDescription() const override
void overrideGroupGraph(bool e) override
const FileList & getFiles() const override
Definition groupdef.cpp:114
void writePageDocumentation(OutputList &ol)
DString anchor() const override
Definition groupdef.cpp:65
void writeFiles(OutputList &ol, const DString &title)
Definition groupdef.cpp:936
const NamespaceLinkedRefMap & getNamespaces() const override
Definition groupdef.cpp:118
const PageLinkedRefMap & getPages() const override
Definition groupdef.cpp:120
void writeMemberGroups(OutputList &ol)
void writeDirs(OutputList &ol, const DString &title)
Definition * m_groupScope
Definition groupdef.cpp:172
ClassLinkedRefMap m_classes
Definition groupdef.cpp:162
void writeMemberPages(OutputList &ol, int hierarchyLevel) override
void setGroupTitleLocal(const DString &title)
Definition groupdef.cpp:213
const MemberLists & getMemberLists() const override
Definition groupdef.cpp:109
void setGroupTitle(const DString &newtitle) override
Definition groupdef.cpp:230
const ClassLinkedRefMap & getClasses() const override
Definition groupdef.cpp:115
void writePageNavigation(OutputList &ol) const override
bool m_hasGroupGraph
Definition groupdef.cpp:176
MemberNameInfoLinkedMap m_allMemberNameInfoLinkedMap
Definition groupdef.cpp:171
bool addConcept(ConceptDef *def) override
Definition groupdef.cpp:296
void writeDetailedDescription(OutputList &ol, const DString &title)
Definition groupdef.cpp:791
DefType definitionType() const override
Definition groupdef.cpp:62
void distributeMemberGroupDocumentation() override
Definition groupdef.cpp:236
void computeAnchors() override
Definition groupdef.cpp:649
void writeQuickMemberLinks(OutputList &ol, const MemberDef *currentMd) const override
void addRequirementReferences() override
void addListReferences() override
void writeMemberDocumentation(OutputList &ol, MemberListType lt, const DString &title)
bool containsFile(const FileDef *def) const override
Definition groupdef.cpp:278
PageLinkedRefMap m_pages
Definition groupdef.cpp:167
void countMembers() override
Definition groupdef.cpp:623
bool isLinkableInProject() const override
MemberLists m_memberLists
Definition groupdef.cpp:173
size_t numDocMembers() const override
Definition groupdef.cpp:637
void addMemberToList(MemberListType lt, MemberDef *md)
DString groupTitleAsText() const override
Definition groupdef.cpp:68
const ConceptLinkedRefMap & getConcepts() const override
Definition groupdef.cpp:116
void writeDocumentation(OutputList &ol) override
void writeBriefDescription(OutputList &ol)
Definition groupdef.cpp:869
void addExample(PageDef *def) override
Definition groupdef.cpp:347
static LayoutDocManager & instance()
Returns a reference to this singleton.
Definition layout.cpp:1437
bool del(const DString &key)
Definition linkedmap.h:183
T * add(const char *k, Args &&... args)
Definition linkedmap.h:90
const T * find(const std::string &key) const
Definition linkedmap.h:47
bool add(const char *k, T *obj)
Definition linkedmap.h:284
size_t size() const
Definition linkedmap.h:375
iterator end()
Definition linkedmap.h:367
const T * find(const std::string &key) const
Definition linkedmap.h:243
iterator begin()
Definition linkedmap.h:366
A model of a class/file/namespace member symbol.
Definition memberdef.h:45
virtual bool getGroupHasDocs() const =0
virtual const ClassDef * getClassDef() const =0
virtual const MemberDef * getGroupAlias() const =0
virtual const ArgumentList & templateArguments() const =0
virtual GroupDef * getGroupDef()=0
virtual const MemberVector & enumFieldList() const =0
virtual const FileDef * getFileDef() const =0
virtual const ArgumentList & argumentList() const =0
virtual int getGroupStartLine() const =0
virtual bool isFunction() const =0
virtual Grouping::GroupPri_t getGroupPri() const =0
virtual const ClassDef * getClassDefOfAnonymousType() const =0
virtual Protection protection() const =0
virtual bool isEnumerate() const =0
virtual MemberType memberType() const =0
virtual DString getGroupFileName() const =0
virtual bool isStrong() const =0
virtual DString typeString() const =0
virtual Specifier virtualness(int count=0) const =0
virtual DString memberTypeName() const =0
virtual void setGroupAlias(const MemberDef *md)=0
virtual void setGroupDef(GroupDef *gd, Grouping::GroupPri_t pri, const DString &fileName, int startLine, bool hasDocs, MemberDef *member=nullptr)=0
A list of MemberDef objects as shown in documentation sections.
Definition memberlist.h:126
void writeTagFile(TextStream &, bool useQualifiedName=false, bool showNamespaceMembers=true)
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 setAnchors()
bool declVisible() const
Wrapper class for the MemberListType type.
Definition types.h:346
constexpr const char * toLabel() const noexcept
Definition types.h:402
const std::unique_ptr< MemberList > & get(MemberListType lt, MemberListContainer con)
Definition memberlist.h:192
void push_back(Ptr &&p)
Definition membername.h:139
void remove(const MemberDef *md)
Definition memberlist.h:85
void sort()
Definition memberlist.h:77
size_type size() const noexcept
Definition memberlist.h:60
void push_back(const T &value)
Definition memberlist.h:49
bool declVisible() const
void writeDeclaration(OutputList &ol, const DString &header, bool localNames) const
An abstract interface of a namespace symbol.
void writeDeclaration(OutputList &ol, const DString &title, bool isConstantGroup=false, bool localName=false)
bool declVisible(bool isContantGroup) const
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 startTitleHead(const DString &fileName)
Definition outputlist.h:399
void startMemberDeclaration()
Definition outputlist.h:565
void parseText(const DString &textStr)
void endTitleHead(const DString &fileName, const DString &name)
Definition outputlist.h:401
void disable(OutputType o)
void startParagraph(const DString &classDef=DString())
Definition outputlist.h:403
void writePageLink(const DString &name, bool first)
Definition outputlist.h:385
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 endGroupCollaboration(DotGroupCollaboration &g)
Definition outputlist.h:662
void enable(OutputType o)
void endContents()
Definition outputlist.h:616
void endHeaderSection()
Definition outputlist.h:463
void endMemberDescription()
Definition outputlist.h:563
void endTextBlock(bool paraBreak=false)
Definition outputlist.h:668
void endMemberDeclaration(const DString &anchor, const DString &inheritId)
Definition outputlist.h:567
void startGroupCollaboration()
Definition outputlist.h:660
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 startHeaderSection()
Definition outputlist.h:461
void insertMemberAlign(bool templ=false)
Definition outputlist.h:513
void writeString(const DString &text)
Definition outputlist.h:407
void endSection(const DString &lab, SectionType t)
Definition outputlist.h:584
void endParagraph()
Definition outputlist.h:405
void startMemberSections()
Definition outputlist.h:457
void startMemberList()
Definition outputlist.h:477
void endTextLink()
Definition outputlist.h:440
void endMemberItem(OutputGenerator::MemberItemType type)
Definition outputlist.h:491
void endMemberList()
Definition outputlist.h:479
void writeSynopsis()
Definition outputlist.h:588
void pushGeneratorState()
void writeSummaryLink(const DString &file, const DString &anchor, const DString &title, bool first)
Definition outputlist.h:610
void disableAllBut(OutputType o)
void startTextBlock(bool dense=false)
Definition outputlist.h:666
void popGeneratorState()
void startTextLink(const DString &file, const DString &anchor)
Definition outputlist.h:438
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 startMemberDescription(const DString &anchor, const DString &inheritId=DString(), bool typ=false)
Definition outputlist.h:561
void writePageOutline()
Definition outputlist.h:612
void generateDoc(const DString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const DString &docStr, const DocOptions &options)
void startContents()
Definition outputlist.h:614
void startSection(const DString &lab, const DString &title, SectionType t)
Definition outputlist.h:582
void startGroupHeader(const DString &id=DString(), int extraLevels=0)
Definition outputlist.h:449
void enableAll()
void endMemberHeader()
Definition outputlist.h:467
void endMemberSections()
Definition outputlist.h:459
A model of a page symbol.
Definition pagedef.h:27
static RequirementManager & instance()
void addRequirementRefsForSymbol(const Definition *symbol)
class that provide information about a section.
Definition section.h:58
DString title() const
Definition section.h:70
DString label() const
Definition section.h:69
static SectionManager & instance()
returns a reference to the singleton
Definition section.h:179
static constexpr int Subsection
Definition section.h:34
Text streaming class that buffers data.
Definition textstream.h:36
virtual DString trGroup(bool first_capital, bool singular)=0
virtual DString trAuthor(bool first_capital, bool singular)=0
virtual DString trCollaborationDiagram(const DString &clName)=0
virtual DString trDir(bool first_capital, bool singular)=0
virtual DString trMore()=0
virtual DString trGeneratedAutomatically(const DString &s)=0
virtual DString trFile(bool first_capital, bool singular)=0
static void writeVhdlDeclarations(const MemberList *, OutputList &, const GroupDef *, const ClassDef *, const FileDef *, const NamespaceDef *, const ModuleDef *)
ClassDefMutable * toClassDefMutable(Definition *d)
ConceptDefMutable * toConceptDefMutable(Definition *d)
#define Config_getInt(name)
Definition config.h:34
#define Config_getBool(name)
Definition config.h:33
#define Config_getString(name)
Definition config.h:32
#define NON_COPYABLE(cls)
Macro to help implementing the rule of 5 for a non-copyable & movable class.
Definition construct.h:37
bool compareDirDefs(const DirDef *item1, const DirDef *item2)
Definition dirdef.cpp:1211
DString parseCommentAsText(const Definition *scope, const MemberDef *md, const DString &doc, const DString &fileName, int lineNr)
IDocParserPtr createDocParser()
factory function to create a parser
Definition docparser.cpp:59
void docFindSections(const DString &input, const Definition *d, const DString &fileName)
IDocNodeASTPtr validatingParseDoc(IDocParser &parserIntf, const DString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const DString &input, const DocOptions &options)
int dstricmp_sort(const char *str1, const char *str2)
Definition dstring.h:67
bool compareFileDefs(const FileDef *fd1, const FileDef *fd2)
Definition filedef.cpp:1966
void addNamespaceToGroups(const Entry *root, NamespaceDef *nd)
void addGroupToGroups(const Entry *root, GroupDef *subGroup)
void addClassToGroups(const Entry *root, ClassDef *cd)
void addDirToGroups(const Entry *root, DirDef *dd)
std::unique_ptr< GroupDef > createGroupDef(const DString &fileName, int line, const DString &name, const DString &title, const DString &refFileName)
Definition groupdef.cpp:180
static void groupClassesWithSameScope(Vec &vec)
void addModuleToGroups(const Entry *root, ModuleDef *mod)
GroupDef * toGroupDef(Definition *d)
void addConceptToGroups(const Entry *root, ConceptDef *cd)
static bool hasNonReferenceNestedGroupRec(const GroupDef *gd, int level)
void addExampleToGroups(const Entry *root, PageDef *eg)
void addMemberToGroups(const Entry *root, MemberDef *md)
void endFile(OutputList &ol, bool skipNavIndex, bool skipEndContents, const DString &navPath)
Definition index.cpp:431
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:405
Translator * theTranslator
Definition language.cpp:76
MemberDefMutable * toMemberDefMutable(Definition *d)
#define warn_uncond(fmt,...)
Definition message.h:122
#define warn(file, line, fmt,...)
Definition message.h:97
#define msg(fmt,...)
Definition message.h:94
#define err(fmt,...)
Definition message.h:127
NamespaceDefMutable * toNamespaceDefMutable(Definition *d)
void addRefItem(const RefItemVector &sli, const DString &key, const DString &prefix, const DString &name, const DString &title, const DString &args, const Definition *scope)
Definition reflist.h:136
Helper class to pass options when calling OutputList::generateDoc().
Definition docoptions.h:24
Grouping info.
Definition types.h:227
DString groupname
name of the group
Definition types.h:257
static constexpr const char * getGroupPriName(GroupPri_t priority) noexcept
Definition types.h:240
GroupPri_t
Grouping priority.
Definition types.h:230
@ GROUPING_LOWEST
Definition types.h:231
@ GROUPING_INGROUP
membership in group was defined by @ingroup
Definition types.h:236
GroupPri_t pri
priority of this definition
Definition types.h:258
Represents of a member declaration list with configurable title and subtitle.
Definition layout.h:111
MemberListType type
Definition layout.h:117
DString title(SrcLangExt lang) const
Definition layout.cpp:1788
Represents of a member definition list with configurable title.
Definition layout.h:131
MemberListType type
Definition layout.h:136
DString title(SrcLangExt lang) const
Definition layout.cpp:1800
Definition layout.h:101
DString title(SrcLangExt lang) const
Definition layout.cpp:1781
CodeSymbolType
Definition types.h:481
MemberListContainer
Definition types.h:472
SrcLangExt
Definition types.h:207
void addGroupListToTitle(OutputList &ol, const Definition *d)
Definition util.cpp:3921
void createSubDirs(const Dir &d)
Definition util.cpp:2969
DString convertToHtml(const DString &s, bool keepEntities)
Definition util.cpp:3291
bool matchArguments2(const Definition *srcScope, const FileDef *srcFileScope, const DString &srcReturnType, const ArgumentList *srcAl, const Definition *dstScope, const FileDef *dstFileScope, const DString &dstReturnType, const ArgumentList *dstAl, bool checkCV, SrcLangExt lang)
Definition util.cpp:1589
void addHtmlExtensionIfMissing(DString &fName)
Definition util.cpp:3931
DString convertToXML(const DString &s, bool keepEntities, const bool citeEntry)
Definition util.cpp:3232
DString stripFromPath(const DString &path)
Definition util.cpp:219
A bunch of utility functions.