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);
93 void writeDetailedDescription(OutputList &ol,const QCString &title);
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);
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:
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[getDefFileName().str()+":"+std::to_string(line)].push_back(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[moduleName.str()].push_back(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 {
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());
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 '%s' should not be part of "
467 "LayoutDocManager::Module entry list\n",qPrint(lde->entryToString()));
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");
585 ol.parseText(theTranslator->trMore());
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();
621 ol.parseText(theTranslator->trAuthor(TRUE,TRUE));
622 ol.endGroupHeader();
623 ol.parseText(theTranslator->trGeneratedAutomatically(Config_getString(PROJECT_NAME)));
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,
653 theTranslator->trModule(TRUE,TRUE) :
654 theTranslator->trNamespace(TRUE,TRUE),
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 }
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 (const auto &[moduleName,importInfoList] : m_exportedModules)
890 {
891 for (const auto &importInfo : importInfoList)
892 {
893 ModuleDef *mod = ModuleManager::instance().getPrimaryInterface(importInfo.importName);
896 ol.docify(theTranslator->trModule(FALSE,TRUE)+" ");
898 if (mod && mod->isLinkable())
899 {
901 }
902 else
903 {
904 ol.startBold();
905 ol.docify(importInfo.importName);
906 ol.endBold();
907 }
909 if (mod && !mod->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
910 {
912 ol.generateDoc(briefFile(),briefLine(),mod,nullptr,mod->briefDescription(),FALSE,FALSE,
913 QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
915 }
917 }
918 }
919 ol.endMemberList();
920 }
921}
922
924{
925 AUTO_TRACE("{} count={}",name(),m_contributing.size());
926 if (!m_contributing.empty())
927 {
928 ol.startMemberHeader("files");
929 ol.parseText(title);
930 ol.endMemberHeader();
931 ol.startMemberList();
932 for (const auto &mod : m_contributing)
933 {
934 FileDef *fd = mod->getFileDef();
935 if (fd)
936 {
939 ol.docify(theTranslator->trFile(FALSE,TRUE)+" ");
941 QCString path=fd->getPath();
942 if (Config_getBool(FULL_PATH_NAMES))
943 {
944 ol.docify(stripFromPath(path));
945 }
946 if (fd->isLinkable())
947 {
949 }
950 else
951 {
952 ol.startBold();
953 ol.docify(fd->displayName());
954 ol.endBold();
955 }
957 if (!fd->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
958 {
961 QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
963 }
965 }
966 }
967 ol.endMemberList();
968 }
969}
970
972{
973 FileList result;
974 for (const auto &mod : m_contributing)
975 {
976 FileDef *fd = mod->getFileDef();
977 if (fd) result.push_back(fd);
978 }
979 return result;
980}
981
983{
984 int count=0;
985 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Module))
986 {
987 if (lde->kind()==LayoutDocEntry::MemberDecl)
988 {
989 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
990 if (lmd)
991 {
992 MemberList *ml = getMemberList(lmd->type);
993 if (ml)
994 {
995 for (const auto &md : *ml)
996 {
997 if (md->visibleInIndex())
998 {
999 count++;
1000 }
1001 }
1002 }
1003 }
1004 }
1005 else if (lde->kind()==LayoutDocEntry::ModuleClasses)
1006 {
1007 for (const auto &cd : getClasses())
1008 {
1009 if (cd->isLinkableInProject())
1010 {
1011 count++;
1012 }
1013 }
1014 }
1015 else if (lde->kind()==LayoutDocEntry::ModuleConcepts)
1016 {
1017 for (const auto &cd : getConcepts())
1018 {
1019 if (cd->isLinkableInProject())
1020 {
1021 count++;
1022 }
1023 }
1024 }
1025 }
1026 return count;
1027}
1028
1030{
1031 if (!isPrimaryInterface() || !isLinkableInProject()) return;
1032 tagFile << " <compound kind=\"module\">\n";
1033 tagFile << " <name>" << convertToXML(name()) << "</name>\n";
1034 const FileDef *fd = getFileDef();
1035 QCString fn = fd ? fd->getOutputFileBase() : getOutputFileBase();
1037 tagFile << " <filename>" << convertToXML(fn) << "</filename>\n";
1038#if 0 // at the moment we do not export the members of a module to a tag file.
1039 // We let the project using a tag file directly link to the implementation of the
1040 // symbols (which have the same scope).
1041 //
1042 // When we support linking to a module's interface instead we need to
1043 // export the module's members as well. Then we probably need a way to
1044 // disambiguate/prioritize a link to a module over a link to the implementation,
1045 // for instance by hiding non-exported symbols from the tag file.
1046 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Group))
1047 {
1048 switch (lde->kind())
1049 {
1050 case LayoutDocEntry::ModuleExports:
1051 {
1052 for (const auto &[modName,importInfo] : m_exportedModules)
1053 {
1054 tagFile << " <export>" << convertToXML(importInfo.importName) << "</export>\n";
1055 }
1056 }
1057 break;
1058 case LayoutDocEntry::ModuleClasses:
1059 {
1060 for (const auto &cd : m_classes)
1061 {
1062 if (cd->isLinkableInProject())
1063 {
1064 tagFile << " <class kind=\"" << cd->compoundTypeString()
1065 << "\">" << convertToXML(cd->name()) << "</class>\n";
1066 }
1067 }
1068 }
1069 break;
1070 case LayoutDocEntry::ModuleConcepts:
1071 {
1072 for (const auto &cd : m_concepts)
1073 {
1074 if (cd->isLinkableInProject())
1075 {
1076 tagFile << " <concept>" << convertToXML(cd->name())
1077 << "</concept>\n";
1078 }
1079 }
1080 }
1081 break;
1082 case LayoutDocEntry::ModuleUsedFiles:
1083 {
1084 for (const auto &usedFd : getUsedFiles())
1085 {
1086 if (usedFd->isLinkableInProject())
1087 {
1088 tagFile << " <file>" << convertToXML(usedFd->name()) << "</file>\n";
1089 }
1090 }
1091 }
1092 break;
1093 case LayoutDocEntry::MemberDecl:
1094 {
1095 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
1096 if (lmd)
1097 {
1098 MemberList * ml = getMemberList(lmd->type);
1099 if (ml)
1100 {
1101 ml->writeTagFile(tagFile,true);
1102 }
1103 }
1104 }
1105 break;
1106 default:
1107 break;
1108 }
1109 }
1110#endif
1111 QCString idStr = id();
1112 if (!idStr.isEmpty())
1113 {
1114 tagFile << " <clangid>" << convertToXML(idStr) << "</clangid>\n";
1115 }
1116 writeDocAnchorsToTagFile(tagFile);
1117 tagFile << " </compound>\n";
1118}
1119
1120//------------------------------------------------------------------------------------------------------------
1121
1123{
1124 if (d==nullptr) return nullptr;
1125 return (typeid(*d)==typeid(ModuleDefImpl)) ? static_cast<ModuleDef*>(d) : nullptr;
1126}
1127
1129{
1130 if (d==nullptr) return nullptr;
1131 return (typeid(*d)==typeid(ModuleDefImpl)) ? static_cast<const ModuleDef*>(d) : nullptr;
1132}
1133
1135{ return static_cast<ModuleDefImpl*>(m); }
1136
1137//static inline const ModuleDefImpl *toModuleDefImpl(const ModuleDef *m)
1138//{ return static_cast<const ModuleDefImpl*>(m); }
1139
1140static inline ModuleDefImpl *toModuleDefImpl(const std::unique_ptr<ModuleDef> &m)
1141{ return static_cast<ModuleDefImpl*>(m.get()); }
1142
1143//------------------------------------------------------------------------------------
1144
1146{
1147 bool hideUndocClasses = Config_getBool(HIDE_UNDOC_CLASSES);
1148 for (const auto &mod : *this)
1149 {
1150 bool isLink = mod->isLinkable();
1151 if (isLink || !hideUndocClasses)
1152 {
1153 return true;
1154 }
1155 }
1156 return false;
1157}
1158
1159void ModuleLinkedRefMap::writeDeclaration(OutputList &ol,const QCString &header,bool localNames) const
1160{
1161 bool found=FALSE;
1162 for (const auto &mod : *this)
1163 {
1164 toModuleDefImpl(mod)->writeDeclarationLink(ol,found,header,localNames);
1165 }
1166 if (found) ol.endMemberList();
1167}
1168
1169//------------------------------------------------------------------------------------------------------------
1170
1172{
1173 ModuleLinkedMap moduleFileMap; // file->module mapping
1174 std::unordered_map<std::string,ModuleList> moduleNameMap; // name->module mapping
1177 std::mutex mutex;
1178};
1179
1181{
1182 static ModuleManager m;
1183 return m;
1184}
1185
1187{
1188}
1189
1190void ModuleManager::createModuleDef(const QCString &fileName,int line,int column,bool exported,
1191 const QCString &moduleName,const QCString &partitionName)
1192{
1193 AUTO_TRACE("{}:{}: Found module name='{}' partition='{}' exported='{}'",
1194 fileName,line,moduleName,partitionName,exported);
1195 std::lock_guard lock(p->mutex);
1197 std::unique_ptr<ModuleDef> modDef = std::make_unique<ModuleDefImpl>(fileName,line,column,moduleName,mt,partitionName);
1198 auto mod = p->moduleFileMap.add(fileName,std::move(modDef));
1199 auto it = p->moduleNameMap.find(moduleName.str());
1200 if (it == p->moduleNameMap.end())
1201 {
1202 ModuleList ml;
1203 ml.push_back(mod);
1204 p->moduleNameMap.emplace(moduleName.str(),ml);
1205 }
1206 else
1207 {
1208 it->second.push_back(mod);
1209 }
1210}
1211
1213{
1214 std::lock_guard lock(p->mutex);
1215 p->headers.clear();
1216 p->externalImports.clear();
1217 p->moduleNameMap.clear();
1218 p->moduleFileMap.clear();
1219}
1220
1221void ModuleManager::addHeader(const QCString &moduleFile,int line,const QCString &headerName,bool isSystem)
1222{
1223 AUTO_TRACE("{}:{} headerName={} isSystem={}",moduleFile,line,headerName,isSystem);
1224 std::lock_guard lock(p->mutex);
1225 auto mod = p->moduleFileMap.find(moduleFile);
1226 if (mod)
1227 {
1228 toModuleDefImpl(mod)->addHeader(line,headerName,isSystem);
1229 }
1230 else
1231 {
1232 AUTO_TRACE_ADD("imported header '{}' found in file '{}' that is not a module",headerName,moduleFile);
1233 }
1234 p->headers.emplace_back(moduleFile,headerName,isSystem);
1235}
1236
1237void ModuleManager::addImport(const QCString &moduleFile,int line,const QCString &importName,
1238 bool isExported,const QCString &partitionName)
1239{
1240 AUTO_TRACE("{}:{} importName={},isExported={},partitionName={}",
1241 moduleFile,line,importName,isExported,partitionName);
1242 std::lock_guard lock(p->mutex);
1243 auto mod = p->moduleFileMap.find(moduleFile);
1244 if (mod) // import inside a module
1245 {
1246 AUTO_TRACE_ADD("in module");
1247 toModuleDefImpl(mod)->addImport(line,importName.isEmpty()?mod->name():importName,partitionName,isExported);
1248 }
1249 else // import outside of a module
1250 {
1251 AUTO_TRACE_ADD("outside module");
1252 p->externalImports[moduleFile.str()].emplace_back(nullptr,importName,line,partitionName);
1253 }
1254}
1255
1257{
1258 std::lock_guard lock(p->mutex);
1259 auto mod = p->moduleFileMap.find(root->fileName);
1260 if (mod)
1261 {
1262 toModuleDefImpl(mod)->addClassToModule(root,cd);
1263 auto cdm = toClassDefMutable(cd);
1264 if (cdm) cdm->setModuleDef(mod);
1265 }
1266}
1267
1269{
1270 std::lock_guard lock(p->mutex);
1271 auto mod = p->moduleFileMap.find(root->fileName);
1272 if (mod)
1273 {
1274 toModuleDefImpl(mod)->addConceptToModule(root,cd);
1275 auto cdm = toConceptDefMutable(cd);
1276 if (cdm) cdm->setModuleDef(mod);
1277 }
1278}
1279
1281{
1282 std::lock_guard lock(p->mutex);
1283 auto mod = p->moduleFileMap.find(root->fileName);
1284 if (mod && root->exported)
1285 {
1286 toModuleDefImpl(mod)->addMemberToModule(root,md);
1287 auto mdm = toMemberDefMutable(md);
1288 if (mdm) mdm->setModuleDef(mod);
1289 }
1290}
1291
1292void ModuleManager::addTagInfo(const QCString &fileName,const QCString &tagFile,const QCString &clangId)
1293{
1294 std::lock_guard lock(p->mutex);
1295 auto mod = p->moduleFileMap.find(fileName);
1296 if (mod)
1297 {
1298 ModuleDefImpl *modi = toModuleDefImpl(mod);
1299 modi->setReference(tagFile);
1300 modi->setId(clangId);
1301 }
1302}
1303
1305{
1306 AUTO_TRACE();
1307 for (auto &[partitionFileName,importInfoList] : mod->getImports()) // foreach import
1308 {
1309 for (auto &importInfo : importInfoList)
1310 {
1311 AUTO_TRACE_ADD("partitionFileName={} importName={} partitionName={}",
1312 partitionFileName,importInfo.importName,importInfo.partitionName);
1313 if (importInfo.importName==intfMod->name() && !importInfo.partitionName.isEmpty() &&
1314 importInfo.exported) // that is an exported partition of this module
1315 {
1316 auto it = p->moduleNameMap.find(importInfo.importName.str());
1317 if (it != p->moduleNameMap.end())
1318 {
1319 for (auto importedMod : it->second)
1320 {
1321 if (importedMod->qualifiedName()==importInfo.importName+":"+importInfo.partitionName)
1322 {
1323 AUTO_TRACE_ADD("Interface module {} exports partition {}:{}",
1324 mod->name(),importedMod->name(),importedMod->partitionName());
1325 toModuleDefImpl(intfMod)->addPartition(toModuleDefImpl(importedMod));
1326 toModuleDefImpl(importedMod)->setPrimaryInterface(intfMod);
1327 for (const auto &[partitionFileName_,partitionImportInfoList] : importedMod->getImports())
1328 {
1329 for (const auto &partitionImportInfo : partitionImportInfoList)
1330 {
1331 if (partitionImportInfo.exported && intfMod->name()!=partitionImportInfo.importName)
1332 {
1333 toModuleDefImpl(intfMod)->addExportedModule(partitionImportInfo.importName,partitionImportInfo);
1334 }
1335 }
1336 }
1337 resolvePartitionsRecursively(intfMod,importedMod);
1338 }
1339 }
1340 }
1341 }
1342 }
1343 }
1344}
1345
1347{
1348 AUTO_TRACE();
1349 for (auto &mod : p->moduleFileMap) // foreach module
1350 {
1351 if (mod->moduleType()==ModuleDef::Type::Interface && mod->partitionName().isEmpty())
1352 { // that is a primary interface
1353 resolvePartitionsRecursively(mod.get(),mod.get());
1354 }
1355
1356 // copy exported imports to m_exportedModules
1357 for (const auto &[fileName,importInfoList] : mod->getImports())
1358 {
1359 for (const auto &importInfo : importInfoList)
1360 {
1361 if (importInfo.exported && mod->name()!=importInfo.importName)
1362 {
1363 toModuleDefImpl(mod)->addExportedModule(importInfo.importName,importInfo);
1364 }
1365 }
1366 }
1367
1368 // also link the ModuleDef and FileDef together
1369 bool ambig = false;
1370 FileDef *fd = findFileDef(Doxygen::inputNameLinkedMap,mod->getDefFileName(),ambig);
1371 if (fd)
1372 {
1373 fd->setModuleDef(mod.get());
1374 toModuleDefImpl(mod)->setFileDef(fd);
1375 }
1376 }
1377}
1378
1380{
1381 AUTO_TRACE();
1382 for (auto &mod : p->moduleFileMap)
1383 {
1384 FileDef *fd = mod->getFileDef();
1385 if (fd)
1386 {
1387 for (const auto &[fileName,importInfoList] : mod->getImports())
1388 {
1389 for (const auto &importInfo : importInfoList)
1390 {
1391 ModuleDef *importedModule = getPrimaryInterface(importInfo.importName);
1392 const FileDef *importedFd = importedModule ? importedModule->getFileDef() : nullptr;
1393 AUTO_TRACE_ADD("module: addIncludeDependency {}->{}:{} fd={}",
1394 mod->qualifiedName(), importInfo.qualifiedName(), importInfo.line, fd?fd->absFilePath():"");
1396 }
1397 }
1398 }
1399 }
1400 for (const auto &[fileName,importInfoList] : p->externalImports)
1401 {
1402 for (const auto &importInfo : importInfoList)
1403 {
1404 bool ambig = false;
1406 AUTO_TRACE_ADD("externalImport name={} fd={}",fileName,(void*)fd);
1407 if (fd)
1408 {
1409 ModuleDef *mod = getPrimaryInterface(importInfo.importName);
1410 FileDef *importedFd = mod ? mod->getFileDef() : nullptr;
1411 fd->addIncludeDependency(importedFd,importInfo.importName,IncludeKind::ImportModule);
1412 if (importedFd)
1413 {
1415 }
1416 }
1417 }
1418 }
1419 for (const auto &headerInfo : p->headers)
1420 {
1421 bool ambig = false;
1422 FileDef *fd = findFileDef(Doxygen::inputNameLinkedMap,headerInfo.fileName,ambig);
1423 AUTO_TRACE_ADD("header name={} fd={}",headerInfo.fileName,(void*)fd);
1424 if (fd)
1425 {
1426 QCString resolvedHeader = determineAbsoluteIncludeName(headerInfo.fileName,headerInfo.headerName);
1427 FileDef *importFd = findFileDef(Doxygen::inputNameLinkedMap,resolvedHeader,ambig);
1428 fd->addIncludeDependency(importFd, headerInfo.headerName,
1429 headerInfo.isSystem ? IncludeKind::ImportSystem : IncludeKind::ImportLocal);
1430 if (importFd)
1431 {
1433 }
1434 }
1435 }
1436}
1437
1439{
1440 AUTO_TRACE("{}: collecting symbols for partition {}",intfMod->qualifiedName(),partitionMod->qualifiedName());
1441 auto intfModImpl = toModuleDefImpl(intfMod);
1442 auto partitionModImpl = toModuleDefImpl(partitionMod);
1443 intfModImpl->mergeSymbolsFrom(partitionModImpl);
1444}
1445
1447{
1448 AUTO_TRACE();
1449 for (auto &mod : p->moduleFileMap) // foreach module
1450 {
1451 if (mod->isPrimaryInterface()) // that is a primary interface
1452 {
1453 for (auto &[partitionName,partitionMod] : mod->partitions())
1454 {
1455 collectExportedSymbolsRecursively(mod.get(),partitionMod);
1456 }
1457
1458 // collect all files that contribute to this module (e.g. implementation/partition modules)
1459 auto it = p->moduleNameMap.find(mod->name().str());
1460 if (it != p->moduleNameMap.end())
1461 {
1462 for (auto contributingMod : it->second)
1463 {
1464 AUTO_TRACE_ADD(" adding contributing module {} to interface module {} type={} partition={} isPrimaryIntf={}",
1465 contributingMod->qualifiedName(),
1466 mod->name(),
1467 contributingMod->moduleType()==ModuleDef::Type::Interface ? "Interface" : "Implementation",
1468 contributingMod->partitionName(),
1469 contributingMod->isPrimaryInterface());
1471 }
1472 }
1473 }
1474 }
1475}
1476
1478{
1479 for (auto &mod : p->moduleFileMap) // foreach module
1480 {
1482 }
1483}
1484
1486{
1487 for (auto &mod : p->moduleFileMap) // foreach module
1488 {
1489 if (mod->isPrimaryInterface())
1490 {
1491 mod->writeDocumentation(ol);
1492 }
1493 }
1494}
1495
1497{
1498 int count=0;
1499 for (const auto &mod : p->moduleFileMap) // foreach module
1500 {
1501 if (mod->isPrimaryInterface()) count++;
1502 }
1503 return count;
1504}
1505
1507{
1508 return p->moduleFileMap;
1509}
1510
1512{
1513 AUTO_TRACE("file={} module={}",root->fileName,root->name);
1514 if (root->doc.isEmpty() && root->brief.isEmpty()) return;
1515 if (root->name.find(':')!=-1)
1516 {
1517 warn(root->fileName,root->startLine,"Ignoring documentation for module partition %s. Please place documentation at the primary module name",
1518 qPrint(root->name));
1519 }
1520 else
1521 {
1522 auto it = p->moduleNameMap.find(root->name.str());
1523 if (it != p->moduleNameMap.end())
1524 {
1525 ModuleDef *mod = getPrimaryInterface(root->name);
1526 if (mod)
1527 {
1528 mod->setDocumentation(root->doc,root->docFile,root->docLine);
1529 mod->setBriefDescription(root->brief,root->briefFile,root->briefLine);
1530 mod->setId(root->id);
1531 mod->setHidden(root->hidden);
1532 mod->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
1533 mod->setRefItems(root->sli);
1534 //mod->addSectionsToDefinition(root->anchors);
1535 addModuleToGroups(root,mod);
1536 }
1537 else
1538 {
1539 warn(root->fileName,root->startLine,"Found documentation for module %s but it has no primary interface unit.",qPrint(root->name));
1540 }
1541 }
1542 else
1543 {
1544 warn(root->fileName,root->startLine,"Found documentation for unknown module %s.",qPrint(root->name));
1545 }
1546 }
1547}
1548
1550{
1551 auto it = p->moduleNameMap.find(moduleName.str());
1552 if (it != p->moduleNameMap.end())
1553 {
1554 for (const auto &mod : it->second)
1555 {
1556 if (mod->isPrimaryInterface())
1557 {
1558 return mod;
1559 }
1560 }
1561 }
1562 return nullptr;
1563}
1564
1566{
1567 for (const auto &mod : p->moduleFileMap) // foreach module
1568 {
1569 if (mod->isPrimaryInterface()) toModuleDefImpl(mod)->addListReferences();
1570 }
1571}
1572
1574{
1575 for (const auto &mod : p->moduleFileMap) // foreach module
1576 {
1577 if (mod->isPrimaryInterface()) toModuleDefImpl(mod)->addMembersToMemberGroup();
1578 }
1579}
1580
1582{
1583 for (const auto &mod : p->moduleFileMap) // foreach module
1584 {
1585 if (mod->isPrimaryInterface()) toModuleDefImpl(mod)->distributeMemberGroupDocumentation();
1586 }
1587}
1588
1590{
1591 for (auto &mod : p->moduleFileMap) // foreach module
1592 {
1593 if (mod->isPrimaryInterface()) toModuleDefImpl(mod)->findSectionsInDocumentation();
1594 }
1595}
1596
1598{
1599 for (auto &mod : p->moduleFileMap) // foreach module
1600 {
1601 if (mod->isPrimaryInterface()) toModuleDefImpl(mod)->sortMemberLists();
1602 }
1603}
1604
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 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 void addIncludedByDependency(const FileDef *fd, const QCString &incName, IncludeKind kind)=0
virtual QCString getPath() const =0
virtual QCString absFilePath() const =0
virtual QCString fileName() 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:146
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:537
Text streaming class that buffers data.
Definition textstream.h:36
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:60
std::unordered_map< std::string, ImportInfoList > ImportInfoMap
Definition moduledef.h:61
int qstricmp_sort(const char *str1, const char *str2)
Definition qcstring.h:86
const char * qPrint(const char *s)
Definition qcstring.h:672
#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
Represents of a member declaration list with configurable title and subtitle.
Definition layout.h:109
QCString title(SrcLangExt lang) const
Definition layout.cpp:1533
MemberListType type
Definition layout.h:115
Represents of a member definition list with configurable title.
Definition layout.h:125
MemberListType type
Definition layout.h:130
QCString title(SrcLangExt lang) const
Definition layout.cpp:1545
Definition layout.h:99
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.