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 {
63 if (m_primaryInterface) return m_primaryInterface->isLinkableInProject();
64 else return isLinkable() && !isHidden() && !isReference(); }
65 bool isLinkable() const override {
66 if (m_primaryInterface) return m_primaryInterface->isLinkable();
67 else return hasDocumentation(); }
68 QCString qualifiedName() const override;
69 void writeSummaryLinks(OutputList &ol) const override;
70
71 // --- ModuleDef
72 Type moduleType() const override { return m_type; }
73 QCString partitionName() const override { return m_partitionName; }
74 void writeDocumentation(OutputList &ol) override;
75 bool isPrimaryInterface() const override { return m_type==Type::Interface && m_partitionName.isEmpty(); }
76 MemberList *getMemberList(MemberListType lt) const override;
77 const MemberLists &getMemberLists() const override { return m_memberLists; }
78 const MemberGroupList &getMemberGroups() const override { return m_memberGroups; }
79 const ClassLinkedRefMap &getClasses() const override { return m_classes; }
80 const ConceptLinkedRefMap &getConcepts() const override { return m_concepts; }
81 int countVisibleMembers() const override;
82 FileDef *getFileDef() const override { return m_fileDef; }
83 const ImportInfoMap &getImports() const override { return m_imports; }
84 const ImportInfoMap &getExports() const override { return m_exportedModules; }
85 const ModuleMap &partitions() const override { return m_partitions; }
86 void writeTagFile(TextStream &t) const override;
87 FileList getUsedFiles() const override;
88
89 void writeExports(OutputList &ol,const QCString &title);
90 void writeClassDeclarations(OutputList &ol,const QCString &title);
91 void writeConcepts(OutputList &ol,const QCString &title);
92 void writeFiles(OutputList &ol,const QCString &title);
97 void writeDetailedDescription(OutputList &ol,const QCString &title);
103 void writeDeclarationLink(OutputList &ol,bool &found,const QCString &header,bool localNames) const;
104
105 void addHeader(int line,const QCString &headerName,bool isSystem);
106 void addImport(int line,const QCString &moduleName,const QCString &partitionName,bool isExported);
107 void addClassToModule(const Entry *root,ClassDef *cd);
108 void addConceptToModule(const Entry *root,ConceptDef *cd);
109 void addMemberToModule(const Entry *root,MemberDef *md);
110 void addPartition(ModuleDefImpl *mod);
112 void setPrimaryInterface(const ModuleDef *mod);
113 void setFileDef(FileDef *fd);
115 void addExportedModule(const QCString &moduleName,const ImportInfo &info);
116 void addListReferences();
120 void sortMemberLists();
121
122 //ModuleMap &partitions() { return m_partitions; }
123 void mergeSymbolsFrom(ModuleDefImpl *other);
124 bool hasDetailedDescription() const;
125 void countMembers();
126
127 private:
139 FileDef *m_fileDef = nullptr; // file holding this module
140};
141
143{
144 return convertNameToFile("module_" + name());
145}
146
148{
149 QCString result=name();
150 if (!m_partitionName.isEmpty())
151 {
152 result+=":"+m_partitionName;
153 }
154 return result;
155}
156
158{
159 std::string qName = mod->qualifiedName().str();
160 if (m_partitions.find(qName)==m_partitions.end())
161 {
162 m_partitions.emplace(qName,mod);
163 }
164}
165
167{
168 if (std::find(m_contributing.begin(),m_contributing.end(),mod)==m_contributing.end())
169 {
170 m_contributing.push_back(mod);
171 }
172}
173
178
180{
181 m_fileDef = fd;
182}
183
184void ModuleDefImpl::addHeader(int line,const QCString &headerName,bool isSystem)
185{
186 AUTO_TRACE("name={}:line={},header={},isSystem={}",name(),line,headerName,isSystem);
187}
188
189void ModuleDefImpl::addImport(int line,const QCString &moduleName,const QCString &partitionName,bool isExported)
190{
191 AUTO_TRACE("name={}:line={},module={},partition={}",name(),line,moduleName,partitionName);
192 m_imports[getDefFileName().str()+":"+std::to_string(line)].push_back(ImportInfo(this,moduleName,line,partitionName,isExported));
193}
194
195void ModuleDefImpl::addExportedModule(const QCString &moduleName,const ImportInfo &info)
196{
197 AUTO_TRACE("name={}:moduleName={},import={}",name(),moduleName,info.importName);
198 m_exportedModules[moduleName.str()].push_back(info);
199}
200
202{
203 QCString className = cd->qualifiedName();
204 AUTO_TRACE("{}:{} class {} of module {} exported={}",
205 root->fileName,root->startLine, className, name(), root->exported);
206 bool isExported = m_classes.find(className)!=nullptr;
207 if (root->exported && !isExported)
208 {
209 m_classes.add(className,cd);
210 }
211 auto cdm = toClassDefMutable(cd);
212 if (cdm && root->exported && !cd->isExported())
213 {
214 cdm->setExported(true);
215 }
216}
217
219{
220 QCString conceptName = cd->qualifiedName();
221 AUTO_TRACE("{}:{} concept {} of module {} exported={}",
222 root->fileName,root->startLine,
223 cd->qualifiedName(),name(),
224 root->exported);
225 bool isExported = m_classes.find(conceptName)!=nullptr;
226 if (root->exported && !isExported)
227 {
228 m_concepts.add(conceptName,cd);
229 }
230 auto cdm = toConceptDefMutable(cd);
231 if (cdm && root->exported && !cd->isExported())
232 {
233 cdm->setExported(true);
234 }
235}
236
238{
239 for (auto &ml : m_memberLists)
240 {
241 if (ml->listType()==lt)
242 {
243 return ml.get();
244 }
245 }
246 return nullptr;
247}
248
250{
251 bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS);
252 bool sortMemberDocs = Config_getBool(SORT_MEMBER_DOCS);
254 ml->setNeedsSorting(
255 (ml->listType().isDeclaration() && sortBriefDocs) ||
256 (ml->listType().isDocumentation() && sortMemberDocs));
257 ml->push_back(md);
258 if (ml->listType().isDeclaration())
259 {
261 if (mdm)
262 {
263 mdm->setSectionList(this,ml.get());
264 }
265 }
266}
267
269{
270 AUTO_TRACE("{}:{} member {} of module {} exported={}",
271 qPrint(root->fileName),root->startLine,
273 root->exported);
274 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
275 if (allMemberList==nullptr)
276 {
277 m_memberLists.emplace_back(std::make_unique<MemberList>(MemberListType::AllMembersList(),MemberListContainer::Module));
278 allMemberList = m_memberLists.back().get();
279 }
280 if (allMemberList->contains(md))
281 {
282 return;
283 }
284 allMemberList->push_back(md);
285 switch (md->memberType())
286 {
288 addMemberToList(MemberListType::DecVarMembers(),md);
289 break;
291 addMemberToList(MemberListType::DecFuncMembers(),md);
292 break;
294 addMemberToList(MemberListType::DecTypedefMembers(),md);
295 break;
297 addMemberToList(MemberListType::DecEnumMembers(),md);
298 break;
299 default:
300 break;
301 }
302 auto mdm = toMemberDefMutable(md);
303 if (mdm && root->exported && !md->isExported())
304 {
305 mdm->setExported(true);
306 }
307}
308
310{
311 AUTO_TRACE("{} merging symbols of {} ({}:{})",
312 name(),other->qualifiedName(),other->getDefFileName(),other->getDefLine());
313 for (const auto &cd : other->getClasses())
314 {
315 m_classes.add(cd->qualifiedName(),cd);
316 }
317 for (const auto &cd : other->getConcepts())
318 {
319 m_concepts.add(cd->qualifiedName(),cd);
320 }
321 auto mergeMemberList = [this,other](MemberListType lt)
322 {
323 const auto srcMl = other->getMemberList(lt);
324 if (srcMl)
325 {
326 auto &dstMl = m_memberLists.get(lt,srcMl->container());
327 for (const auto &md : *srcMl)
328 {
329 dstMl->push_back(md);
330 }
331 }
332 };
333 mergeMemberList(MemberListType::DecVarMembers());
334 mergeMemberList(MemberListType::DecFuncMembers());
335 mergeMemberList(MemberListType::DecTypedefMembers());
336 mergeMemberList(MemberListType::DecEnumMembers());
337}
338
340{
341 if (isReference()) return;
343 AUTO_TRACE("%s file=%s",name(),getDefFileName());
344 SrcLangExt lang = getLanguage();
345 QCString pageTitle = theTranslator->trModuleReference(displayName());
347
348 // ---- title part
352
355 ol.parseText(pageTitle);
357
358 addGroupListToTitle(ol,this);
359
362 ol.endTitleHead(getOutputFileBase(),pageTitle);
364
368 ol.writeString(" - ");
369 ol.parseText(pageTitle);
371
372 ol.endHeaderSection();
373 ol.startContents();
374
375 //---------------------------------------- start flexible part -------------------------------
376 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Module))
377 {
378 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
379 switch (lde->kind())
380 {
381 case LayoutDocEntry::BriefDesc:
383 break;
384 case LayoutDocEntry::MemberDeclStart:
386 break;
387 case LayoutDocEntry::ModuleClasses:
388 if (ls) writeClassDeclarations(ol,ls->title(lang));
389 break;
390 case LayoutDocEntry::ModuleConcepts:
391 if (ls) writeConcepts(ol,ls->title(lang));
392 break;
393 case LayoutDocEntry::ModuleExports:
394 if (ls) writeExports(ol,ls->title(lang));
395 break;
396 case LayoutDocEntry::ModuleUsedFiles:
397 if (ls) writeFiles(ol,ls->title(lang));
398 break;
399 case LayoutDocEntry::MemberGroups:
401 break;
402 case LayoutDocEntry::MemberDecl:
403 {
404 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
405 if (lmd) writeMemberDeclarations(ol,lmd->type,lmd->title(lang));
406 }
407 break;
408 case LayoutDocEntry::MemberDeclEnd:
410 break;
411 case LayoutDocEntry::DetailedDesc:
412 if (ls) writeDetailedDescription(ol,ls->title(lang));
413 break;
414 case LayoutDocEntry::MemberDefStart:
416 break;
417 case LayoutDocEntry::MemberDef:
418 {
419 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
420 if (lmd) writeMemberDocumentation(ol,lmd->type,lmd->title(lang));
421 }
422 break;
423 case LayoutDocEntry::MemberDefEnd:
425 break;
426 case LayoutDocEntry::AuthorSection:
428 break;
429 case LayoutDocEntry::ClassIncludes:
430 case LayoutDocEntry::ClassInheritanceGraph:
431 case LayoutDocEntry::ClassNestedClasses:
432 case LayoutDocEntry::ClassCollaborationGraph:
433 case LayoutDocEntry::ClassAllMembersLink:
434 case LayoutDocEntry::ClassUsedFiles:
435 case LayoutDocEntry::ClassInlineClasses:
436 case LayoutDocEntry::FileClasses:
437 case LayoutDocEntry::FileConcepts:
438 case LayoutDocEntry::FileInterfaces:
439 case LayoutDocEntry::FileStructs:
440 case LayoutDocEntry::FileExceptions:
441 case LayoutDocEntry::FileNamespaces:
442 case LayoutDocEntry::FileConstantGroups:
443 case LayoutDocEntry::FileIncludes:
444 case LayoutDocEntry::FileIncludeGraph:
445 case LayoutDocEntry::FileIncludedByGraph:
446 case LayoutDocEntry::FileInlineClasses:
447 case LayoutDocEntry::FileSourceLink:
448 case LayoutDocEntry::NamespaceNestedNamespaces:
449 case LayoutDocEntry::NamespaceNestedConstantGroups:
450 case LayoutDocEntry::NamespaceClasses:
451 case LayoutDocEntry::NamespaceConcepts:
452 case LayoutDocEntry::NamespaceInterfaces:
453 case LayoutDocEntry::NamespaceStructs:
454 case LayoutDocEntry::NamespaceExceptions:
455 case LayoutDocEntry::NamespaceInlineClasses:
456 case LayoutDocEntry::ConceptDefinition:
457 case LayoutDocEntry::GroupClasses:
458 case LayoutDocEntry::GroupConcepts:
459 case LayoutDocEntry::GroupModules:
460 case LayoutDocEntry::GroupInlineClasses:
461 case LayoutDocEntry::GroupNamespaces:
462 case LayoutDocEntry::GroupDirs:
463 case LayoutDocEntry::GroupNestedGroups:
464 case LayoutDocEntry::GroupFiles:
465 case LayoutDocEntry::GroupGraph:
466 case LayoutDocEntry::GroupPageDocs:
467 case LayoutDocEntry::DirSubDirs:
468 case LayoutDocEntry::DirFiles:
469 case LayoutDocEntry::DirGraph:
470 err("Internal inconsistency: member '{}' should not be part of "
471 "LayoutDocManager::Module entry list\n",lde->entryToString());
472 break;
473 }
474 }
475
476 //---------------------------------------- end flexible part -------------------------------
477 endFile(ol);
478
480}
481
483{
484 m_classes.writeDeclaration(ol,nullptr,title,FALSE);
485}
486
488{
489 m_concepts.writeDeclaration(ol,title,FALSE);
490}
491
496
501
503{
504 if (Config_getBool(SEPARATE_MEMBER_PAGES))
505 {
508 }
509}
510
512{
513 if (Config_getBool(SEPARATE_MEMBER_PAGES))
514 {
517 }
518}
519
521{
523 {
526 ol.writeRuler();
530 ol.writeAnchor(QCString(),"details");
532 ol.startGroupHeader();
533 ol.parseText(title);
534 ol.endGroupHeader();
535
536 ol.startTextBlock();
537 if (!briefDescription().isEmpty() && Config_getBool(REPEAT_BRIEF))
538 {
540 QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
541 }
542 if (!briefDescription().isEmpty() && Config_getBool(REPEAT_BRIEF) &&
543 !documentation().isEmpty())
544 {
548 ol.enableAll();
551 ol.writeString("\n\n");
553 }
554 if (!documentation().isEmpty())
555 {
556 ol.generateDoc(docFile(),docLine(),this,nullptr,documentation()+"\n",TRUE,FALSE,
557 QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
558 }
559 ol.endTextBlock();
560 }
561}
562
564{
566 {
567 auto parser { createDocParser() };
568 auto ast { validatingParseDoc(*parser.get(),
569 briefFile(),briefLine(),this,nullptr,
571 QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT)) };
572 if (!ast->isEmpty())
573 {
574 ol.startParagraph();
577 ol.writeString(" - ");
579 ol.writeDoc(ast.get(),this,nullptr);
582 ol.writeString(" \n");
584
586 {
588 ol.startTextLink(QCString(),"details");
589 ol.parseText(theTranslator->trMore());
590 ol.endTextLink();
591 }
593 ol.endParagraph();
594 }
595 }
596 ol.writeSynopsis();
597}
598
600{
601 for (const auto &mg : m_memberGroups)
602 {
603 mg->writeDeclarations(ol,nullptr,nullptr,nullptr,nullptr,this);
604 }
605}
606
608{
609 MemberList * ml = getMemberList(lt);
610 if (ml) ml->writeDeclarations(ol,nullptr,nullptr,nullptr,nullptr,this,title,QCString());
611}
612
614{
615 MemberList * ml = getMemberList(lt);
616 if (ml) ml->writeDocumentation(ol,name(),this,title);
617}
618
620{
621 // write Author section (Man only)
624 ol.startGroupHeader();
625 ol.parseText(theTranslator->trAuthor(TRUE,TRUE));
626 ol.endGroupHeader();
627 ol.parseText(theTranslator->trGeneratedAutomatically(Config_getString(PROJECT_NAME)));
629}
630
632{
633 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
634 return (!briefDescription().isEmpty() && repeatBrief) || !documentation().isEmpty();
635}
636
638{
639 for (auto &ml : m_memberLists)
640 {
641 ml->countDecMembers();
642 ml->countDocMembers();
643 }
644 for (const auto &mg : m_memberGroups)
645 {
646 mg->countDecMembers();
647 mg->countDocMembers();
648 }
649}
650
652{
653 const RefItemVector &xrefItems = xrefListItems();
654 addRefItem(xrefItems,
657 theTranslator->trModule(TRUE,TRUE) :
658 theTranslator->trNamespace(TRUE,TRUE),
660 QCString(),
661 this
662 );
663 for (const auto &mg : m_memberGroups)
664 {
665 mg->addListReferences(this);
666 }
667 for (auto &ml : m_memberLists)
668 {
669 if (ml->listType().isDocumentation())
670 {
671 ml->addListReferences(this);
672 }
673 }
674}
675
677{
678 for (auto &ml : m_memberLists)
679 {
680 if (ml->listType().isDeclaration())
681 {
683 }
684 }
685
686 // add members inside sections to their groups
687 for (const auto &mg : m_memberGroups)
688 {
689 if (mg->allMembersInSameSection() && Config_getBool(SUBGROUPING))
690 {
691 //printf("----> addToDeclarationSection(%s)\n",qPrint(mg->header()));
692 mg->addToDeclarationSection();
693 }
694 }
695}
696
698{
699 for (const auto &mg : m_memberGroups)
700 {
701 mg->distributeMemberGroupDocumentation();
702 }
703}
704
706{
710 for (const auto &mg : m_memberGroups)
711 {
712 mg->findSectionsInDocumentation(this);
713 }
714 for (auto &ml : m_memberLists)
715 {
716 if (ml->listType().isDeclaration())
717 {
718 ml->findSectionsInDocumentation(this);
719 }
720 }
721}
722
724{
725 for (auto &ml : m_memberLists)
726 {
727 if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(FALSE); }
728 }
729
730 if (Config_getBool(SORT_BRIEF_DOCS))
731 {
732 auto classComp = [](const ClassLinkedRefMap::Ptr &c1,const ClassLinkedRefMap::Ptr &c2)
733 {
734 return Config_getBool(SORT_BY_SCOPE_NAME) ?
735 qstricmp_sort(c1->name(), c2->name())<0 :
736 qstricmp_sort(c1->className(), c2->className())<0;
737 };
738 std::stable_sort(m_classes.begin(), m_classes.end(), classComp);
739
740 auto conceptComp = [](const ConceptLinkedRefMap::Ptr &c1,const ConceptLinkedRefMap::Ptr &c2)
741 {
742 return Config_getBool(SORT_BY_SCOPE_NAME) ?
743 qstricmp_sort(c1->qualifiedName(), c2->qualifiedName())<0 :
744 qstricmp_sort(c1->name(), c2->name())<0;
745 };
746 std::stable_sort(m_concepts.begin(), m_concepts.end(), conceptComp);
747 }
748
749 static auto contrComp = [](const ModuleDef *m1, const ModuleDef *m2)
750 {
751 FileDef *f1 = m1->getFileDef();
752 FileDef *f2 = m2->getFileDef();
753 QCString fn1 = f1 ? f1->name() : m1->name();
754 QCString fn2 = f2 ? f2->name() : m2->name();
755 static auto typeRank = [](const ModuleDef *m) -> int
756 {
757 if (m->moduleType()==ModuleDef::Type::Interface)
758 {
759 if (m->partitionName().isEmpty()) return 0; // primary interface unit
760 return 1; // partition interface unit
761 }
762 else
763 {
764 if (!m->partitionName().isEmpty()) return 2; // partition implementation unit
765 return 3; // implementation unit
766 }
767 };
768 auto tr1 = typeRank(m1);
769 auto tr2 = typeRank(m2);
770 int diff = qstricmp_sort(fn1,fn2);
771 return tr1<tr2 || (tr1==tr2 && diff<0);
772 };
773
774 std::stable_sort(m_contributing.begin(), m_contributing.end(), contrComp);
775}
776
778{
781 bool first=TRUE;
782 SrcLangExt lang=getLanguage();
783 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Module))
784 {
785 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
786 if (lde->kind()==LayoutDocEntry::ModuleClasses && m_classes.declVisible() && ls)
787 {
788 QCString label = "classes";
789 ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
790 first=FALSE;
791 }
792 else if (lde->kind()==LayoutDocEntry::ModuleConcepts && m_concepts.declVisible() && ls)
793 {
794 QCString label = "concepts";
795 ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
796 first=FALSE;
797 }
798 else if (lde->kind()==LayoutDocEntry::ModuleUsedFiles && ls)
799 {
800 QCString label = "files";
801 ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
802 first=FALSE;
803 }
804 else if (lde->kind()==LayoutDocEntry::MemberDecl)
805 {
806 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
807 if (lmd)
808 {
809 MemberList * ml = getMemberList(lmd->type);
810 if (ml && ml->declVisible())
811 {
812 ol.writeSummaryLink(QCString(),ml->listType().toLabel(),lmd->title(lang),first);
813 first=FALSE;
814 }
815 }
816 }
817 }
818 if (!first)
819 {
820 ol.writeString(" </div>\n");
821 }
823}
824
825void ModuleDefImpl::writeDeclarationLink(OutputList &ol,bool &found,const QCString &header,bool localNames) const
826{
827 if (isLinkable())
828 {
829 if (!found) // first module
830 {
831 ol.startMemberHeader("modules");
832 if (!header.isEmpty())
833 {
834 ol.parseText(header);
835 }
836 else
837 {
838 theTranslator->trModule(true,false);
839 }
840 ol.endMemberHeader();
841 ol.startMemberList();
842 found=TRUE;
843 }
846 ol.writeString("module ");
847 QCString cname = displayName(!localNames);
849 if (isLinkable())
850 {
853 anchor(),
854 cname
855 );
856 }
857 else
858 {
859 ol.startBold();
860 ol.docify(cname);
861 ol.endBold();
862 }
864 // add the brief description if available
865 if (!briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
866 {
867 auto parser { createDocParser() };
868 auto ast { validatingParseDoc(
869 *parser.get(),briefFile(),briefLine(),this,nullptr,
871 QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT)) };
872 if (!ast->isEmpty())
873 {
875 ol.writeDoc(ast.get(),this,nullptr);
877 }
878 }
880 }
881}
882
883
885{
886 AUTO_TRACE("name={} count={}",name(),m_exportedModules.size());
887 if (!m_exportedModules.empty())
888 {
889 ol.startMemberHeader("exports");
890 ol.parseText(title);
891 ol.endMemberHeader();
892 ol.startMemberList();
893 for (const auto &[moduleName,importInfoList] : m_exportedModules)
894 {
895 for (const auto &importInfo : importInfoList)
896 {
897 ModuleDef *mod = ModuleManager::instance().getPrimaryInterface(importInfo.importName);
900 ol.docify(theTranslator->trModule(FALSE,TRUE)+" ");
902 if (mod && mod->isLinkable())
903 {
905 }
906 else
907 {
908 ol.startBold();
909 ol.docify(importInfo.importName);
910 ol.endBold();
911 }
913 if (mod && !mod->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
914 {
916 ol.generateDoc(briefFile(),briefLine(),mod,nullptr,mod->briefDescription(),FALSE,FALSE,
917 QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
919 }
921 }
922 }
923 ol.endMemberList();
924 }
925}
926
928{
929 AUTO_TRACE("{} count={}",name(),m_contributing.size());
930 if (!m_contributing.empty())
931 {
932 ol.startMemberHeader("files");
933 ol.parseText(title);
934 ol.endMemberHeader();
935 ol.startMemberList();
936 for (const auto &mod : m_contributing)
937 {
938 FileDef *fd = mod->getFileDef();
939 if (fd)
940 {
943 ol.docify(theTranslator->trFile(FALSE,TRUE)+" ");
945 QCString path=fd->getPath();
946 if (Config_getBool(FULL_PATH_NAMES))
947 {
948 ol.docify(stripFromPath(path));
949 }
950 if (fd->isLinkable())
951 {
953 }
954 else
955 {
956 ol.startBold();
957 ol.docify(fd->displayName());
958 ol.endBold();
959 }
961 if (!fd->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
962 {
965 QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
967 }
969 }
970 }
971 ol.endMemberList();
972 }
973}
974
976{
977 FileList result;
978 for (const auto &mod : m_contributing)
979 {
980 FileDef *fd = mod->getFileDef();
981 if (fd) result.push_back(fd);
982 }
983 return result;
984}
985
987{
988 int count=0;
989 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Module))
990 {
991 if (lde->kind()==LayoutDocEntry::MemberDecl)
992 {
993 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
994 if (lmd)
995 {
996 MemberList *ml = getMemberList(lmd->type);
997 if (ml)
998 {
999 for (const auto &md : *ml)
1000 {
1001 if (md->visibleInIndex())
1002 {
1003 count++;
1004 }
1005 }
1006 }
1007 }
1008 }
1009 else if (lde->kind()==LayoutDocEntry::ModuleClasses)
1010 {
1011 for (const auto &cd : getClasses())
1012 {
1013 if (cd->isLinkableInProject())
1014 {
1015 count++;
1016 }
1017 }
1018 }
1019 else if (lde->kind()==LayoutDocEntry::ModuleConcepts)
1020 {
1021 for (const auto &cd : getConcepts())
1022 {
1023 if (cd->isLinkableInProject())
1024 {
1025 count++;
1026 }
1027 }
1028 }
1029 }
1030 return count;
1031}
1032
1034{
1035 if (!isPrimaryInterface() || !isLinkableInProject()) return;
1036 tagFile << " <compound kind=\"module\">\n";
1037 tagFile << " <name>" << convertToXML(name()) << "</name>\n";
1038 const FileDef *fd = getFileDef();
1039 QCString fn = fd ? fd->getOutputFileBase() : getOutputFileBase();
1041 tagFile << " <filename>" << convertToXML(fn) << "</filename>\n";
1042#if 0 // at the moment we do not export the members of a module to a tag file.
1043 // We let the project using a tag file directly link to the implementation of the
1044 // symbols (which have the same scope).
1045 //
1046 // When we support linking to a module's interface instead we need to
1047 // export the module's members as well. Then we probably need a way to
1048 // disambiguate/prioritize a link to a module over a link to the implementation,
1049 // for instance by hiding non-exported symbols from the tag file.
1050 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Group))
1051 {
1052 switch (lde->kind())
1053 {
1054 case LayoutDocEntry::ModuleExports:
1055 {
1056 for (const auto &[modName,importInfo] : m_exportedModules)
1057 {
1058 tagFile << " <export>" << convertToXML(importInfo.importName) << "</export>\n";
1059 }
1060 }
1061 break;
1062 case LayoutDocEntry::ModuleClasses:
1063 {
1064 for (const auto &cd : m_classes)
1065 {
1066 if (cd->isLinkableInProject())
1067 {
1068 tagFile << " <class kind=\"" << cd->compoundTypeString()
1069 << "\">" << convertToXML(cd->name()) << "</class>\n";
1070 }
1071 }
1072 }
1073 break;
1074 case LayoutDocEntry::ModuleConcepts:
1075 {
1076 for (const auto &cd : m_concepts)
1077 {
1078 if (cd->isLinkableInProject())
1079 {
1080 tagFile << " <concept>" << convertToXML(cd->name())
1081 << "</concept>\n";
1082 }
1083 }
1084 }
1085 break;
1086 case LayoutDocEntry::ModuleUsedFiles:
1087 {
1088 for (const auto &usedFd : getUsedFiles())
1089 {
1090 if (usedFd->isLinkableInProject())
1091 {
1092 tagFile << " <file>" << convertToXML(usedFd->name()) << "</file>\n";
1093 }
1094 }
1095 }
1096 break;
1097 case LayoutDocEntry::MemberDecl:
1098 {
1099 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
1100 if (lmd && lmd->visible())
1101 {
1102 MemberList * ml = getMemberList(lmd->type);
1103 if (ml)
1104 {
1105 ml->writeTagFile(tagFile,true);
1106 }
1107 }
1108 }
1109 break;
1110 default:
1111 break;
1112 }
1113 }
1114#endif
1115 QCString idStr = id();
1116 if (!idStr.isEmpty())
1117 {
1118 tagFile << " <clangid>" << convertToXML(idStr) << "</clangid>\n";
1119 }
1120 writeDocAnchorsToTagFile(tagFile);
1121 tagFile << " </compound>\n";
1122}
1123
1124//------------------------------------------------------------------------------------------------------------
1125
1127{
1128 if (d==nullptr) return nullptr;
1129 return (typeid(*d)==typeid(ModuleDefImpl)) ? static_cast<ModuleDef*>(d) : nullptr;
1130}
1131
1133{
1134 if (d==nullptr) return nullptr;
1135 return (typeid(*d)==typeid(ModuleDefImpl)) ? static_cast<const ModuleDef*>(d) : nullptr;
1136}
1137
1139{ return static_cast<ModuleDefImpl*>(m); }
1140
1141//static inline const ModuleDefImpl *toModuleDefImpl(const ModuleDef *m)
1142//{ return static_cast<const ModuleDefImpl*>(m); }
1143
1144static inline ModuleDefImpl *toModuleDefImpl(const std::unique_ptr<ModuleDef> &m)
1145{ return static_cast<ModuleDefImpl*>(m.get()); }
1146
1147//------------------------------------------------------------------------------------
1148
1150{
1151 bool hideUndocClasses = Config_getBool(HIDE_UNDOC_CLASSES);
1152 for (const auto &mod : *this)
1153 {
1154 bool isLink = mod->isLinkable();
1155 if (isLink || !hideUndocClasses)
1156 {
1157 return true;
1158 }
1159 }
1160 return false;
1161}
1162
1163void ModuleLinkedRefMap::writeDeclaration(OutputList &ol,const QCString &header,bool localNames) const
1164{
1165 bool found=FALSE;
1166 for (const auto &mod : *this)
1167 {
1168 toModuleDefImpl(mod)->writeDeclarationLink(ol,found,header,localNames);
1169 }
1170 if (found) ol.endMemberList();
1171}
1172
1173//------------------------------------------------------------------------------------------------------------
1174
1176{
1177 ModuleLinkedMap moduleFileMap; // file->module mapping
1178 std::unordered_map<std::string,ModuleList> moduleNameMap; // name->module mapping
1181 std::mutex mutex;
1182};
1183
1185{
1186 static ModuleManager m;
1187 return m;
1188}
1189
1191{
1192}
1193
1194void ModuleManager::createModuleDef(const QCString &fileName,int line,int column,bool exported,
1195 const QCString &moduleName,const QCString &partitionName)
1196{
1197 AUTO_TRACE("{}:{}: Found module name='{}' partition='{}' exported='{}'",
1198 fileName,line,moduleName,partitionName,exported);
1199 std::lock_guard lock(p->mutex);
1201 std::unique_ptr<ModuleDef> modDef = std::make_unique<ModuleDefImpl>(fileName,line,column,moduleName,mt,partitionName);
1202 auto mod = p->moduleFileMap.add(fileName,std::move(modDef));
1203 auto it = p->moduleNameMap.find(moduleName.str());
1204 if (it == p->moduleNameMap.end())
1205 {
1206 ModuleList ml;
1207 ml.push_back(mod);
1208 p->moduleNameMap.emplace(moduleName.str(),ml);
1209 }
1210 else
1211 {
1212 it->second.push_back(mod);
1213 }
1214}
1215
1217{
1218 std::lock_guard lock(p->mutex);
1219 p->headers.clear();
1220 p->externalImports.clear();
1221 p->moduleNameMap.clear();
1222 p->moduleFileMap.clear();
1223}
1224
1225void ModuleManager::addHeader(const QCString &moduleFile,int line,const QCString &headerName,bool isSystem)
1226{
1227 AUTO_TRACE("{}:{} headerName={} isSystem={}",moduleFile,line,headerName,isSystem);
1228 std::lock_guard lock(p->mutex);
1229 auto mod = p->moduleFileMap.find(moduleFile);
1230 if (mod)
1231 {
1232 toModuleDefImpl(mod)->addHeader(line,headerName,isSystem);
1233 }
1234 else
1235 {
1236 AUTO_TRACE_ADD("imported header '{}' found in file '{}' that is not a module",headerName,moduleFile);
1237 }
1238 p->headers.emplace_back(moduleFile,headerName,isSystem);
1239}
1240
1241void ModuleManager::addImport(const QCString &moduleFile,int line,const QCString &importName,
1242 bool isExported,const QCString &partitionName)
1243{
1244 AUTO_TRACE("{}:{} importName={},isExported={},partitionName={}",
1245 moduleFile,line,importName,isExported,partitionName);
1246 std::lock_guard lock(p->mutex);
1247 auto mod = p->moduleFileMap.find(moduleFile);
1248 if (mod) // import inside a module
1249 {
1250 AUTO_TRACE_ADD("in module");
1251 toModuleDefImpl(mod)->addImport(line,importName.isEmpty()?mod->name():importName,partitionName,isExported);
1252 }
1253 else // import outside of a module
1254 {
1255 AUTO_TRACE_ADD("outside module");
1256 p->externalImports[moduleFile.str()].emplace_back(nullptr,importName,line,partitionName);
1257 }
1258}
1259
1261{
1262 std::lock_guard lock(p->mutex);
1263 auto mod = p->moduleFileMap.find(root->fileName);
1264 if (mod)
1265 {
1266 toModuleDefImpl(mod)->addClassToModule(root,cd);
1267 auto cdm = toClassDefMutable(cd);
1268 if (cdm) cdm->setModuleDef(mod);
1269 }
1270}
1271
1273{
1274 std::lock_guard lock(p->mutex);
1275 auto mod = p->moduleFileMap.find(root->fileName);
1276 if (mod)
1277 {
1278 toModuleDefImpl(mod)->addConceptToModule(root,cd);
1279 auto cdm = toConceptDefMutable(cd);
1280 if (cdm) cdm->setModuleDef(mod);
1281 }
1282}
1283
1285{
1286 std::lock_guard lock(p->mutex);
1287 auto mod = p->moduleFileMap.find(root->fileName);
1288 if (mod && root->exported)
1289 {
1290 toModuleDefImpl(mod)->addMemberToModule(root,md);
1291 auto mdm = toMemberDefMutable(md);
1292 if (mdm) mdm->setModuleDef(mod);
1293 }
1294}
1295
1296void ModuleManager::addTagInfo(const QCString &fileName,const QCString &tagFile,const QCString &clangId)
1297{
1298 std::lock_guard lock(p->mutex);
1299 auto mod = p->moduleFileMap.find(fileName);
1300 if (mod)
1301 {
1302 ModuleDefImpl *modi = toModuleDefImpl(mod);
1303 modi->setReference(tagFile);
1304 modi->setId(clangId);
1305 }
1306}
1307
1309{
1310 AUTO_TRACE();
1311 for (auto &[partitionFileName,importInfoList] : mod->getImports()) // foreach import
1312 {
1313 for (auto &importInfo : importInfoList)
1314 {
1315 AUTO_TRACE_ADD("partitionFileName={} importName={} partitionName={}",
1316 partitionFileName,importInfo.importName,importInfo.partitionName);
1317 if (importInfo.importName==intfMod->name() && !importInfo.partitionName.isEmpty() &&
1318 importInfo.exported) // that is an exported partition of this module
1319 {
1320 auto it = p->moduleNameMap.find(importInfo.importName.str());
1321 if (it != p->moduleNameMap.end())
1322 {
1323 for (auto importedMod : it->second)
1324 {
1325 if (importedMod->qualifiedName()==importInfo.importName+":"+importInfo.partitionName)
1326 {
1327 AUTO_TRACE_ADD("Interface module {} exports partition {}:{}",
1328 mod->name(),importedMod->name(),importedMod->partitionName());
1329 toModuleDefImpl(intfMod)->addPartition(toModuleDefImpl(importedMod));
1330 toModuleDefImpl(importedMod)->setPrimaryInterface(intfMod);
1331 for (const auto &[partitionFileName_,partitionImportInfoList] : importedMod->getImports())
1332 {
1333 for (const auto &partitionImportInfo : partitionImportInfoList)
1334 {
1335 if (partitionImportInfo.exported && intfMod->name()!=partitionImportInfo.importName)
1336 {
1337 toModuleDefImpl(intfMod)->addExportedModule(partitionImportInfo.importName,partitionImportInfo);
1338 }
1339 }
1340 }
1341 resolvePartitionsRecursively(intfMod,importedMod);
1342 }
1343 }
1344 }
1345 }
1346 }
1347 }
1348}
1349
1351{
1352 AUTO_TRACE();
1353 for (auto &mod : p->moduleFileMap) // foreach module
1354 {
1355 if (mod->moduleType()==ModuleDef::Type::Interface && mod->partitionName().isEmpty())
1356 { // that is a primary interface
1357 resolvePartitionsRecursively(mod.get(),mod.get());
1358 }
1359
1360 // copy exported imports to m_exportedModules
1361 for (const auto &[fileName,importInfoList] : mod->getImports())
1362 {
1363 for (const auto &importInfo : importInfoList)
1364 {
1365 if (importInfo.exported && mod->name()!=importInfo.importName)
1366 {
1367 toModuleDefImpl(mod)->addExportedModule(importInfo.importName,importInfo);
1368 }
1369 }
1370 }
1371
1372 // also link the ModuleDef and FileDef together
1373 bool ambig = false;
1374 FileDef *fd = findFileDef(Doxygen::inputNameLinkedMap,mod->getDefFileName(),ambig);
1375 if (fd)
1376 {
1377 fd->setModuleDef(mod.get());
1378 toModuleDefImpl(mod)->setFileDef(fd);
1379 }
1380 }
1381}
1382
1384{
1385 AUTO_TRACE();
1386 for (auto &mod : p->moduleFileMap)
1387 {
1388 FileDef *fd = mod->getFileDef();
1389 if (fd)
1390 {
1391 for (const auto &[fileName,importInfoList] : mod->getImports())
1392 {
1393 for (const auto &importInfo : importInfoList)
1394 {
1395 ModuleDef *importedModule = getPrimaryInterface(importInfo.importName);
1396 const FileDef *importedFd = importedModule ? importedModule->getFileDef() : nullptr;
1397 AUTO_TRACE_ADD("module: addIncludeDependency {}->{}:{} fd={}",
1398 mod->qualifiedName(), importInfo.qualifiedName(), importInfo.line, fd?fd->absFilePath():"");
1400 }
1401 }
1402 }
1403 }
1404 for (const auto &[fileName,importInfoList] : p->externalImports)
1405 {
1406 for (const auto &importInfo : importInfoList)
1407 {
1408 bool ambig = false;
1410 AUTO_TRACE_ADD("externalImport name={} fd={}",fileName,(void*)fd);
1411 if (fd)
1412 {
1413 ModuleDef *mod = getPrimaryInterface(importInfo.importName);
1414 FileDef *importedFd = mod ? mod->getFileDef() : nullptr;
1415 fd->addIncludeDependency(importedFd,importInfo.importName,IncludeKind::ImportModule);
1416 if (importedFd)
1417 {
1419 }
1420 }
1421 }
1422 }
1423 for (const auto &headerInfo : p->headers)
1424 {
1425 bool ambig = false;
1426 FileDef *fd = findFileDef(Doxygen::inputNameLinkedMap,headerInfo.fileName,ambig);
1427 AUTO_TRACE_ADD("header name={} fd={}",headerInfo.fileName,(void*)fd);
1428 if (fd)
1429 {
1430 QCString resolvedHeader = determineAbsoluteIncludeName(headerInfo.fileName,headerInfo.headerName);
1431 FileDef *importFd = findFileDef(Doxygen::inputNameLinkedMap,resolvedHeader,ambig);
1432 fd->addIncludeDependency(importFd, headerInfo.headerName,
1433 headerInfo.isSystem ? IncludeKind::ImportSystem : IncludeKind::ImportLocal);
1434 if (importFd)
1435 {
1437 }
1438 }
1439 }
1440}
1441
1443{
1444 AUTO_TRACE("{}: collecting symbols for partition {}",intfMod->qualifiedName(),partitionMod->qualifiedName());
1445 auto intfModImpl = toModuleDefImpl(intfMod);
1446 auto partitionModImpl = toModuleDefImpl(partitionMod);
1447 intfModImpl->mergeSymbolsFrom(partitionModImpl);
1448}
1449
1451{
1452 AUTO_TRACE();
1453 for (auto &mod : p->moduleFileMap) // foreach module
1454 {
1455 if (mod->isPrimaryInterface()) // that is a primary interface
1456 {
1457 for (auto &[partitionName,partitionMod] : mod->partitions())
1458 {
1459 collectExportedSymbolsRecursively(mod.get(),partitionMod);
1460 }
1461
1462 // collect all files that contribute to this module (e.g. implementation/partition modules)
1463 auto it = p->moduleNameMap.find(mod->name().str());
1464 if (it != p->moduleNameMap.end())
1465 {
1466 for (auto contributingMod : it->second)
1467 {
1468 AUTO_TRACE_ADD(" adding contributing module {} to interface module {} type={} partition={} isPrimaryIntf={}",
1469 contributingMod->qualifiedName(),
1470 mod->name(),
1471 contributingMod->moduleType()==ModuleDef::Type::Interface ? "Interface" : "Implementation",
1472 contributingMod->partitionName(),
1473 contributingMod->isPrimaryInterface());
1475 }
1476 }
1477 }
1478 }
1479}
1480
1482{
1483 for (auto &mod : p->moduleFileMap) // foreach module
1484 {
1486 }
1487}
1488
1490{
1491 for (auto &mod : p->moduleFileMap) // foreach module
1492 {
1493 if (mod->isPrimaryInterface())
1494 {
1495 mod->writeDocumentation(ol);
1496 }
1497 }
1498}
1499
1501{
1502 int count=0;
1503 for (const auto &mod : p->moduleFileMap) // foreach module
1504 {
1505 if (mod->isPrimaryInterface()) count++;
1506 }
1507 return count;
1508}
1509
1511{
1512 return p->moduleFileMap;
1513}
1514
1516{
1517 return p->moduleFileMap;
1518}
1519
1521{
1522 AUTO_TRACE("file={} module={}",root->fileName,root->name);
1523 if (root->doc.isEmpty() && root->brief.isEmpty()) return;
1524 if (root->name.find(':')!=-1)
1525 {
1526 warn(root->fileName,root->startLine,"Ignoring documentation for module partition {}. Please place documentation at the primary module name",
1527 root->name);
1528 }
1529 else
1530 {
1531 auto it = p->moduleNameMap.find(root->name.str());
1532 if (it != p->moduleNameMap.end())
1533 {
1534 ModuleDef *mod = getPrimaryInterface(root->name);
1535 if (mod)
1536 {
1537 mod->setDocumentation(root->doc,root->docFile,root->docLine);
1538 mod->setBriefDescription(root->brief,root->briefFile,root->briefLine);
1539 mod->setId(root->id);
1540 mod->setHidden(root->hidden);
1541 mod->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
1542 mod->setRefItems(root->sli);
1543 //mod->addSectionsToDefinition(root->anchors);
1544 addModuleToGroups(root,mod);
1545 }
1546 else
1547 {
1548 warn(root->fileName,root->startLine,"Found documentation for module {} but it has no primary interface unit.",root->name);
1549 }
1550 }
1551 else
1552 {
1553 warn(root->fileName,root->startLine,"Found documentation for unknown module {}.",root->name);
1554 }
1555 }
1556}
1557
1559{
1560 auto it = p->moduleNameMap.find(moduleName.str());
1561 if (it != p->moduleNameMap.end())
1562 {
1563 for (const auto &mod : it->second)
1564 {
1565 if (mod->isPrimaryInterface())
1566 {
1567 return mod;
1568 }
1569 }
1570 }
1571 return nullptr;
1572}
1573
1575{
1576 for (const auto &mod : p->moduleFileMap) // foreach module
1577 {
1578 if (mod->isPrimaryInterface()) toModuleDefImpl(mod)->addListReferences();
1579 }
1580}
1581
1583{
1584 for (const auto &mod : p->moduleFileMap) // foreach module
1585 {
1586 if (mod->isPrimaryInterface()) toModuleDefImpl(mod)->addMembersToMemberGroup();
1587 }
1588}
1589
1591{
1592 for (const auto &mod : p->moduleFileMap) // foreach module
1593 {
1594 if (mod->isPrimaryInterface()) toModuleDefImpl(mod)->distributeMemberGroupDocumentation();
1595 }
1596}
1597
1599{
1600 for (auto &mod : p->moduleFileMap) // foreach module
1601 {
1602 if (mod->isPrimaryInterface()) toModuleDefImpl(mod)->findSectionsInDocumentation();
1603 }
1604}
1605
1607{
1608 for (auto &mod : p->moduleFileMap) // foreach module
1609 {
1610 if (mod->isPrimaryInterface()) toModuleDefImpl(mod)->sortMemberLists();
1611 }
1612}
1613
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:1435
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:109
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:114
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:89
void push_back(const T &value)
Definition memberlist.h:48
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:75
QCString qualifiedName() const override
void addConceptToModule(const Entry *root, ConceptDef *cd)
FileDef * getFileDef() const override
Definition moduledef.cpp:82
QCString partitionName() const override
Definition moduledef.cpp:73
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:83
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:79
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:84
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:78
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:65
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:72
const ModuleMap & partitions() const override
Definition moduledef.cpp:85
const MemberLists & getMemberLists() const override
Definition moduledef.cpp:77
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:80
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)
ModuleLinkedMap & modules()
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:147
void findSectionsInDocumentation()
void collectExportedSymbols()
void resolvePartitionsRecursively(ModuleDef *intfMod, ModuleDef *mod)
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:97
#define err(fmt,...)
Definition message.h:127
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:112
QCString title(SrcLangExt lang) const
Definition layout.cpp:1786
MemberListType type
Definition layout.h:118
bool visible() const override
Definition layout.h:121
Represents of a member definition list with configurable title.
Definition layout.h:132
MemberListType type
Definition layout.h:137
QCString title(SrcLangExt lang) const
Definition layout.cpp:1798
Definition layout.h:102
QCString title(SrcLangExt lang) const
Definition layout.cpp:1779
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:5242
void addGroupListToTitle(OutputList &ol, const Definition *d)
Definition util.cpp:5329
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:3944
QCString convertToXML(const QCString &s, bool keepEntities)
Definition util.cpp:4352
QCString determineAbsoluteIncludeName(const QCString &curFile, const QCString &incFileName)
Definition util.cpp:4040
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)
Definition util.cpp:3348
void addHtmlExtensionIfMissing(QCString &fName)
Definition util.cpp:5339
A bunch of utility functions.