Doxygen
Loading...
Searching...
No Matches
moduledef.cpp
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Copyright (C) 1997-2023 by Dimitri van Heesch.
4 *
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation under the terms of the GNU General Public License is hereby
7 * granted. No representations are made about the suitability of this software
8 * for any purpose. It is provided "as is" without express or implied warranty.
9 * See the GNU General Public License for more details.
10 *
11 * Documents produced by Doxygen are derivative works derived from the
12 * input used in their production; they are not affected by this license.
13 *
14 */
15
16#include "moduledef.h"
17#include "definitionimpl.h"
18#include "entry.h"
19#include "memberdef.h"
20#include "classlist.h"
21#include "namespacedef.h"
22#include "conceptdef.h"
23#include "config.h"
24#include "outputlist.h"
25#include "language.h"
26#include "util.h"
27#include "groupdef.h"
28#include "message.h"
29#include "membergroup.h"
30#include "classdef.h"
31#include "textstream.h"
32#include "trace.h"
33
34class ModuleDefImpl;
35
37{
38 HeaderInfo(const QCString &fn,const QCString &name,bool sys)
39 : fileName(fn), headerName(name), isSystem(sys) {}
40 QCString fileName; // file containing the import
41 QCString headerName; // name of the imported header
42 bool isSystem; // <...> => true, "..." => false
43};
44
45using HeaderInfoVector = std::vector<HeaderInfo>;
46
47
48class ModuleDefImpl : public DefinitionMixin<ModuleDef>
49{
50 public:
51 ModuleDefImpl(const QCString &fileName,int startLine,int startColom,
52 const QCString &name, Type type, const QCString &partitionName)
53 : DefinitionMixin<ModuleDef>(fileName,startLine,startColom,name,nullptr,nullptr,true),
55
56 // --- Definition
57 DefType definitionType() const override { return TypeModule; }
59 QCString displayName(bool=TRUE) const override { return name(); }
60 QCString getOutputFileBase() const override;
61 QCString anchor() const override { return ""; }
62 bool isLinkableInProject() const override { return isLinkable() && !isHidden() && !isReference(); }
63 bool isLinkable() const override { return hasDocumentation(); }
64 QCString qualifiedName() const override;
65 void writeSummaryLinks(OutputList &ol) const override;
66
67 // --- ModuleDef
68 Type moduleType() const override { return m_type; }
69 QCString partitionName() const override { return m_partitionName; }
70 void writeDocumentation(OutputList &ol) override;
71 bool isPrimaryInterface() const override { return m_type==Type::Interface && m_partitionName.isEmpty(); }
72 MemberList *getMemberList(MemberListType lt) const override;
73 const MemberLists &getMemberLists() const override { return m_memberLists; }
74 const MemberGroupList &getMemberGroups() const override { return m_memberGroups; }
75 const ClassLinkedRefMap &getClasses() const override { return m_classes; }
76 const ConceptLinkedRefMap &getConcepts() const override { return m_concepts; }
77 int countVisibleMembers() const override;
78 FileDef *getFileDef() const override { return m_fileDef; }
79 const ImportInfoMap &getImports() const override { return m_imports; }
80 const ImportInfoMap &getExports() const override { return m_exportedModules; }
81 const ModuleMap &partitions() const override { return m_partitions; }
82 void writeTagFile(TextStream &t) const override;
83 FileList getUsedFiles() const override;
84
85 void writeExports(OutputList &ol,const QCString &title);
86 void writeClassDeclarations(OutputList &ol,const QCString &title);
87 void writeConcepts(OutputList &ol,const QCString &title);
88 void writeFiles(OutputList &ol,const QCString &title);
89 void startMemberDeclarations(OutputList &ol);
90 void endMemberDeclarations(OutputList &ol);
91 void startMemberDocumentation(OutputList &ol);
92 void endMemberDocumentation(OutputList &ol);
93 void writeDetailedDescription(OutputList &ol,const QCString &title);
94 void writeBriefDescription(OutputList &ol);
95 void writeMemberGroups(OutputList &ol);
96 void writeMemberDeclarations(OutputList &ol,MemberListType lt,const QCString &title);
97 void writeMemberDocumentation(OutputList &ol,MemberListType lt,const QCString &title);
98 void writeAuthorSection(OutputList &ol);
99 void writeDeclarationLink(OutputList &ol,bool &found,const QCString &header,bool localNames) const;
100
101 void addHeader(int line,const QCString &headerName,bool isSystem);
102 void addImport(int line,const QCString &moduleName,const QCString &partitionName,bool isExported);
103 void addClassToModule(const Entry *root,ClassDef *cd);
104 void addConceptToModule(const Entry *root,ConceptDef *cd);
105 void addMemberToModule(const Entry *root,MemberDef *md);
106 void addPartition(ModuleDefImpl *mod);
108 void setPrimaryInterface(const ModuleDef *mod);
109 void setFileDef(FileDef *fd);
110 void addMemberToList(MemberListType lt,MemberDef *md);
111 void addExportedModule(const QCString &moduleName,const ImportInfo &info);
112 void addListReferences();
116 void sortMemberLists();
117
118 //ModuleMap &partitions() { return m_partitions; }
119 void mergeSymbolsFrom(ModuleDefImpl *other);
120 bool hasDetailedDescription() const;
121 void countMembers();
122
123 private:
128 ClassLinkedRefMap m_classes;
129 ConceptLinkedRefMap m_concepts;
130 MemberLists m_memberLists;
132 ModuleList m_contributing;
133 MemberGroupList m_memberGroups;
134 const ModuleDef *m_primaryInterface = nullptr;
135 FileDef *m_fileDef = nullptr; // file holding this module
136};
137
139{
140 return convertNameToFile("module_" + name());
141}
142
144{
145 QCString result=name();
146 if (!m_partitionName.isEmpty())
147 {
148 result+=":"+m_partitionName;
149 }
150 return result;
151}
152
154{
155 std::string qName = mod->qualifiedName().str();
156 if (m_partitions.find(qName)==m_partitions.end())
157 {
158 m_partitions.emplace(qName,mod);
159 }
160}
161
163{
164 if (std::find(m_contributing.begin(),m_contributing.end(),mod)==m_contributing.end())
165 {
166 m_contributing.push_back(mod);
167 }
168}
169
174
176{
177 m_fileDef = fd;
178}
179
180void ModuleDefImpl::addHeader(int line,const QCString &headerName,bool isSystem)
181{
182 AUTO_TRACE("name={}:line={},header={},isSystem={}",name(),line,headerName,isSystem);
183}
184
185void ModuleDefImpl::addImport(int line,const QCString &moduleName,const QCString &partitionName,bool isExported)
186{
187 AUTO_TRACE("name={}:line={},module={},partition={}",name(),line,moduleName,partitionName);
188 m_imports.emplace(getDefFileName().str()+":"+std::to_string(line),ImportInfo(this,moduleName,line,partitionName,isExported));
189}
190
191void ModuleDefImpl::addExportedModule(const QCString &moduleName,const ImportInfo &info)
192{
193 AUTO_TRACE("name={}:moduleName={},import={}",name(),moduleName,info.importName);
194 m_exportedModules.emplace(moduleName.str(),info);
195}
196
198{
199 QCString className = cd->qualifiedName();
200 AUTO_TRACE("{}:{} class {} of module {} exported={}",
201 root->fileName,root->startLine, className, name(), root->exported);
202 bool isExported = m_classes.find(className)!=nullptr;
203 if (root->exported && !isExported)
204 {
205 m_classes.add(className,cd);
206 }
207 auto cdm = toClassDefMutable(cd);
208 if (cdm && root->exported && !cd->isExported())
209 {
210 cdm->setExported(true);
211 }
212}
213
215{
216 QCString conceptName = cd->qualifiedName();
217 AUTO_TRACE("{}:{} concept {} of module {} exported={}",
218 root->fileName,root->startLine,
219 cd->qualifiedName(),name(),
220 root->exported);
221 bool isExported = m_classes.find(conceptName)!=nullptr;
222 if (root->exported && !isExported)
223 {
224 m_concepts.add(conceptName,cd);
225 }
226 auto cdm = toConceptDefMutable(cd);
227 if (cdm && root->exported && !cd->isExported())
228 {
229 cdm->setExported(true);
230 }
231}
232
234{
235 for (auto &ml : m_memberLists)
236 {
237 if (ml->listType()==lt)
238 {
239 return ml.get();
240 }
241 }
242 return nullptr;
243}
244
246{
247 bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS);
248 bool sortMemberDocs = Config_getBool(SORT_MEMBER_DOCS);
250 ml->setNeedsSorting(
251 (ml->listType().isDeclaration() && sortBriefDocs) ||
252 (ml->listType().isDocumentation() && sortMemberDocs));
253 ml->push_back(md);
254 if (ml->listType().isDeclaration())
255 {
256 MemberDefMutable *mdm = toMemberDefMutable(md);
257 if (mdm)
258 {
259 mdm->setSectionList(this,ml.get());
260 }
261 }
262}
263
265{
266 AUTO_TRACE("{}:{} member {} of module {} exported={}",
267 qPrint(root->fileName),root->startLine,
269 root->exported);
270 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
271 if (allMemberList==nullptr)
272 {
273 m_memberLists.emplace_back(std::make_unique<MemberList>(MemberListType::AllMembersList(),MemberListContainer::Module));
274 allMemberList = m_memberLists.back().get();
275 }
276 if (allMemberList->contains(md))
277 {
278 return;
279 }
280 allMemberList->push_back(md);
281 switch (md->memberType())
282 {
284 addMemberToList(MemberListType::DecVarMembers(),md);
285 break;
287 addMemberToList(MemberListType::DecFuncMembers(),md);
288 break;
290 addMemberToList(MemberListType::DecTypedefMembers(),md);
291 break;
293 addMemberToList(MemberListType::DecEnumMembers(),md);
294 break;
295 default:
296 break;
297 }
298 auto mdm = toMemberDefMutable(md);
299 if (mdm && root->exported && !md->isExported())
300 {
301 mdm->setExported(true);
302 }
303}
304
306{
307 AUTO_TRACE("{} merging symbols of {} ({}:{})",
308 name(),other->qualifiedName(),other->getDefFileName(),other->getDefLine());
309 for (const auto &cd : other->getClasses())
310 {
311 m_classes.add(cd->qualifiedName(),cd);
312 }
313 for (const auto &cd : other->getConcepts())
314 {
315 m_concepts.add(cd->qualifiedName(),cd);
316 }
317 auto mergeMemberList = [this,other](MemberListType lt)
318 {
319 const auto srcMl = other->getMemberList(lt);
320 if (srcMl)
321 {
322 auto &dstMl = m_memberLists.get(lt,srcMl->container());
323 for (const auto &md : *srcMl)
324 {
325 dstMl->push_back(md);
326 }
327 }
328 };
329 mergeMemberList(MemberListType::DecVarMembers());
330 mergeMemberList(MemberListType::DecFuncMembers());
331 mergeMemberList(MemberListType::DecTypedefMembers());
332 mergeMemberList(MemberListType::DecEnumMembers());
333}
334
336{
337 if (isReference()) return;
339 AUTO_TRACE("%s file=%s",name(),getDefFileName());
340 SrcLangExt lang = getLanguage();
341 QCString pageTitle = theTranslator->trModuleReference(displayName());
342 startFile(ol,getOutputFileBase(),name(),pageTitle,HighlightedItem::ModuleVisible,false,QCString(),0);
343
344 // ---- title part
348
351 ol.parseText(pageTitle);
353
354 addGroupListToTitle(ol,this);
355
358 ol.endTitleHead(getOutputFileBase(),pageTitle);
360
364 ol.writeString(" - ");
365 ol.parseText(pageTitle);
367
368 ol.endHeaderSection();
369 ol.startContents();
370
371 //---------------------------------------- start flexible part -------------------------------
372 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Module))
373 {
374 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
375 switch (lde->kind())
376 {
377 case LayoutDocEntry::BriefDesc:
379 break;
380 case LayoutDocEntry::MemberDeclStart:
382 break;
383 case LayoutDocEntry::ModuleClasses:
384 if (ls) writeClassDeclarations(ol,ls->title(lang));
385 break;
386 case LayoutDocEntry::ModuleConcepts:
387 if (ls) writeConcepts(ol,ls->title(lang));
388 break;
389 case LayoutDocEntry::ModuleExports:
390 if (ls) writeExports(ol,ls->title(lang));
391 break;
392 case LayoutDocEntry::ModuleUsedFiles:
393 if (ls) writeFiles(ol,ls->title(lang));
394 break;
395 case LayoutDocEntry::MemberGroups:
397 break;
398 case LayoutDocEntry::MemberDecl:
399 {
400 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
401 if (lmd) writeMemberDeclarations(ol,lmd->type,lmd->title(lang));
402 }
403 break;
404 case LayoutDocEntry::MemberDeclEnd:
406 break;
407 case LayoutDocEntry::DetailedDesc:
408 if (ls) writeDetailedDescription(ol,ls->title(lang));
409 break;
410 case LayoutDocEntry::MemberDefStart:
412 break;
413 case LayoutDocEntry::MemberDef:
414 {
415 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
416 if (lmd) writeMemberDocumentation(ol,lmd->type,lmd->title(lang));
417 }
418 break;
419 case LayoutDocEntry::MemberDefEnd:
421 break;
422 case LayoutDocEntry::AuthorSection:
424 break;
425 case LayoutDocEntry::ClassIncludes:
426 case LayoutDocEntry::ClassInheritanceGraph:
427 case LayoutDocEntry::ClassNestedClasses:
428 case LayoutDocEntry::ClassCollaborationGraph:
429 case LayoutDocEntry::ClassAllMembersLink:
430 case LayoutDocEntry::ClassUsedFiles:
431 case LayoutDocEntry::ClassInlineClasses:
432 case LayoutDocEntry::FileClasses:
433 case LayoutDocEntry::FileConcepts:
434 case LayoutDocEntry::FileInterfaces:
435 case LayoutDocEntry::FileStructs:
436 case LayoutDocEntry::FileExceptions:
437 case LayoutDocEntry::FileNamespaces:
438 case LayoutDocEntry::FileConstantGroups:
439 case LayoutDocEntry::FileIncludes:
440 case LayoutDocEntry::FileIncludeGraph:
441 case LayoutDocEntry::FileIncludedByGraph:
442 case LayoutDocEntry::FileInlineClasses:
443 case LayoutDocEntry::FileSourceLink:
444 case LayoutDocEntry::NamespaceNestedNamespaces:
445 case LayoutDocEntry::NamespaceNestedConstantGroups:
446 case LayoutDocEntry::NamespaceClasses:
447 case LayoutDocEntry::NamespaceConcepts:
448 case LayoutDocEntry::NamespaceInterfaces:
449 case LayoutDocEntry::NamespaceStructs:
450 case LayoutDocEntry::NamespaceExceptions:
451 case LayoutDocEntry::NamespaceInlineClasses:
452 case LayoutDocEntry::ConceptDefinition:
453 case LayoutDocEntry::GroupClasses:
454 case LayoutDocEntry::GroupConcepts:
455 case LayoutDocEntry::GroupModules:
456 case LayoutDocEntry::GroupInlineClasses:
457 case LayoutDocEntry::GroupNamespaces:
458 case LayoutDocEntry::GroupDirs:
459 case LayoutDocEntry::GroupNestedGroups:
460 case LayoutDocEntry::GroupFiles:
461 case LayoutDocEntry::GroupGraph:
462 case LayoutDocEntry::GroupPageDocs:
463 case LayoutDocEntry::DirSubDirs:
464 case LayoutDocEntry::DirFiles:
465 case LayoutDocEntry::DirGraph:
466 err("Internal inconsistency: member %d should not be part of "
467 "LayoutDocManager::Module entry list\n",lde->kind());
468 break;
469 }
470 }
471
472 //---------------------------------------- end flexible part -------------------------------
473 endFile(ol);
474
476}
477
479{
480 m_classes.writeDeclaration(ol,nullptr,title,FALSE);
481}
482
484{
485 m_concepts.writeDeclaration(ol,title,FALSE);
486}
487
492
497
499{
500 if (Config_getBool(SEPARATE_MEMBER_PAGES))
501 {
504 }
505}
506
508{
509 if (Config_getBool(SEPARATE_MEMBER_PAGES))
510 {
513 }
514}
515
517{
519 {
522 ol.writeRuler();
526 ol.writeAnchor(QCString(),"details");
528 ol.startGroupHeader();
529 ol.parseText(title);
530 ol.endGroupHeader();
531
532 ol.startTextBlock();
533 if (!briefDescription().isEmpty() && Config_getBool(REPEAT_BRIEF))
534 {
536 QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
537 }
538 if (!briefDescription().isEmpty() && Config_getBool(REPEAT_BRIEF) &&
539 !documentation().isEmpty())
540 {
544 ol.enableAll();
547 ol.writeString("\n\n");
549 }
550 if (!documentation().isEmpty())
551 {
552 ol.generateDoc(docFile(),docLine(),this,nullptr,documentation()+"\n",TRUE,FALSE,
553 QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
554 }
555 ol.endTextBlock();
556 }
557}
558
560{
562 {
563 auto parser { createDocParser() };
564 auto ast { validatingParseDoc(*parser.get(),
565 briefFile(),briefLine(),this,nullptr,
567 QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT)) };
568 if (!ast->isEmpty())
569 {
570 ol.startParagraph();
573 ol.writeString(" - ");
575 ol.writeDoc(ast.get(),this,nullptr);
578 ol.writeString(" \n");
580
582 {
584 ol.startTextLink(QCString(),"details");
586 ol.endTextLink();
587 }
589 ol.endParagraph();
590 }
591 }
592 ol.writeSynopsis();
593}
594
596{
597 for (const auto &mg : m_memberGroups)
598 {
599 mg->writeDeclarations(ol,nullptr,nullptr,nullptr,nullptr,this);
600 }
601}
602
604{
605 MemberList * ml = getMemberList(lt);
606 if (ml) ml->writeDeclarations(ol,nullptr,nullptr,nullptr,nullptr,this,title,QCString());
607}
608
610{
611 MemberList * ml = getMemberList(lt);
612 if (ml) ml->writeDocumentation(ol,name(),this,title);
613}
614
616{
617 // write Author section (Man only)
620 ol.startGroupHeader();
622 ol.endGroupHeader();
625}
626
628{
629 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
630 return (!briefDescription().isEmpty() && repeatBrief) || !documentation().isEmpty();
631}
632
634{
635 for (auto &ml : m_memberLists)
636 {
637 ml->countDecMembers();
638 ml->countDocMembers();
639 }
640 for (const auto &mg : m_memberGroups)
641 {
642 mg->countDecMembers();
643 mg->countDocMembers();
644 }
645}
646
648{
649 const RefItemVector &xrefItems = xrefListItems();
650 addRefItem(xrefItems,
656 QCString(),
657 this
658 );
659 for (const auto &mg : m_memberGroups)
660 {
661 mg->addListReferences(this);
662 }
663 for (auto &ml : m_memberLists)
664 {
665 if (ml->listType().isDocumentation())
666 {
667 ml->addListReferences(this);
668 }
669 }
670}
671
673{
674 for (auto &ml : m_memberLists)
675 {
676 if (ml->listType().isDeclaration())
677 {
679 }
680 }
681
682 // add members inside sections to their groups
683 for (const auto &mg : m_memberGroups)
684 {
685 if (mg->allMembersInSameSection() && Config_getBool(SUBGROUPING))
686 {
687 //printf("----> addToDeclarationSection(%s)\n",qPrint(mg->header()));
688 mg->addToDeclarationSection();
689 }
690 }
691}
692
694{
695 for (const auto &mg : m_memberGroups)
696 {
697 mg->distributeMemberGroupDocumentation();
698 }
699}
700
702{
706 for (const auto &mg : m_memberGroups)
707 {
708 mg->findSectionsInDocumentation(this);
709 }
710 for (auto &ml : m_memberLists)
711 {
712 if (ml->listType().isDeclaration())
713 {
714 ml->findSectionsInDocumentation(this);
715 }
716 }
717}
718
720{
721 for (auto &ml : m_memberLists)
722 {
723 if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(FALSE); }
724 }
725
726 if (Config_getBool(SORT_BRIEF_DOCS))
727 {
728 auto classComp = [](const ClassLinkedRefMap::Ptr &c1,const ClassLinkedRefMap::Ptr &c2)
729 {
730 return Config_getBool(SORT_BY_SCOPE_NAME) ?
731 qstricmp_sort(c1->name(), c2->name())<0 :
732 qstricmp_sort(c1->className(), c2->className())<0;
733 };
734 std::stable_sort(m_classes.begin(), m_classes.end(), classComp);
735
736 auto conceptComp = [](const ConceptLinkedRefMap::Ptr &c1,const ConceptLinkedRefMap::Ptr &c2)
737 {
738 return Config_getBool(SORT_BY_SCOPE_NAME) ?
739 qstricmp_sort(c1->qualifiedName(), c2->qualifiedName())<0 :
740 qstricmp_sort(c1->name(), c2->name())<0;
741 };
742 std::stable_sort(m_concepts.begin(), m_concepts.end(), conceptComp);
743 }
744
745 static auto contrComp = [](const ModuleDef *m1, const ModuleDef *m2)
746 {
747 FileDef *f1 = m1->getFileDef();
748 FileDef *f2 = m2->getFileDef();
749 QCString fn1 = f1 ? f1->name() : m1->name();
750 QCString fn2 = f2 ? f2->name() : m2->name();
751 static auto typeRank = [](const ModuleDef *m) -> int
752 {
753 if (m->moduleType()==ModuleDef::Type::Interface)
754 {
755 if (m->partitionName().isEmpty()) return 0; // primary interface unit
756 return 1; // partition interface unit
757 }
758 else
759 {
760 if (!m->partitionName().isEmpty()) return 2; // partition implementation unit
761 return 3; // implementation unit
762 }
763 };
764 auto tr1 = typeRank(m1);
765 auto tr2 = typeRank(m2);
766 int diff = qstricmp_sort(fn1,fn2);
767 return tr1<tr2 || (tr1==tr2 && diff<0);
768 };
769
770 std::stable_sort(m_contributing.begin(), m_contributing.end(), contrComp);
771}
772
774{
777 bool first=TRUE;
778 SrcLangExt lang=getLanguage();
779 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Module))
780 {
781 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
782 if (lde->kind()==LayoutDocEntry::ModuleClasses && m_classes.declVisible() && ls)
783 {
784 QCString label = "classes";
785 ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
786 first=FALSE;
787 }
788 else if (lde->kind()==LayoutDocEntry::ModuleConcepts && m_concepts.declVisible() && ls)
789 {
790 QCString label = "concepts";
791 ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
792 first=FALSE;
793 }
794 else if (lde->kind()==LayoutDocEntry::ModuleUsedFiles && ls)
795 {
796 QCString label = "files";
797 ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
798 first=FALSE;
799 }
800 else if (lde->kind()==LayoutDocEntry::MemberDecl)
801 {
802 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
803 if (lmd)
804 {
805 MemberList * ml = getMemberList(lmd->type);
806 if (ml && ml->declVisible())
807 {
808 ol.writeSummaryLink(QCString(),ml->listType().toLabel(),lmd->title(lang),first);
809 first=FALSE;
810 }
811 }
812 }
813 }
814 if (!first)
815 {
816 ol.writeString(" </div>\n");
817 }
819}
820
821void ModuleDefImpl::writeDeclarationLink(OutputList &ol,bool &found,const QCString &header,bool localNames) const
822{
823 if (isLinkable())
824 {
825 if (!found) // first module
826 {
827 ol.startMemberHeader("modules");
828 if (!header.isEmpty())
829 {
830 ol.parseText(header);
831 }
832 else
833 {
834 theTranslator->trModule(true,false);
835 }
836 ol.endMemberHeader();
837 ol.startMemberList();
838 found=TRUE;
839 }
842 ol.writeString("module ");
843 QCString cname = displayName(!localNames);
845 if (isLinkable())
846 {
849 anchor(),
850 cname
851 );
852 }
853 else
854 {
855 ol.startBold();
856 ol.docify(cname);
857 ol.endBold();
858 }
860 // add the brief description if available
861 if (!briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
862 {
863 auto parser { createDocParser() };
864 auto ast { validatingParseDoc(
865 *parser.get(),briefFile(),briefLine(),this,nullptr,
867 QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT)) };
868 if (!ast->isEmpty())
869 {
871 ol.writeDoc(ast.get(),this,nullptr);
873 }
874 }
875 ol.endMemberDeclaration(anchor(),QCString());
876 }
877}
878
879
881{
882 AUTO_TRACE("name={} count={}",name(),m_exportedModules.size());
883 if (!m_exportedModules.empty())
884 {
885 ol.startMemberHeader("exports");
886 ol.parseText(title);
887 ol.endMemberHeader();
888 ol.startMemberList();
889 for (auto &[moduleName,importInfo] : m_exportedModules)
890 {
891 ModuleDef *mod = ModuleManager::instance().getPrimaryInterface(importInfo.importName);
896 if (mod && mod->isLinkable())
897 {
898 ol.writeObjectLink(mod->getReference(),mod->getOutputFileBase(),QCString(),mod->displayName());
899 }
900 else
901 {
902 ol.startBold();
903 ol.docify(importInfo.importName);
904 ol.endBold();
905 }
907 if (mod && !mod->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
908 {
910 ol.generateDoc(briefFile(),briefLine(),mod,nullptr,mod->briefDescription(),FALSE,FALSE,
911 QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
913 }
914 ol.endMemberDeclaration(QCString(),QCString());
915 }
916 ol.endMemberList();
917 }
918}
919
921{
922 AUTO_TRACE("{} count={}",name(),m_contributing.size());
923 if (!m_contributing.empty())
924 {
925 ol.startMemberHeader("files");
926 ol.parseText(title);
927 ol.endMemberHeader();
928 ol.startMemberList();
929 for (const auto &mod : m_contributing)
930 {
931 FileDef *fd = mod->getFileDef();
932 if (fd)
933 {
938 QCString path=fd->getPath();
939 if (Config_getBool(FULL_PATH_NAMES))
940 {
941 ol.docify(stripFromPath(path));
942 }
943 if (fd->isLinkable())
944 {
945 ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),QCString(),fd->displayName());
946 }
947 else
948 {
949 ol.startBold();
950 ol.docify(fd->displayName());
951 ol.endBold();
952 }
954 if (!fd->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
955 {
958 QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
960 }
961 ol.endMemberDeclaration(QCString(),QCString());
962 }
963 }
964 ol.endMemberList();
965 }
966}
967
969{
970 FileList result;
971 for (const auto &mod : m_contributing)
972 {
973 FileDef *fd = mod->getFileDef();
974 if (fd) result.push_back(fd);
975 }
976 return result;
977}
978
980{
981 int count=0;
982 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Module))
983 {
984 if (lde->kind()==LayoutDocEntry::MemberDecl)
985 {
986 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
987 if (lmd)
988 {
989 MemberList *ml = getMemberList(lmd->type);
990 if (ml)
991 {
992 for (const auto &md : *ml)
993 {
994 if (md->visibleInIndex())
995 {
996 count++;
997 }
998 }
999 }
1000 }
1001 }
1002 else if (lde->kind()==LayoutDocEntry::ModuleClasses)
1003 {
1004 for (const auto &cd : getClasses())
1005 {
1006 if (cd->isLinkableInProject())
1007 {
1008 count++;
1009 }
1010 }
1011 }
1012 else if (lde->kind()==LayoutDocEntry::ModuleConcepts)
1013 {
1014 for (const auto &cd : getConcepts())
1015 {
1016 if (cd->isLinkableInProject())
1017 {
1018 count++;
1019 }
1020 }
1021 }
1022 }
1023 return count;
1024}
1025
1027{
1028 if (!isPrimaryInterface() || !isLinkableInProject()) return;
1029 tagFile << " <compound kind=\"module\">\n";
1030 tagFile << " <name>" << convertToXML(name()) << "</name>\n";
1031 const FileDef *fd = getFileDef();
1032 QCString fn = fd ? fd->getOutputFileBase() : getOutputFileBase();
1034 tagFile << " <filename>" << convertToXML(fn) << "</filename>\n";
1035#if 0 // at the moment we do not export the members of a module to a tag file.
1036 // We let the project using a tag file directly link to the implementation of the
1037 // symbols (which have the same scope).
1038 //
1039 // When we support linking to a module's interface instead we need to
1040 // export the module's members as well. Then we probably need a way to
1041 // disambiguate/prioritize a link to a module over a link to the implementation,
1042 // for instance by hiding non-exported symbols from the tag file.
1043 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Group))
1044 {
1045 switch (lde->kind())
1046 {
1047 case LayoutDocEntry::ModuleExports:
1048 {
1049 for (const auto &[modName,importInfo] : m_exportedModules)
1050 {
1051 tagFile << " <export>" << convertToXML(importInfo.importName) << "</export>\n";
1052 }
1053 }
1054 break;
1055 case LayoutDocEntry::ModuleClasses:
1056 {
1057 for (const auto &cd : m_classes)
1058 {
1059 if (cd->isLinkableInProject())
1060 {
1061 tagFile << " <class kind=\"" << cd->compoundTypeString()
1062 << "\">" << convertToXML(cd->name()) << "</class>\n";
1063 }
1064 }
1065 }
1066 break;
1067 case LayoutDocEntry::ModuleConcepts:
1068 {
1069 for (const auto &cd : m_concepts)
1070 {
1071 if (cd->isLinkableInProject())
1072 {
1073 tagFile << " <concept>" << convertToXML(cd->name())
1074 << "</concept>\n";
1075 }
1076 }
1077 }
1078 break;
1079 case LayoutDocEntry::ModuleUsedFiles:
1080 {
1081 for (const auto &usedFd : getUsedFiles())
1082 {
1083 if (usedFd->isLinkableInProject())
1084 {
1085 tagFile << " <file>" << convertToXML(usedFd->name()) << "</file>\n";
1086 }
1087 }
1088 }
1089 break;
1090 case LayoutDocEntry::MemberDecl:
1091 {
1092 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
1093 if (lmd)
1094 {
1095 MemberList * ml = getMemberList(lmd->type);
1096 if (ml)
1097 {
1098 ml->writeTagFile(tagFile,true);
1099 }
1100 }
1101 }
1102 break;
1103 default:
1104 break;
1105 }
1106 }
1107#endif
1108 QCString idStr = id();
1109 if (!idStr.isEmpty())
1110 {
1111 tagFile << " <clangid>" << convertToXML(idStr) << "</clangid>\n";
1112 }
1113 writeDocAnchorsToTagFile(tagFile);
1114 tagFile << " </compound>\n";
1115}
1116
1117//------------------------------------------------------------------------------------------------------------
1118
1120{
1121 if (d==nullptr) return nullptr;
1122 return (typeid(*d)==typeid(ModuleDefImpl)) ? static_cast<ModuleDef*>(d) : nullptr;
1123}
1124
1126{
1127 if (d==nullptr) return nullptr;
1128 return (typeid(*d)==typeid(ModuleDefImpl)) ? static_cast<const ModuleDef*>(d) : nullptr;
1129}
1130
1132{ return static_cast<ModuleDefImpl*>(m); }
1133
1134//static inline const ModuleDefImpl *toModuleDefImpl(const ModuleDef *m)
1135//{ return static_cast<const ModuleDefImpl*>(m); }
1136
1137static inline ModuleDefImpl *toModuleDefImpl(const std::unique_ptr<ModuleDef> &m)
1138{ return static_cast<ModuleDefImpl*>(m.get()); }
1139
1140//------------------------------------------------------------------------------------
1141
1143{
1144 bool hideUndocClasses = Config_getBool(HIDE_UNDOC_CLASSES);
1145 for (const auto &mod : *this)
1146 {
1147 bool isLink = mod->isLinkable();
1148 if (isLink || !hideUndocClasses)
1149 {
1150 return true;
1151 }
1152 }
1153 return false;
1154}
1155
1156void ModuleLinkedRefMap::writeDeclaration(OutputList &ol,const QCString &header,bool localNames) const
1157{
1158 bool found=FALSE;
1159 for (const auto &mod : *this)
1160 {
1161 toModuleDefImpl(mod)->writeDeclarationLink(ol,found,header,localNames);
1162 }
1163 if (found) ol.endMemberList();
1164}
1165
1166//------------------------------------------------------------------------------------------------------------
1167
1169{
1170 ModuleLinkedMap moduleFileMap; // file->module mapping
1171 std::unordered_map<std::string,ModuleList> moduleNameMap; // name->module mapping
1174 std::mutex mutex;
1175};
1176
1178{
1179 static ModuleManager m;
1180 return m;
1181}
1182
1184{
1185}
1186
1187void ModuleManager::createModuleDef(const QCString &fileName,int line,int column,bool exported,
1188 const QCString &moduleName,const QCString &partitionName)
1189{
1190 AUTO_TRACE("{}:{}: Found module name='{}' partition='{}' exported='{}'",
1191 fileName,line,moduleName,partitionName,exported);
1192 std::lock_guard lock(p->mutex);
1194 std::unique_ptr<ModuleDef> modDef = std::make_unique<ModuleDefImpl>(fileName,line,column,moduleName,mt,partitionName);
1195 auto mod = p->moduleFileMap.add(fileName,std::move(modDef));
1196 auto it = p->moduleNameMap.find(moduleName.str());
1197 if (it == p->moduleNameMap.end())
1198 {
1199 ModuleList ml;
1200 ml.push_back(mod);
1201 p->moduleNameMap.emplace(moduleName.str(),ml);
1202 }
1203 else
1204 {
1205 it->second.push_back(mod);
1206 }
1207}
1208
1210{
1211 std::lock_guard lock(p->mutex);
1212 p->headers.clear();
1213 p->externalImports.clear();
1214 p->moduleNameMap.clear();
1215 p->moduleFileMap.clear();
1216}
1217
1218void ModuleManager::addHeader(const QCString &moduleFile,int line,const QCString &headerName,bool isSystem)
1219{
1220 AUTO_TRACE("{}:{} headerName={} isSystem={}",moduleFile,line,headerName,isSystem);
1221 std::lock_guard lock(p->mutex);
1222 auto mod = p->moduleFileMap.find(moduleFile);
1223 if (mod)
1224 {
1225 toModuleDefImpl(mod)->addHeader(line,headerName,isSystem);
1226 }
1227 else
1228 {
1229 AUTO_TRACE_ADD("imported header '{}' found in file '{}' that is not a module",headerName,moduleFile);
1230 }
1231 p->headers.emplace_back(moduleFile,headerName,isSystem);
1232}
1233
1234void ModuleManager::addImport(const QCString &moduleFile,int line,const QCString &importName,
1235 bool isExported,const QCString &partitionName)
1236{
1237 AUTO_TRACE("{}:{} importName={},isExported={},partitionName={}",
1238 moduleFile,line,importName,isExported,partitionName);
1239 std::lock_guard lock(p->mutex);
1240 auto mod = p->moduleFileMap.find(moduleFile);
1241 if (mod) // import inside a module
1242 {
1243 AUTO_TRACE_ADD("in module");
1244 toModuleDefImpl(mod)->addImport(line,importName.isEmpty()?mod->name():importName,partitionName,isExported);
1245 }
1246 else // import outside of a module
1247 {
1248 AUTO_TRACE_ADD("outside module");
1249 p->externalImports.emplace(moduleFile.str(),ImportInfo(nullptr,importName,line,partitionName));
1250 }
1251}
1252
1254{
1255 std::lock_guard lock(p->mutex);
1256 auto mod = p->moduleFileMap.find(root->fileName);
1257 if (mod)
1258 {
1259 toModuleDefImpl(mod)->addClassToModule(root,cd);
1260 auto cdm = toClassDefMutable(cd);
1261 if (cdm) cdm->setModuleDef(mod);
1262 }
1263}
1264
1266{
1267 std::lock_guard lock(p->mutex);
1268 auto mod = p->moduleFileMap.find(root->fileName);
1269 if (mod)
1270 {
1271 toModuleDefImpl(mod)->addConceptToModule(root,cd);
1272 auto cdm = toConceptDefMutable(cd);
1273 if (cdm) cdm->setModuleDef(mod);
1274 }
1275}
1276
1278{
1279 std::lock_guard lock(p->mutex);
1280 auto mod = p->moduleFileMap.find(root->fileName);
1281 if (mod && root->exported)
1282 {
1283 toModuleDefImpl(mod)->addMemberToModule(root,md);
1284 auto mdm = toMemberDefMutable(md);
1285 if (mdm) mdm->setModuleDef(mod);
1286 }
1287}
1288
1289void ModuleManager::addTagInfo(const QCString &fileName,const QCString &tagFile,const QCString &clangId)
1290{
1291 std::lock_guard lock(p->mutex);
1292 auto mod = p->moduleFileMap.find(fileName);
1293 if (mod)
1294 {
1295 ModuleDefImpl *modi = toModuleDefImpl(mod);
1296 modi->setReference(tagFile);
1297 modi->setId(clangId);
1298 }
1299}
1300
1302{
1303 AUTO_TRACE();
1304 for (auto &[partitionFileName,importInfo] : mod->getImports()) // foreach import
1305 {
1306 AUTO_TRACE_ADD("partitionFileName={} importName={} partitionName={}",
1307 partitionFileName,importInfo.importName,importInfo.partitionName);
1308 if (importInfo.importName==intfMod->name() && !importInfo.partitionName.isEmpty() &&
1309 importInfo.exported) // that is an exported partition of this module
1310 {
1311 auto it = p->moduleNameMap.find(importInfo.importName.str());
1312 if (it != p->moduleNameMap.end())
1313 {
1314 for (auto importedMod : it->second)
1315 {
1316 if (importedMod->qualifiedName()==importInfo.importName+":"+importInfo.partitionName)
1317 {
1318 AUTO_TRACE_ADD("Interface module {} exports partition {}:{}",
1319 mod->name(),importedMod->name(),importedMod->partitionName());
1320 toModuleDefImpl(intfMod)->addPartition(toModuleDefImpl(importedMod));
1321 toModuleDefImpl(importedMod)->setPrimaryInterface(intfMod);
1322 for (const auto &[partitionFileName_,partitionImportInfo] : importedMod->getImports())
1323 {
1324 if (partitionImportInfo.exported && intfMod->name()!=partitionImportInfo.importName)
1325 {
1326 toModuleDefImpl(intfMod)->addExportedModule(partitionImportInfo.importName,partitionImportInfo);
1327 }
1328 }
1329 resolvePartitionsRecursively(intfMod,importedMod);
1330 }
1331 }
1332 }
1333 }
1334 }
1335}
1336
1338{
1339 AUTO_TRACE();
1340 for (auto &mod : p->moduleFileMap) // foreach module
1341 {
1342 if (mod->moduleType()==ModuleDef::Type::Interface && mod->partitionName().isEmpty())
1343 { // that is a primary interface
1344 resolvePartitionsRecursively(mod.get(),mod.get());
1345 }
1346
1347 // copy exported imports to m_exportedModules
1348 for (const auto &[fileName,importInfo] : mod->getImports())
1349 {
1350 if (importInfo.exported && mod->name()!=importInfo.importName)
1351 {
1352 toModuleDefImpl(mod)->addExportedModule(importInfo.importName,importInfo);
1353 }
1354 }
1355
1356 // also link the ModuleDef and FileDef together
1357 bool ambig = false;
1358 FileDef *fd = findFileDef(Doxygen::inputNameLinkedMap,mod->getDefFileName(),ambig);
1359 if (fd)
1360 {
1361 fd->setModuleDef(mod.get());
1362 toModuleDefImpl(mod)->setFileDef(fd);
1363 }
1364 }
1365}
1366
1368{
1369 AUTO_TRACE();
1370 for (auto &mod : p->moduleFileMap)
1371 {
1372 FileDef *fd = mod->getFileDef();
1373 if (fd)
1374 {
1375 for (const auto &[fileName,importInfo] : mod->getImports())
1376 {
1377 ModuleDef *importedModule = getPrimaryInterface(importInfo.importName);
1378 const FileDef *importedFd = importedModule ? importedModule->getFileDef() : nullptr;
1379 AUTO_TRACE_ADD("module: addIncludeDependency {}->{}:{} fd={}",
1380 mod->qualifiedName(), importInfo.qualifiedName(), importInfo.line, fd?fd->absFilePath():"");
1382 }
1383 }
1384 }
1385 for (const auto &[fileName,importInfo] : p->externalImports)
1386 {
1387 bool ambig = false;
1388 FileDef *fd = findFileDef(Doxygen::inputNameLinkedMap,QCString(fileName),ambig);
1389 if (fd)
1390 {
1391 ModuleDef *mod = getPrimaryInterface(importInfo.importName);
1392 FileDef *importedFd = mod ? mod->getFileDef() : nullptr;
1393 fd->addIncludeDependency(importedFd,importInfo.importName,IncludeKind::ImportModule);
1394 }
1395 }
1396 for (const auto &headerInfo : p->headers)
1397 {
1398 bool ambig = false;
1399 FileDef *fd = findFileDef(Doxygen::inputNameLinkedMap,headerInfo.fileName,ambig);
1400 if (fd)
1401 {
1402 QCString resolvedHeader = determineAbsoluteIncludeName(headerInfo.fileName,headerInfo.headerName);
1403 FileDef *importFd = findFileDef(Doxygen::inputNameLinkedMap,resolvedHeader,ambig);
1404 fd->addIncludeDependency(importFd, headerInfo.headerName,
1405 headerInfo.isSystem ? IncludeKind::ImportSystem : IncludeKind::ImportLocal);
1406 }
1407 }
1408}
1409
1411{
1412 AUTO_TRACE("{}: collecting symbols for partition {}",intfMod->qualifiedName(),partitionMod->qualifiedName());
1413 auto intfModImpl = toModuleDefImpl(intfMod);
1414 auto partitionModImpl = toModuleDefImpl(partitionMod);
1415 intfModImpl->mergeSymbolsFrom(partitionModImpl);
1416}
1417
1419{
1420 AUTO_TRACE();
1421 for (auto &mod : p->moduleFileMap) // foreach module
1422 {
1423 if (mod->isPrimaryInterface()) // that is a primary interface
1424 {
1425 for (auto &[partitionName,partitionMod] : mod->partitions())
1426 {
1427 collectExportedSymbolsRecursively(mod.get(),partitionMod);
1428 }
1429
1430 // collect all files that contribute to this module (e.g. implementation/partition modules)
1431 auto it = p->moduleNameMap.find(mod->name().str());
1432 if (it != p->moduleNameMap.end())
1433 {
1434 for (auto contributingMod : it->second)
1435 {
1436 AUTO_TRACE_ADD(" adding contributing module {} to interface module {} type={} partition={} isPrimaryIntf={}",
1437 contributingMod->qualifiedName(),
1438 mod->name(),
1439 contributingMod->moduleType()==ModuleDef::Type::Interface ? "Interface" : "Implementation",
1440 contributingMod->partitionName(),
1441 contributingMod->isPrimaryInterface());
1443 }
1444 }
1445 }
1446 }
1447}
1448
1450{
1451 for (auto &mod : p->moduleFileMap) // foreach module
1452 {
1454 }
1455}
1456
1458{
1459 for (auto &mod : p->moduleFileMap) // foreach module
1460 {
1461 if (mod->isPrimaryInterface())
1462 {
1463 mod->writeDocumentation(ol);
1464 }
1465 }
1466}
1467
1469{
1470 int count=0;
1471 for (auto &mod : p->moduleFileMap) // foreach module
1472 {
1473 if (mod->isPrimaryInterface()) count++;
1474 }
1475 return count;
1476}
1477
1479{
1480 return p->moduleFileMap;
1481}
1482
1484{
1485 AUTO_TRACE("file={} module={}",root->fileName,root->name);
1486 if (root->doc.isEmpty() && root->brief.isEmpty()) return;
1487 if (root->name.find(':')!=-1)
1488 {
1489 warn(root->fileName,root->startLine,"Ignoring documentation for module partition %s. Please place documentation at the primary module name",
1490 qPrint(root->name));
1491 }
1492 else
1493 {
1494 auto it = p->moduleNameMap.find(root->name.str());
1495 if (it != p->moduleNameMap.end())
1496 {
1497 ModuleDef *mod = getPrimaryInterface(root->name);
1498 if (mod)
1499 {
1500 mod->setDocumentation(root->doc,root->docFile,root->docLine);
1501 mod->setBriefDescription(root->brief,root->briefFile,root->briefLine);
1502 mod->setId(root->id);
1503 mod->setHidden(root->hidden);
1504 mod->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
1505 mod->setRefItems(root->sli);
1506 //mod->addSectionsToDefinition(root->anchors);
1507 addModuleToGroups(root,mod);
1508 }
1509 else
1510 {
1511 warn(root->fileName,root->startLine,"Found documentation for module %s but it has no primary interface unit.",qPrint(root->name));
1512 }
1513 }
1514 else
1515 {
1516 warn(root->fileName,root->startLine,"Found documentation for unknown module %s.",qPrint(root->name));
1517 }
1518 }
1519}
1520
1522{
1523 auto it = p->moduleNameMap.find(moduleName.str());
1524 if (it != p->moduleNameMap.end())
1525 {
1526 for (auto &mod : it->second)
1527 {
1528 if (mod->isPrimaryInterface())
1529 {
1530 return mod;
1531 }
1532 }
1533 }
1534 return nullptr;
1535}
1536
1538{
1539 for (auto &mod : p->moduleFileMap) // foreach module
1540 {
1541 if (mod->isPrimaryInterface()) toModuleDefImpl(mod)->addListReferences();
1542 }
1543}
1544
1546{
1547 for (auto &mod : p->moduleFileMap) // foreach module
1548 {
1549 if (mod->isPrimaryInterface()) toModuleDefImpl(mod)->addMembersToMemberGroup();
1550 }
1551}
1552
1554{
1555 for (auto &mod : p->moduleFileMap) // foreach module
1556 {
1557 if (mod->isPrimaryInterface()) toModuleDefImpl(mod)->distributeMemberGroupDocumentation();
1558 }
1559}
1560
1562{
1563 for (auto &mod : p->moduleFileMap) // foreach module
1564 {
1565 if (mod->isPrimaryInterface()) toModuleDefImpl(mod)->findSectionsInDocumentation();
1566 }
1567}
1568
1570{
1571 for (auto &mod : p->moduleFileMap) // foreach module
1572 {
1573 if (mod->isPrimaryInterface()) toModuleDefImpl(mod)->sortMemberLists();
1574 }
1575}
1576
A abstract class representing of a compound symbol.
Definition classdef.h:104
virtual QCString className() const =0
Returns the name of the class including outer classes, but not including namespaces.
The common base class of all entity definitions found in the sources.
Definition definition.h:76
virtual bool isLinkable() const =0
virtual QCString anchor() const =0
virtual bool isExported() const =0
virtual QCString briefDescription(bool abbreviate=FALSE) const =0
virtual QCString getReference() const =0
virtual QCString qualifiedName() const =0
virtual QCString displayName(bool includeScope=TRUE) const =0
virtual QCString briefFile() const =0
virtual QCString getOutputFileBase() const =0
virtual const QCString & name() const =0
int getDefLine() const override
bool isReference() const override
const QCString & name() const override
QCString getDefFileName() const override
bool isExported() const override
bool hasBriefDescription() const override
void setId(const QCString &name) override
QCString docFile() const override
QCString briefFile() const override
QCString id() const override
void setReference(const QCString &r) override
const RefItemVector & xrefListItems() const override
QCString briefDescription(bool abbreviate=FALSE) const override
QCString getReference() const override
DefinitionMixin(const QCString &defFileName, int defLine, int defColumn, const QCString &name, const char *b=nullptr, const char *d=nullptr, bool isSymbol=TRUE)
bool isHidden() const override
QCString inbodyDocumentation() const override
int docLine() const override
int briefLine() const override
QCString documentation() const override
void writeDocAnchorsToTagFile(TextStream &fs) const override
bool hasDocumentation() const override
SrcLangExt getLanguage() const override
virtual void setBodySegment(int defLine, int bls, int ble)=0
virtual void setHidden(bool b)=0
virtual void setDocumentation(const QCString &d, const QCString &docFile, int docLine, bool stripWhiteSpace=TRUE)=0
virtual void setId(const QCString &name)=0
virtual void setBriefDescription(const QCString &b, const QCString &briefFile, int briefLine)=0
virtual void setRefItems(const RefItemVector &sli)=0
static bool suppressDocWarnings
Definition doxygen.h:132
static FileNameLinkedMap * inputNameLinkedMap
Definition doxygen.h:105
Represents an unstructured piece of information, about an entity found in the sources.
Definition entry.h:116
int docLine
line number at which the documentation was found
Definition entry.h:201
int endBodyLine
line number where the definition ends
Definition entry.h:218
bool exported
is the symbol exported from a C++20 module
Definition entry.h:189
QCString id
libclang id
Definition entry.h:231
QCString fileName
file this entry was extracted from
Definition entry.h:223
int startLine
start line of entry in the source
Definition entry.h:224
QCString name
member name
Definition entry.h:174
QCString briefFile
file in which the brief desc. was found
Definition entry.h:205
int bodyLine
line number of the body in the source
Definition entry.h:216
QCString doc
documentation block (partly parsed)
Definition entry.h:200
RefItemVector sli
special lists (test/todo/bug/deprecated/..) this entry is in
Definition entry.h:226
QCString docFile
file in which the documentation was found
Definition entry.h:202
bool hidden
does this represent an entity that is hidden from the output
Definition entry.h:228
QCString brief
brief description (doc block)
Definition entry.h:203
int briefLine
line number at which the brief desc. was found
Definition entry.h:204
A model of a file symbol.
Definition filedef.h:99
virtual void setModuleDef(ModuleDef *mod)=0
virtual QCString getPath() const =0
virtual QCString absFilePath() const =0
virtual void addIncludeDependency(const FileDef *fd, const QCString &incName, IncludeKind kind)=0
static LayoutDocManager & instance()
Returns a reference to this singleton.
Definition layout.cpp:1423
A model of a class/file/namespace member symbol.
Definition memberdef.h:48
virtual MemberType memberType() const =0
virtual void setSectionList(const Definition *container, const MemberList *sl)=0
A list of MemberDef objects as shown in documentation sections.
Definition memberlist.h:108
void writeDeclarations(OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod, const QCString &title, const QCString &subtitle, bool showEnumValues=FALSE, bool showInline=FALSE, const ClassDef *inheritedFrom=nullptr, MemberListType lt=MemberListType::PubMethods(), bool showSectionTitle=true) const
Writes the list of members to the output.
void writeTagFile(TextStream &, bool useQualifiedName=false, bool showNamespaceMembers=true)
MemberListType listType() const
Definition memberlist.h:113
void writeDocumentation(OutputList &ol, const QCString &scopeName, const Definition *container, const QCString &title, bool showEnumValues=FALSE, bool showInline=FALSE) const
bool declVisible() const
Wrapper class for the MemberListType type.
Definition types.h:184
constexpr const char * toLabel() const
Definition types.h:240
bool contains(const MemberDef *md) const
Definition memberlist.h:88
void push_back(const T &value)
Definition memberlist.h:47
virtual const ImportInfoMap & getImports() const =0
virtual FileDef * getFileDef() const =0
void countMembers()
void addPartition(ModuleDefImpl *mod)
void distributeMemberGroupDocumentation()
QCString anchor() const override
Definition moduledef.cpp:61
void startMemberDeclarations(OutputList &ol)
DefType definitionType() const override
Definition moduledef.cpp:57
void sortMemberLists()
QCString getOutputFileBase() const override
void endMemberDeclarations(OutputList &ol)
MemberList * getMemberList(MemberListType lt) const override
void writeDocumentation(OutputList &ol) override
FileList getUsedFiles() const override
void writeMemberDocumentation(OutputList &ol, MemberListType lt, const QCString &title)
ModuleList m_contributing
void addMemberToModule(const Entry *root, MemberDef *md)
bool isPrimaryInterface() const override
Definition moduledef.cpp:71
QCString qualifiedName() const override
void addConceptToModule(const Entry *root, ConceptDef *cd)
FileDef * getFileDef() const override
Definition moduledef.cpp:78
QCString partitionName() const override
Definition moduledef.cpp:69
void addClassToModule(const Entry *root, ClassDef *cd)
bool isLinkableInProject() const override
Definition moduledef.cpp:62
FileDef * m_fileDef
void writeTagFile(TextStream &t) const override
void writeMemberGroups(OutputList &ol)
const ModuleDef * m_primaryInterface
void startMemberDocumentation(OutputList &ol)
void writeAuthorSection(OutputList &ol)
const ImportInfoMap & getImports() const override
Definition moduledef.cpp:79
MemberLists m_memberLists
int countVisibleMembers() const override
void setPrimaryInterface(const ModuleDef *mod)
void writeClassDeclarations(OutputList &ol, const QCString &title)
void mergeSymbolsFrom(ModuleDefImpl *other)
void writeExports(OutputList &ol, const QCString &title)
const ClassLinkedRefMap & getClasses() const override
Definition moduledef.cpp:75
void addMembersToMemberGroup()
void writeFiles(OutputList &ol, const QCString &title)
void addExportedModule(const QCString &moduleName, const ImportInfo &info)
void endMemberDocumentation(OutputList &ol)
void setFileDef(FileDef *fd)
QCString m_partitionName
ConceptLinkedRefMap m_concepts
void addMemberToList(MemberListType lt, MemberDef *md)
void writeDetailedDescription(OutputList &ol, const QCString &title)
CodeSymbolType codeSymbolType() const override
Definition moduledef.cpp:58
const ImportInfoMap & getExports() const override
Definition moduledef.cpp:80
void writeBriefDescription(OutputList &ol)
ModuleDefImpl(const QCString &fileName, int startLine, int startColom, const QCString &name, Type type, const QCString &partitionName)
Definition moduledef.cpp:51
void writeMemberDeclarations(OutputList &ol, MemberListType lt, const QCString &title)
ClassLinkedRefMap m_classes
const MemberGroupList & getMemberGroups() const override
Definition moduledef.cpp:74
void findSectionsInDocumentation()
ImportInfoMap m_exportedModules
ModuleMap m_partitions
void addImport(int line, const QCString &moduleName, const QCString &partitionName, bool isExported)
bool isLinkable() const override
Definition moduledef.cpp:63
QCString displayName(bool=TRUE) const override
Definition moduledef.cpp:59
ImportInfoMap m_imports
bool hasDetailedDescription() const
void addContributingModule(ModuleDefImpl *mod)
void writeSummaryLinks(OutputList &ol) const override
Type moduleType() const override
Definition moduledef.cpp:68
const ModuleMap & partitions() const override
Definition moduledef.cpp:81
const MemberLists & getMemberLists() const override
Definition moduledef.cpp:73
void writeDeclarationLink(OutputList &ol, bool &found, const QCString &header, bool localNames) const
MemberGroupList m_memberGroups
void writeConcepts(OutputList &ol, const QCString &title)
void addListReferences()
const ConceptLinkedRefMap & getConcepts() const override
Definition moduledef.cpp:76
void addHeader(int line, const QCString &headerName, bool isSystem)
bool declVisible() const
void writeDeclaration(OutputList &ol, const QCString &header, bool localNames) const
void addListReferences()
int numDocumentedModules() const
void sortMemberLists()
void resolveImports()
static ModuleManager & instance()
void addDocs(const Entry *root)
void collectExportedSymbolsRecursively(ModuleDef *intfMod, ModuleDef *mod)
void addHeader(const QCString &moduleFile, int line, const QCString &headerName, bool isSystem)
void countMembers()
void addConceptToModule(const Entry *root, ConceptDef *cd)
void addTagInfo(const QCString &moduleFile, const QCString &tagName, const QCString &clangId)
void addClassToModule(const Entry *root, ClassDef *cd)
void createModuleDef(const QCString &fileName, int line, int column, bool exported, const QCString &moduleName, const QCString &partitionName=QCString())
ModuleDef * getPrimaryInterface(const QCString &moduleName) const
void addMemberToModule(const Entry *root, MemberDef *md)
void writeDocumentation(OutputList &ol)
void addMembersToMemberGroup()
void resolvePartitions()
std::unique_ptr< Private > p
Definition moduledef.h:145
void findSectionsInDocumentation()
void collectExportedSymbols()
void resolvePartitionsRecursively(ModuleDef *intfMod, ModuleDef *mod)
const ModuleLinkedMap & modules() const
void addImport(const QCString &moduleFile, int line, const QCString &importName, bool isExported, const QCString &partitionName=QCString())
void distributeMemberGroupDocumentation()
Class representing a list of output generators that are written to in parallel.
Definition outputlist.h:314
void endTextBlock(bool paraBreak=FALSE)
Definition outputlist.h:671
void writeString(const QCString &text)
Definition outputlist.h:412
void startGroupHeader(int extraLevels=0)
Definition outputlist.h:454
void startMemberDeclaration()
Definition outputlist.h:570
void endTitleHead(const QCString &fileName, const QCString &name)
Definition outputlist.h:406
void disable(OutputType o)
void startTitleHead(const QCString &fileName)
Definition outputlist.h:404
void writeRuler()
Definition outputlist.h:522
void enable(OutputType o)
void endHeaderSection()
Definition outputlist.h:468
void endMemberDescription()
Definition outputlist.h:568
void writeObjectLink(const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name)
Definition outputlist.h:440
void writeDoc(const IDocNodeAST *ast, const Definition *ctx, const MemberDef *md)
Definition outputlist.h:384
void startMemberDescription(const QCString &anchor, const QCString &inheritId=QCString(), bool typ=false)
Definition outputlist.h:566
void startHeaderSection()
Definition outputlist.h:466
void docify(const QCString &s)
Definition outputlist.h:438
void startParagraph(const QCString &classDef=QCString())
Definition outputlist.h:408
void startTextBlock(bool dense=FALSE)
Definition outputlist.h:669
void endParagraph()
Definition outputlist.h:410
void startMemberSections()
Definition outputlist.h:462
void startMemberList()
Definition outputlist.h:482
void endTextLink()
Definition outputlist.h:445
void startBold()
Definition outputlist.h:562
void endMemberItem(OutputGenerator::MemberItemType type)
Definition outputlist.h:496
void endMemberList()
Definition outputlist.h:484
void writeSynopsis()
Definition outputlist.h:593
void generateDoc(const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &docStr, bool indexWords, bool isExample, const QCString &exampleName, bool singleLine, bool linkFromIndex, bool markdownSupport)
void pushGeneratorState()
void insertMemberAlign(bool templ=FALSE)
Definition outputlist.h:518
void disableAllBut(OutputType o)
void popGeneratorState()
void writeSummaryLink(const QCString &file, const QCString &anchor, const QCString &title, bool first)
Definition outputlist.h:615
void writeAnchor(const QCString &fileName, const QCString &name)
Definition outputlist.h:524
void endBold()
Definition outputlist.h:564
void endGroupHeader(int extraLevels=0)
Definition outputlist.h:456
void startContents()
Definition outputlist.h:617
void endMemberDeclaration(const QCString &anchor, const QCString &inheritId)
Definition outputlist.h:572
void enableAll()
void endMemberHeader()
Definition outputlist.h:472
void startMemberItem(const QCString &anchor, OutputGenerator::MemberItemType type, const QCString &id=QCString())
Definition outputlist.h:494
void parseText(const QCString &textStr)
void startTextLink(const QCString &file, const QCString &anchor)
Definition outputlist.h:443
void startMemberHeader(const QCString &anchor, int typ=2)
Definition outputlist.h:470
void endMemberSections()
Definition outputlist.h:464
This is an alternative implementation of QCString.
Definition qcstring.h:101
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
const std::string & str() const
Definition qcstring.h:526
Text streaming class that buffers data.
Definition textstream.h:36
virtual QCString trNamespace(bool first_capital, bool singular)=0
virtual QCString trMore()=0
virtual QCString trModuleReference(const QCString &namespaceName)=0
virtual QCString trGeneratedAutomatically(const QCString &s)=0
virtual QCString trModule(bool first_capital, bool singular)=0
virtual QCString trAuthor(bool first_capital, bool singular)=0
virtual QCString trFile(bool first_capital, bool singular)=0
ClassDefMutable * toClassDefMutable(Definition *d)
ConceptDefMutable * toConceptDefMutable(Definition *d)
#define Config_getBool(name)
Definition config.h:33
#define Config_getString(name)
Definition config.h:32
#define AUTO_TRACE_ADD(...)
Definition docnode.cpp:47
#define AUTO_TRACE(...)
Definition docnode.cpp:46
void docFindSections(const QCString &input, const Definition *d, const QCString &fileName)
IDocParserPtr createDocParser()
factory function to create a parser
Definition docparser.cpp:54
IDocNodeASTPtr validatingParseDoc(IDocParser &parserIntf, const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &input, bool indexWords, bool isExample, const QCString &exampleName, bool singleLine, bool linkFromIndex, bool markdownSupport)
static void writeTagFile()
@ ImportLocal
Definition filedef.h:54
@ ImportModule
Definition filedef.h:55
@ ImportSystem
Definition filedef.h:53
void addModuleToGroups(const Entry *root, ModuleDef *mod)
void endFile(OutputList &ol, bool skipNavIndex, bool skipEndContents, const QCString &navPath)
Definition index.cpp:421
void startFile(OutputList &ol, const QCString &name, const QCString &manName, const QCString &title, HighlightedItem hli, bool additionalIndices, const QCString &altSidebarName, int hierarchyLevel)
Definition index.cpp:402
Translator * theTranslator
Definition language.cpp:71
MemberDefMutable * toMemberDefMutable(Definition *d)
#define warn(file, line, fmt,...)
Definition message.h:59
#define err(fmt,...)
Definition message.h:84
std::vector< HeaderInfo > HeaderInfoVector
Definition moduledef.cpp:45
static ModuleDefImpl * toModuleDefImpl(ModuleDef *m)
ModuleDef * toModuleDef(Definition *d)
std::unordered_map< std::string, ModuleDef * > ModuleMap
Definition moduledef.h:59
std::unordered_map< std::string, ImportInfo > ImportInfoMap
Definition moduledef.h:60
int qstricmp_sort(const char *str1, const char *str2)
Definition qcstring.h:86
const char * qPrint(const char *s)
Definition qcstring.h:661
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
std::vector< RefItem * > RefItemVector
Definition reflist.h:133
QCString headerName
Definition moduledef.cpp:41
bool isSystem
Definition moduledef.cpp:42
HeaderInfo(const QCString &fn, const QCString &name, bool sys)
Definition moduledef.cpp:38
QCString fileName
Definition moduledef.cpp:40
QCString importName
Definition moduledef.h:44
QCString title(SrcLangExt lang) const
Definition layout.cpp:1533
MemberListType type
Definition layout.h:115
MemberListType type
Definition layout.h:130
QCString title(SrcLangExt lang) const
Definition layout.cpp:1545
QCString title(SrcLangExt lang) const
Definition layout.cpp:1526
ModuleLinkedMap moduleFileMap
ImportInfoMap externalImports
HeaderInfoVector headers
std::unordered_map< std::string, ModuleList > moduleNameMap
CodeSymbolType
Definition types.h:319
@ Enumeration
Definition types.h:395
@ Variable
Definition types.h:393
@ Typedef
Definition types.h:394
@ Function
Definition types.h:392
SrcLangExt
Language as given by extension.
Definition types.h:42
@ Fortran
Definition types.h:53
void addRefItem(const RefItemVector &sli, const QCString &key, const QCString &prefix, const QCString &name, const QCString &title, const QCString &args, const Definition *scope)
Definition util.cpp:5146
void addGroupListToTitle(OutputList &ol, const Definition *d)
Definition util.cpp:5233
bool found
Definition util.cpp:984
static QCString stripFromPath(const QCString &p, const StringVector &l)
Definition util.cpp:309
QCString convertNameToFile(const QCString &name, bool allowDots, bool allowUnderscore)
Definition util.cpp:3858
QCString convertToXML(const QCString &s, bool keepEntities)
Definition util.cpp:4266
QCString determineAbsoluteIncludeName(const QCString &curFile, const QCString &incFileName)
Definition util.cpp:3954
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)
Definition util.cpp:3262
void addHtmlExtensionIfMissing(QCString &fName)
Definition util.cpp:5243
A bunch of utility functions.