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