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