Doxygen
Loading...
Searching...
No Matches
filedef.cpp
Go to the documentation of this file.
1/******************************************************************************
2 *
3 *
4 *
5 * Copyright (C) 1997-2015 by Dimitri van Heesch.
6 *
7 * Permission to use, copy, modify, and distribute this software and its
8 * documentation under the terms of the GNU General Public License is hereby
9 * granted. No representations are made about the suitability of this software
10 * for any purpose. It is provided "as is" without express or implied warranty.
11 * See the GNU General Public License for more details.
12 *
13 * Documents produced by Doxygen are derivative works derived from the
14 * input used in their production; they are not affected by this license.
15 *
16 */
17
18#include <unordered_set>
19
20#include "memberlist.h"
21#include "classlist.h"
22#include "filedef.h"
23#include "doxygen.h"
24#include "memberdef.h"
25#include "classdef.h"
26#include "namespacedef.h"
27#include "util.h"
28#include "language.h"
29#include "outputlist.h"
30#include "dot.h"
31#include "dotincldepgraph.h"
32#include "message.h"
33#include "docparser.h"
34#include "searchindex.h"
35#include "htags.h"
36#include "parserintf.h"
37#include "portable.h"
38#include "vhdldocgen.h"
39#include "debug.h"
40#include "layout.h"
41#include "entry.h"
42#include "groupdef.h"
43#include "filename.h"
44#include "membergroup.h"
45#include "dirdef.h"
46#include "config.h"
47#include "clangparser.h"
48#include "settings.h"
49#include "definitionimpl.h"
50#include "conceptdef.h"
51#include "moduledef.h"
52
53//---------------------------------------------------------------------------
54
56{
57 bool isIDLorJava = lang==SrcLangExt::IDL || lang==SrcLangExt::Java;
58 if (isIDLorJava || (kind & IncludeKind_ImportMask))
59 {
60 return "import ";
61 }
62 else if (kind & IncludeKind_ObjCMask)
63 {
64 return "#import ";
65 }
66 else
67 {
68 return "#include ";
69 }
70}
71
73{
74 if (lang==SrcLangExt::Java || kind==IncludeKind::ImportModule) return "";
75 if ((kind & IncludeKind_LocalMask) || (lang==SrcLangExt::IDL))
76 {
77 return "\"";
78 }
79 else
80 {
81 return "<";
82 }
83}
84
86{
87 if (lang==SrcLangExt::IDL) return "\";";
88 else if (lang==SrcLangExt::Java) return ";";
89
90 switch (kind)
91 {
92 case IncludeKind::ImportLocal: return "\";";
93 case IncludeKind::ImportLocalObjC: return "\"";
94 case IncludeKind::IncludeLocal: return "\"";
95 case IncludeKind::ImportSystem: return ">;";
96 case IncludeKind::ImportSystemObjC: return ">";
97 case IncludeKind::IncludeSystem: return ">";
98 case IncludeKind::ImportModule: return ";";
99 }
100 return "";
101}
102
104{
105 QCString result;
106 bool isIDLorJava = lang==SrcLangExt::IDL || lang==SrcLangExt::Java;
107 result.sprintf("local=\"%s\" import=\"%s\" module=\"%s\" objc=\"%s\"",
108 (kind & IncludeKind_LocalMask) ? "yes" : "no",
109 (isIDLorJava || (kind & IncludeKind_ImportMask)) ? "yes" : "no",
110 (kind==IncludeKind::ImportModule) ? "yes" : "no",
111 (kind & IncludeKind_ObjCMask) ? "yes" : "no");
112 return result;
113}
114
115//---------------------------------------------------------------------------
116
117using DefinitionLineMap = std::unordered_map<int,const Definition *>;
118using MemberDefLineMap = std::unordered_map<int,const MemberDef *>;
119using IncludeInfoMap = std::unordered_map<std::string, const IncludeInfo *>;
120
121class FileDefImpl final : public DefinitionMixin<FileDef>
122{
123 public:
124 FileDefImpl(const QCString &p,const QCString &n,const QCString &ref=QCString(),const QCString &dn=QCString());
125 ~FileDefImpl() override;
127
128 DefType definitionType() const override { return TypeFile; }
130 const QCString &name() const override;
131
132 QCString displayName(bool=true) const override { return localName(); }
133 QCString fileName() const override { return m_fileName; }
134 QCString getOutputFileBase() const override;
135 QCString anchor() const override { return QCString(); }
136 QCString getSourceFileBase() const override;
137 QCString includeName() const override;
140 QCString absFilePath() const override { return m_filePath; }
141 const QCString &docName() const override { return m_docname; }
142 bool isSource() const override { return m_isSource; }
143 bool isDocumentationFile() const override;
144 const Definition *getSourceDefinition(int lineNr) const override;
145 const MemberDef *getSourceMember(int lineNr) const override;
146 QCString getPath() const override { return m_path; }
147 QCString getVersion() const override { return m_fileVersion; }
148 bool isLinkableInProject() const override;
149 bool isLinkable() const override { return isLinkableInProject() || isReference(); }
150 bool isIncluded(const QCString &name) const override;
151 DirDef *getDirDef() const override { return m_dir; }
152 ModuleDef *getModuleDef() const override { return m_moduleDef; }
153 const LinkedRefMap<NamespaceDef> &getUsedNamespaces() const override;
155 const IncludeInfoList &includeFileList() const override { return m_includeList; }
156 const IncludeInfoList &includedByFileList() const override { return m_includedByList; }
157 void getAllIncludeFilesRecursively(StringVector &incFiles) const override;
158 MemberList *getMemberList(MemberListType lt) const override;
159 const MemberLists &getMemberLists() const override { return m_memberLists; }
160 const MemberGroupList &getMemberGroups() const override { return m_memberGroups; }
161 const NamespaceLinkedRefMap &getNamespaces() const override { return m_namespaces; }
162 const ConceptLinkedRefMap &getConcepts() const override { return m_concepts; }
163 const ClassLinkedRefMap &getClasses() const override { return m_classes; }
164 QCString title() const override;
165 bool hasDetailedDescription() const override;
166 QCString fileVersion() const override;
167 bool subGrouping() const override { return m_subGrouping; }
168 void countMembers() override;
169 int numDocMembers() const override;
170 int numDecMembers() const override;
171 void addSourceRef(int line,const Definition *d,const MemberDef *md) override;
172 void writeDocumentation(OutputList &ol) override;
173 void writeMemberPages(OutputList &ol) override;
174 void writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const override;
175 void writeSummaryLinks(OutputList &ol) const override;
176 void writePageNavigation(OutputList &ol) const override;
177 void writeTagFile(TextStream &t) override;
178 void writeSourceHeader(OutputList &ol) override;
179 void writeSourceBody(OutputList &ol,ClangTUParser *clangParser) override;
180 void writeSourceFooter(OutputList &ol) override;
181 void parseSource(ClangTUParser *clangParser) override;
182 void setDiskName(const QCString &name) override;
183 void insertMember(MemberDef *md) override;
184 void removeMember(MemberDef *md) override;
185 void insertClass(ClassDef *cd) override;
186 void insertConcept(ConceptDef *cd) override;
187 void insertNamespace(NamespaceDef *nd) override;
188 void computeAnchors() override;
189 void setDirDef(DirDef *dd) override { m_dir=dd; }
190 void setModuleDef(ModuleDef *mod) override { m_moduleDef=mod; }
191 void addUsingDirective(NamespaceDef *nd) override;
192 void addUsingDeclaration(const Definition *d) override;
193 void combineUsingRelations() override;
194 bool generateSourceFile() const override;
195 void sortMemberLists() override;
196 void addIncludeDependency(const FileDef *fd,const QCString &incName,IncludeKind kind) override;
197 void addIncludedByDependency(const FileDef *fd,const QCString &incName,IncludeKind kind) override;
198 void addMembersToMemberGroup() override;
200 void findSectionsInDocumentation() override;
201 void addIncludedUsingDirectives(FileDefSet &visitedFiles) override;
202 void addListReferences() override;
203 void addRequirementReferences() override;
204
205 bool hasIncludeGraph() const override;
206 bool hasIncludedByGraph() const override;
207 void overrideIncludeGraph(bool e) override;
208 void overrideIncludedByGraph(bool e) override;
209
210 private:
211 void setDiskNameLocal(const QCString &name);
212 void acquireFileVersion();
221 void writeSourceLink(OutputList &ol);
223 bool isConstantGroup);
225 void writeConcepts(OutputList &ol,const QCString &title);
235
253 DirDef *m_dir = nullptr;
264 bool m_hasIncludeGraph = Config_getBool(INCLUDE_GRAPH);
265 bool m_hasIncludedByGraph = Config_getBool(INCLUDED_BY_GRAPH);
266};
267
268std::unique_ptr<FileDef> createFileDef(const QCString &p,const QCString &n,const QCString &ref,const QCString &dn)
269{
270 return std::make_unique<FileDefImpl>(p,n,ref,dn);
271}
272
273
274//---------------------------------------------------------------------------
275
276/*! create a new file definition, where \a p is the file path,
277 \a nm the file name, and \a lref is an HTML anchor name if the
278 file was read from a tag file or nullptr otherwise
279*/
281 const QCString &lref,const QCString &dn)
282 : DefinitionMixin(p+nm,1,1,nm,nullptr,nullptr,!p.isEmpty())
283{
285 m_filePath=p+nm;
286 m_fileName=nm;
287
288 setReference(lref);
289 setDiskNameLocal(!dn.isEmpty() ? dn : nm);
290 m_isSource = guessSection(nm).isSource();
291 m_docname = nm;
292 m_dir = nullptr;
293 if (Config_getBool(FULL_PATH_NAMES))
294 {
296 }
298 Config_getBool(FULL_PATH_NAMES) ? m_fileName : DefinitionMixin::name()));
300 m_subGrouping=Config_getBool(SUBGROUPING);
301}
302
303/*! destroy the file definition */
307
309{
310 if (isReference())
311 {
313 m_inclDepFileName = name+"_incl";
314 m_inclByDepFileName = name+"_dep_incl";
315 }
316 else
317 {
321 }
322}
323
328
329/*! Compute the HTML anchor names for all members in the class */
331{
332 MemberList *ml = getMemberList(MemberListType::AllMembersList());
333 if (ml) ml->setAnchors();
334}
335
337{
338 //printf("FileDefImpl::distributeMemberGroupDocumentation()\n");
339 for (const auto &mg : m_memberGroups)
340 {
341 mg->distributeMemberGroupDocumentation();
342 }
343}
344
346{
350 for (const auto &mg : m_memberGroups)
351 {
352 mg->findSectionsInDocumentation(this);
353 }
354
355 for (auto &ml : m_memberLists)
356 {
357 if (ml->listType().isDeclaration())
358 {
359 ml->findSectionsInDocumentation(this);
360 }
361 }
362}
363
365{
366 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
367 bool sourceBrowser = Config_getBool(SOURCE_BROWSER);
368 return ((!briefDescription().isEmpty() && repeatBrief) ||
369 !documentation().stripWhiteSpace().isEmpty() || // avail empty section
370 (sourceBrowser && getStartBodyLine()!=-1 && getBodyDef()) ||
372 );
373}
374
376{
379 tagFile << " <compound kind=\"file\">\n";
380 tagFile << " <name>" << convertToXML(name()) << "</name>\n";
381 tagFile << " <path>" << convertToXML(stripFromPath(getPath())) << "</path>\n";
382 tagFile << " <filename>" << fn << "</filename>\n";
383 for (const auto &ii : m_includeList)
384 {
385 const FileDef *fd=ii.fileDef;
386 if (fd && fd->isLinkable() && !fd->isReference())
387 {
388 QCString attr = includeTagFileAttributes(fd->getLanguage(),ii.kind);
389 tagFile << " <includes id=\""
390 << convertToXML(fd->getOutputFileBase()) << "\" "
391 << "name=\"" << convertToXML(fd->name()) << "\" "
392 << attr << ">"
393 << convertToXML(ii.includeName)
394 << "</includes>\n";
395 }
396 }
397 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::File))
398 {
399 switch (lde->kind())
400 {
401 case LayoutDocEntry::FileClasses:
402 {
404 }
405 break;
406 case LayoutDocEntry::FileInterfaces:
407 {
409 }
410 break;
411 case LayoutDocEntry::FileStructs:
412 {
414 }
415 break;
416 case LayoutDocEntry::FileExceptions:
417 {
419 }
420 break;
421 case LayoutDocEntry::FileConcepts:
422 {
423 for (const auto *nd : m_concepts)
424 {
425 if (nd->isLinkableInProject())
426 {
427 tagFile << " <concept>" << convertToXML(nd->name()) << "</concept>\n";
428 }
429 }
430 }
431 break;
432 case LayoutDocEntry::FileNamespaces:
433 {
434 for (const auto *nd : m_namespaces)
435 {
436 if (nd->isLinkableInProject())
437 {
438 tagFile << " <namespace>" << convertToXML(nd->name()) << "</namespace>\n";
439 }
440 }
441 }
442 break;
443 case LayoutDocEntry::MemberDecl:
444 {
445 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
446 if (lmd)
447 {
448 MemberList * ml = getMemberList(lmd->type);
449 if (ml)
450 {
451 ml->writeTagFile(tagFile,false,false);
452 }
453 }
454 }
455 break;
456 case LayoutDocEntry::MemberGroups:
457 {
458 for (const auto &mg : m_memberGroups)
459 {
460 mg->writeTagFile(tagFile);
461 }
462 }
463 break;
464 default:
465 break;
466 }
467 }
468
470 tagFile << " </compound>\n";
471}
472
474{
476 {
479 ol.writeRuler();
483 ol.writeAnchor(QCString(),"details");
485 ol.startGroupHeader("details");
486 ol.parseText(title);
487 ol.endGroupHeader();
488
489 ol.startTextBlock();
490 if (!briefDescription().isEmpty() && Config_getBool(REPEAT_BRIEF))
491 {
493 briefLine(),
494 this,
495 nullptr,
497 DocOptions());
498 }
499 if (!briefDescription().isEmpty() && Config_getBool(REPEAT_BRIEF) &&
500 !documentation().isEmpty())
501 {
505 ol.enableAll();
508 ol.writeString("\n\n");
510 }
511 if (!documentation().isEmpty())
512 {
513 ol.generateDoc(docFile(),
514 docLine(),
515 this,
516 nullptr,
517 documentation()+"\n",
518 DocOptions()
519 .setIndexWords(true));
520 }
521 //printf("Writing source ref for file %s\n",qPrint(name()));
522 if (Config_getBool(SOURCE_BROWSER))
523 {
524 ol.startParagraph("definition");
526 int fileMarkerPos = refText.find("@0");
527 if (fileMarkerPos!=-1) // should always pass this.
528 {
529 ol.parseText(refText.left(fileMarkerPos)); //text left from marker 1
531 ol.parseText(refText.right(
532 refText.length()-fileMarkerPos-2)); // text right from marker 2
533 }
534 else
535 {
536 err("translation error: invalid marker in trDefinedInSourceFile()\n");
537 }
538 ol.endParagraph();
539 }
541 ol.endTextBlock();
542 }
543}
544
546{
548 {
549 auto parser { createDocParser() };
550 auto ast { validatingParseDoc(*parser.get(),
551 briefFile(),
552 briefLine(),
553 this,
554 nullptr,
556 DocOptions()
557 .setIndexWords(true)
558 .setSingleLine(true))
559 };
560 if (!ast->isEmpty())
561 {
562 ol.startParagraph();
565 ol.writeString(" - ");
567 ol.writeDoc(ast.get(),this,nullptr);
570 ol.writeString(" \n");
572
573 if (Config_getBool(REPEAT_BRIEF) ||
574 !documentation().stripWhiteSpace().isEmpty()
575 )
576 {
578 ol.startTextLink(QCString(),"details");
580 ol.endTextLink();
581 }
583 ol.endParagraph();
584 }
585 }
586 ol.writeSynopsis();
587}
588
590{
591 for (const auto &cd : list)
592 {
593 if (cd->isLinkableInProject())
594 {
595 tagFile << " <class kind=\"" << cd->compoundTypeString() <<
596 "\">" << convertToXML(cd->name()) << "</class>\n";
597 }
598 }
599}
600
602{
603 if (!m_includeList.empty())
604 {
605 ol.startTextBlock(true);
606 for (const auto &ii : m_includeList)
607 {
608 const FileDef *fd=ii.fileDef;
609 ol.startTypewriter();
610 SrcLangExt lang = fd ? fd->getLanguage() : SrcLangExt::Cpp;
611 ol.docify(::includeStatement(lang,ii.kind));
612 ol.docify(::includeOpen(lang,ii.kind));
614 ol.docify(ii.includeName);
615 ol.enableAll();
617
618 // Here we use the include file name as it appears in the file.
619 // we could also we the name as it is used within doxygen,
620 // then we should have used fd->docName() instead of ii->includeName
621 if (fd && fd->isLinkable())
622 {
625 QCString(),ii.includeName);
626 }
627 else
628 {
630 if (ii.kind==IncludeKind::ImportModule && mod && mod->isLinkable())
631 {
633 QCString(),ii.includeName);
634 }
635 else
636 {
637 ol.docify(ii.includeName);
638 }
639 }
640
641 ol.enableAll();
642 ol.docify(::includeClose(lang,ii.kind));
643 ol.endTypewriter();
644 ol.lineBreak();
645 }
646 ol.endTextBlock();
647 }
648}
649
651{
652 if (Config_getBool(HAVE_DOT) && m_hasIncludeGraph /*&& Config_getBool(INCLUDE_GRAPH)*/)
653 {
654 //printf("Graph for file %s\n",qPrint(name()));
655 DotInclDepGraph incDepGraph(this,false);
656 if (incDepGraph.isTooBig())
657 {
658 warn_uncond("Include graph for '{}' not generated, too many nodes ({}), threshold is {}. Consider increasing DOT_GRAPH_MAX_NODES.\n",
659 qPrint(name()), incDepGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
660 }
661 else if (!incDepGraph.isTrivial())
662 {
663 ol.startTextBlock();
667 ol.endInclDepGraph(incDepGraph);
668 ol.enableAll();
669 ol.endTextBlock(true);
670 }
671 //incDepGraph.writeGraph(Config_getString(HTML_OUTPUT),fd->getOutputFileBase());
672 }
673}
674
676{
677 if (Config_getBool(HAVE_DOT) && m_hasIncludedByGraph /*&& Config_getBool(INCLUDED_BY_GRAPH)*/)
678 {
679 //printf("Graph for file %s\n",qPrint(name()));
680 DotInclDepGraph incDepGraph(this,true);
681 if (incDepGraph.isTooBig())
682 {
683 warn_uncond("Included by graph for '{}' not generated, too many nodes ({}), threshold is {}. Consider increasing DOT_GRAPH_MAX_NODES.\n",
684 qPrint(name()), incDepGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
685 }
686 else if (!incDepGraph.isTrivial())
687 {
688 ol.startTextBlock();
692 ol.endInclDepGraph(incDepGraph);
693 ol.enableAll();
694 ol.endTextBlock(true);
695 }
696 //incDepGraph.writeGraph(Config_getString(HTML_OUTPUT),fd->getOutputFileBase());
697 }
698}
699
700
702{
703 //printf("%s: generateSourceFile()=%d\n",qPrint(name()),generateSourceFile());
704 if (generateSourceFile())
705 {
707 ol.startParagraph();
710 ol.endTextLink();
711 ol.endParagraph();
712 ol.enableAll();
713 }
714}
715
717 bool const isConstantGroup)
718{
719 // write list of namespaces
720 m_namespaces.writeDeclaration(ol,title,isConstantGroup);
721}
722
724{
725 // write list of classes
726 list.writeDeclaration(ol,nullptr,title,false);
727}
728
730{
731 // write list of classes
733}
734
736{
737 // temporarily undo the disabling could be done by startMemberDocumentation()
738 // as a result of setting SEPARATE_MEMBER_PAGES to YES; see bug730512
739 bool isEnabled = ol.isEnabled(OutputType::Html);
741
743
744 // restore the initial state if needed
745 if (!isEnabled) ol.disable(OutputType::Html);
746}
747
752
757
759{
760 if (Config_getBool(SEPARATE_MEMBER_PAGES))
761 {
764 }
765}
766
768{
769 if (Config_getBool(SEPARATE_MEMBER_PAGES))
770 {
773 }
774}
775
777{
778 /* write user defined member groups */
779 for (const auto &mg : m_memberGroups)
780 {
781 if (!mg->allMembersInSameSection() || !m_subGrouping)
782 {
783 mg->writeDeclarations(ol,nullptr,nullptr,this,nullptr,nullptr);
784 }
785 }
786}
787
789{
790 // write Author section (Man only)
793 ol.startGroupHeader();
794 ol.parseText(theTranslator->trAuthor(true,true));
795 ol.endGroupHeader();
798}
799
801{
804 bool first=true;
805 SrcLangExt lang=getLanguage();
806 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::File))
807 {
808 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
809 if (lde->kind()==LayoutDocEntry::FileClasses && m_classes.declVisible() && ls)
810 {
811 QCString label = "nested-classes";
812 ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
813 first=false;
814 }
815 else if (lde->kind()==LayoutDocEntry::FileInterfaces && m_interfaces.declVisible() && ls)
816 {
817 QCString label = "interfaces";
818 ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
819 first=false;
820 }
821 else if (lde->kind()==LayoutDocEntry::FileStructs && m_structs.declVisible() && ls)
822 {
823 QCString label = "structs";
824 ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
825 first=false;
826 }
827 else if (lde->kind()==LayoutDocEntry::FileExceptions && m_exceptions.declVisible() && ls)
828 {
829 QCString label = "exceptions";
830 ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
831 first=false;
832 }
833 else if (lde->kind()==LayoutDocEntry::FileNamespaces && m_namespaces.declVisible(false) && ls)
834 {
835 QCString label = "namespaces";
836 ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
837 first=false;
838 }
839 else if (lde->kind()==LayoutDocEntry::FileConcepts && m_concepts.declVisible() && ls)
840 {
841 QCString label = "concepts";
842 ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
843 first=false;
844 }
845 else if (lde->kind()==LayoutDocEntry::MemberDecl)
846 {
847 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
848 if (lmd)
849 {
850 MemberList * ml = getMemberList(lmd->type);
851 if (ml && ml->declVisible())
852 {
853 ol.writeSummaryLink(QCString(),ml->listType().toLabel(),lmd->title(lang),first);
854 first=false;
855 }
856 }
857 }
858 }
859 if (!first)
860 {
861 ol.writeString(" </div>\n");
862 }
864}
865
870
871/*! Write the documentation page for this file to the file of output
872 generators \a ol.
873*/
875{
876 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
877 //funcList->countDecMembers();
878
879 //QCString fn = name();
880 //if (Config_getBool(FULL_PATH_NAMES))
881 //{
882 // fn.prepend(stripFromPath(getPath()));
883 //}
884
885 //printf("WriteDocumentation diskname=%s\n",qPrint(diskname));
886
887 QCString versionTitle;
888 if (!m_fileVersion.isEmpty())
889 {
890 versionTitle=" ("+m_fileVersion+")";
891 }
892 QCString title = m_docname+versionTitle;
893 QCString pageTitle;
894 if (Config_getBool(HIDE_COMPOUND_REFERENCE))
895 {
896 pageTitle=m_docname;
897 }
898 else
899 {
901 }
902
903 if (getDirDef())
904 {
905 startFile(ol,getOutputFileBase(),false,name(),pageTitle,HighlightedItem::FileVisible,!generateTreeView);
906 if (!generateTreeView)
907 {
909 ol.endQuickIndices();
910 }
911 startTitle(ol,getOutputFileBase(),this);
914 if (Config_getBool(HIDE_COMPOUND_REFERENCE))
915 {
916 ol.parseText(displayName()); // Html only
917 }
918 else
919 {
921 }
922 ol.enableAll();
924 if (Config_getBool(HIDE_COMPOUND_REFERENCE))
925 {
926 ol.parseText(Config_getBool(FULL_PATH_NAMES) ? // other output formats
927 pageTitle :
928 name());
929 }
930 else
931 {
932 ol.parseText(Config_getBool(FULL_PATH_NAMES) ? // other output formats
933 pageTitle :
935 }
937 addGroupListToTitle(ol,this);
939 }
940 else
941 {
942 startFile(ol,getOutputFileBase(),false,name(),pageTitle,HighlightedItem::FileVisible,!generateTreeView);
943 if (!generateTreeView)
944 {
945 ol.endQuickIndices();
946 }
947 startTitle(ol,getOutputFileBase(),this);
948 ol.parseText(pageTitle);
949 addGroupListToTitle(ol,this);
951 }
952
953 ol.startContents();
954
955 if (!m_fileVersion.isEmpty())
956 {
959 ol.docify(versionTitle);
960 ol.endProjectNumber();
961 ol.enableAll();
962 }
963
964 //---------------------------------------- start flexible part -------------------------------
965
966 SrcLangExt lang = getLanguage();
967 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::File))
968 {
969 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
970 switch (lde->kind())
971 {
972 case LayoutDocEntry::BriefDesc:
974 break;
975 case LayoutDocEntry::MemberDeclStart:
977 break;
978 case LayoutDocEntry::FileIncludes:
980 break;
981 case LayoutDocEntry::FileIncludeGraph:
983 break;
984 case LayoutDocEntry::FileIncludedByGraph:
986 break;
987 case LayoutDocEntry::FileSourceLink:
988 writeSourceLink(ol);
989 break;
990 case LayoutDocEntry::FileClasses:
991 if (ls) writeClassDeclarations(ol,ls->title(lang),m_classes);
992 break;
993 case LayoutDocEntry::FileInterfaces:
994 if (ls) writeClassDeclarations(ol,ls->title(lang),m_interfaces);
995 break;
996 case LayoutDocEntry::FileStructs:
997 if (ls) writeClassDeclarations(ol,ls->title(lang),m_structs);
998 break;
999 case LayoutDocEntry::FileExceptions:
1000 if (ls) writeClassDeclarations(ol,ls->title(lang),m_exceptions);
1001 break;
1002 case LayoutDocEntry::FileConcepts:
1003 if (ls) writeConcepts(ol,ls->title(lang));
1004 break;
1005 case LayoutDocEntry::FileNamespaces:
1006 if (ls) writeNamespaceDeclarations(ol,ls->title(lang),false);
1007 break;
1008 case LayoutDocEntry::FileConstantGroups:
1009 if (ls) writeNamespaceDeclarations(ol,ls->title(lang),true);
1010 break;
1011 case LayoutDocEntry::MemberGroups:
1013 break;
1014 case LayoutDocEntry::MemberDecl:
1015 {
1016 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
1017 if (lmd) writeMemberDeclarations(ol,lmd->type,lmd->title(lang));
1018 }
1019 break;
1020 case LayoutDocEntry::MemberDeclEnd:
1022 break;
1023 case LayoutDocEntry::DetailedDesc:
1024 if (ls) writeDetailedDescription(ol,ls->title(lang));
1025 break;
1026 case LayoutDocEntry::MemberDefStart:
1028 break;
1029 case LayoutDocEntry::FileInlineClasses:
1031 break;
1032 case LayoutDocEntry::MemberDef:
1033 {
1034 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
1035 if (lmd) writeMemberDocumentation(ol,lmd->type,lmd->title(lang));
1036 }
1037 break;
1038 case LayoutDocEntry::MemberDefEnd:
1040 break;
1041 case LayoutDocEntry::AuthorSection:
1043 break;
1044 case LayoutDocEntry::ClassIncludes:
1045 case LayoutDocEntry::ClassInheritanceGraph:
1046 case LayoutDocEntry::ClassNestedClasses:
1047 case LayoutDocEntry::ClassCollaborationGraph:
1048 case LayoutDocEntry::ClassAllMembersLink:
1049 case LayoutDocEntry::ClassUsedFiles:
1050 case LayoutDocEntry::ClassInlineClasses:
1051 case LayoutDocEntry::NamespaceNestedNamespaces:
1052 case LayoutDocEntry::NamespaceNestedConstantGroups:
1053 case LayoutDocEntry::NamespaceClasses:
1054 case LayoutDocEntry::NamespaceConcepts:
1055 case LayoutDocEntry::NamespaceInterfaces:
1056 case LayoutDocEntry::NamespaceStructs:
1057 case LayoutDocEntry::NamespaceExceptions:
1058 case LayoutDocEntry::NamespaceInlineClasses:
1059 case LayoutDocEntry::ConceptDefinition:
1060 case LayoutDocEntry::GroupClasses:
1061 case LayoutDocEntry::GroupConcepts:
1062 case LayoutDocEntry::GroupModules:
1063 case LayoutDocEntry::GroupInlineClasses:
1064 case LayoutDocEntry::GroupNamespaces:
1065 case LayoutDocEntry::GroupDirs:
1066 case LayoutDocEntry::GroupNestedGroups:
1067 case LayoutDocEntry::GroupFiles:
1068 case LayoutDocEntry::GroupGraph:
1069 case LayoutDocEntry::GroupPageDocs:
1070 case LayoutDocEntry::ModuleExports:
1071 case LayoutDocEntry::ModuleClasses:
1072 case LayoutDocEntry::ModuleConcepts:
1073 case LayoutDocEntry::ModuleUsedFiles:
1074 case LayoutDocEntry::DirSubDirs:
1075 case LayoutDocEntry::DirFiles:
1076 case LayoutDocEntry::DirGraph:
1077 err("Internal inconsistency: member '{}' should not be part of "
1078 "LayoutDocManager::File entry list\n",lde->entryToString());
1079 break;
1080 }
1081 }
1082
1083 //---------------------------------------- end flexible part -------------------------------
1084
1085 ol.endContents();
1086
1087 endFileWithNavPath(ol,this);
1088
1089 if (Config_getBool(SEPARATE_MEMBER_PAGES))
1090 {
1091 MemberList *ml = getMemberList(MemberListType::AllMembersList());
1092 if (ml) ml->sort();
1093 writeMemberPages(ol);
1094 }
1095}
1096
1098{
1099 ol.pushGeneratorState();
1101
1102 for (const auto &ml : m_memberLists)
1103 {
1104 if (ml->listType().isDocumentation())
1105 {
1106 ml->writeDocumentationPage(ol,name(),this);
1107 }
1108 }
1109
1110 ol.popGeneratorState();
1111}
1112
1114{
1115 bool createSubDirs=Config_getBool(CREATE_SUBDIRS);
1116
1117 ol.writeString(" <div class=\"navtab\">\n");
1118 ol.writeString(" <table>\n");
1119
1120 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
1121 if (allMemberList)
1122 {
1123 for (const auto &md : *allMemberList)
1124 {
1125 if (md->getFileDef()==this && md->getNamespaceDef()==nullptr && md->isLinkable() && !md->isEnumValue())
1126 {
1127 if (md->isLinkableInProject())
1128 {
1129 QCString fn=md->getOutputFileBase();
1131 if (md==currentMd) // selected item => highlight
1132 {
1133 ol.writeString(" <tr><td class=\"navtabHL\">");
1134 }
1135 else
1136 {
1137 ol.writeString(" <tr><td class=\"navtab\">");
1138 }
1139 ol.writeString("<span class=\"label\"><a ");
1140 ol.writeString("href=\"");
1141 if (createSubDirs) ol.writeString("../../");
1142 ol.writeString(fn+"#"+md->anchor());
1143 ol.writeString("\">");
1144 ol.writeString(convertToHtml(md->localName()));
1145 ol.writeString("</a></span>");
1146 ol.writeString("</td></tr>\n");
1147 }
1148 }
1149 }
1150 }
1151
1152 ol.writeString(" </table>\n");
1153 ol.writeString(" </div>\n");
1154}
1155
1156/*! Write a source listing of this file to the output */
1158{
1159 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
1161 if (!m_fileVersion.isEmpty())
1162 {
1163 title+=" ("+m_fileVersion+")";
1164 }
1167
1168 bool isDocFile = isDocumentationFile();
1169 bool genSourceFile = !isDocFile && generateSourceFile();
1170 if (getDirDef())
1171 {
1173 !generateTreeView,
1174 !isDocFile && genSourceFile ? QCString() : getOutputFileBase(),
1175 0);
1176 if (!generateTreeView)
1177 {
1179 ol.endQuickIndices();
1180 }
1182 ol.parseText(name());
1184 }
1185 else
1186 {
1188 !isDocFile && genSourceFile ? QCString() : getOutputFileBase(),
1189 0);
1191 ol.parseText(title);
1193 }
1194
1195 ol.startContents();
1196
1197 if (isLinkable())
1198 {
1201 ol.endTextLink();
1202
1203 ol.pushGeneratorState();
1205 ol.writeString("\\par\n");
1206 ol.popGeneratorState();
1207 }
1208}
1209
1210void FileDefImpl::writeSourceBody(OutputList &ol,[[maybe_unused]] ClangTUParser *clangParser)
1211{
1212 bool filterSourceFiles = Config_getBool(FILTER_SOURCE_FILES);
1213 OutputCodeList devNullList;
1214 devNullList.add<DevNullCodeGenerator>();
1215#if USE_LIBCLANG
1216 if (Doxygen::clangAssistedParsing && clangParser &&
1217 (getLanguage()==SrcLangExt::Cpp || getLanguage()==SrcLangExt::ObjC))
1218 {
1219 auto &codeOL = ol.codeGenerators();
1220 codeOL.startCodeFragment("DoxyCode");
1221 clangParser->switchToFile(this);
1222 clangParser->writeSources(codeOL,this);
1223 codeOL.endCodeFragment("DoxyCode");
1224 }
1225 else
1226#endif
1227 {
1229 intf->resetCodeParserState();
1230 auto &codeOL = ol.codeGenerators();
1231 codeOL.startCodeFragment("DoxyCode");
1232 bool needs2PassParsing =
1233 Doxygen::parseSourcesNeeded && // we need to parse (filtered) sources for cross-references
1234 !filterSourceFiles && // but user wants to show sources as-is
1235 !getFileFilter(absFilePath(),true).isEmpty(); // and there is a filter used while parsing
1236
1237 if (needs2PassParsing)
1238 {
1239 // parse code for cross-references only (see bug707641)
1240 intf->parseCode(devNullList,QCString(),
1241 fileToString(absFilePath(),true,true),
1242 getLanguage(),
1243 Config_getBool(STRIP_CODE_COMMENTS),
1245 .setFileDef(this)
1246 );
1247 }
1248 size_t indent = 0;
1249 intf->parseCode(codeOL,QCString(),
1250 detab(fileToString(absFilePath(),filterSourceFiles,true),indent),
1251 getLanguage(), // lang
1252 Config_getBool(STRIP_CODE_COMMENTS),
1254 .setFileDef(this)
1255 .setCollectXRefs(!needs2PassParsing)
1256 );
1257 codeOL.endCodeFragment("DoxyCode");
1258 }
1259}
1260
1262{
1263 ol.endContents();
1264 endFileWithNavPath(ol,this,false);
1265 ol.enableAll();
1266}
1267
1268void FileDefImpl::parseSource([[maybe_unused]] ClangTUParser *clangParser)
1269{
1270 bool filterSourceFiles = Config_getBool(FILTER_SOURCE_FILES);
1271 OutputCodeList devNullList;
1272 devNullList.add<DevNullCodeGenerator>();
1273#if USE_LIBCLANG
1274 if (Doxygen::clangAssistedParsing && clangParser &&
1275 (getLanguage()==SrcLangExt::Cpp || getLanguage()==SrcLangExt::ObjC))
1276 {
1277 clangParser->switchToFile(this);
1278 clangParser->writeSources(devNullList,this);
1279 }
1280 else
1281#endif
1282 {
1284 intf->resetCodeParserState();
1285 size_t indent = 0;
1286 intf->parseCode(
1287 devNullList,QCString(),
1288 detab(fileToString(absFilePath(),filterSourceFiles,true),indent),
1289 getLanguage(),
1290 Config_getBool(STRIP_CODE_COMMENTS),
1292 .setFileDef(this)
1293 );
1294 }
1295}
1296
1298{
1299 for (auto &ml : m_memberLists)
1300 {
1301 if (ml->listType().isDeclaration())
1302 {
1304 }
1305 }
1306
1307 // add members inside sections to their groups
1308 for (const auto &mg : m_memberGroups)
1309 {
1310 if (mg->allMembersInSameSection() && m_subGrouping)
1311 {
1312 //printf("----> addToDeclarationSection(%s)\n",qPrint(mg->header()));
1313 mg->addToDeclarationSection();
1314 }
1315 }
1316}
1317
1318/*! Adds member definition \a md to the list of all members of this file */
1320{
1321 if (md->isHidden()) return;
1322 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
1323 //printf("%s:FileDefImpl::insertMember(%s (=%p) list has %zu elements)\n",
1324 // qPrint(name()),qPrint(md->name()),(void*)md,allMemberList ? allMemberList->size() : 0);
1325 if (allMemberList && allMemberList->contains(md))
1326 {
1327 //printf("already added\n");
1328 return;
1329 }
1330
1331 if (allMemberList==nullptr)
1332 {
1333 m_memberLists.emplace_back(std::make_unique<MemberList>(MemberListType::AllMembersList(),MemberListContainer::File));
1334 allMemberList = m_memberLists.back().get();
1335 }
1336 allMemberList->push_back(md);
1337 switch (md->memberType())
1338 {
1339 case MemberType::Property:
1340 if (md->getLanguage() == SrcLangExt::Python)
1341 {
1342 addMemberToList(MemberListType::PropertyMembers(),md);
1343 addMemberToList(MemberListType::Properties(),md);
1344 break;
1345 }
1346 // fallthrough, explicitly no break here
1347 case MemberType::Variable:
1348 addMemberToList(MemberListType::DecVarMembers(),md);
1349 addMemberToList(MemberListType::DocVarMembers(),md);
1350 break;
1351 case MemberType::Function:
1352 addMemberToList(MemberListType::DecFuncMembers(),md);
1353 addMemberToList(MemberListType::DocFuncMembers(),md);
1354 break;
1355 case MemberType::Typedef:
1356 addMemberToList(MemberListType::DecTypedefMembers(),md);
1357 addMemberToList(MemberListType::DocTypedefMembers(),md);
1358 break;
1359 case MemberType::Sequence:
1360 addMemberToList(MemberListType::DecSequenceMembers(),md);
1361 addMemberToList(MemberListType::DocSequenceMembers(),md);
1362 break;
1363 case MemberType::Dictionary:
1364 addMemberToList(MemberListType::DecDictionaryMembers(),md);
1365 addMemberToList(MemberListType::DocDictionaryMembers(),md);
1366 break;
1367 case MemberType::Enumeration:
1368 addMemberToList(MemberListType::DecEnumMembers(),md);
1369 addMemberToList(MemberListType::DocEnumMembers(),md);
1370 break;
1371 case MemberType::EnumValue: // enum values are shown inside their enums
1372 break;
1373 case MemberType::Define:
1374 addMemberToList(MemberListType::DecDefineMembers(),md);
1375 addMemberToList(MemberListType::DocDefineMembers(),md);
1376 break;
1377 default:
1378 err("FileDefImpl::insertMembers(): "
1379 "member '{}' with class scope '{}' inserted in file scope '{}'!\n",
1380 md->name(),
1381 md->getClassDef() ? md->getClassDef()->name() : "<global>",
1382 name());
1383 }
1384 //addMemberToGroup(md,groupId);
1385}
1386
1388{
1389 MemberList *ml = getMemberList(lt);
1390 if (ml) ml->remove(md);
1391}
1392
1394{
1395 removeMemberFromList(MemberListType::AllMembersList(),md);
1396 switch(md->memberType())
1397 {
1398 case MemberType::Property:
1399 if (md->getLanguage() == SrcLangExt::Python)
1400 {
1401 removeMemberFromList(MemberListType::PropertyMembers(),md);
1402 removeMemberFromList(MemberListType::Properties(),md);
1403 break;
1404 }
1405 // fallthrough, explicitly no break here
1406 case MemberType::Variable:
1407 removeMemberFromList(MemberListType::DecVarMembers(),md);
1408 removeMemberFromList(MemberListType::DocVarMembers(),md);
1409 break;
1410 case MemberType::Function:
1411 removeMemberFromList(MemberListType::DecFuncMembers(),md);
1412 removeMemberFromList(MemberListType::DocFuncMembers(),md);
1413 break;
1414 case MemberType::Typedef:
1415 removeMemberFromList(MemberListType::DecTypedefMembers(),md);
1416 removeMemberFromList(MemberListType::DocTypedefMembers(),md);
1417 break;
1418 case MemberType::Sequence:
1419 removeMemberFromList(MemberListType::DecSequenceMembers(),md);
1420 removeMemberFromList(MemberListType::DocSequenceMembers(),md);
1421 break;
1422 case MemberType::Dictionary:
1423 removeMemberFromList(MemberListType::DecDictionaryMembers(),md);
1424 removeMemberFromList(MemberListType::DocDictionaryMembers(),md);
1425 break;
1426 case MemberType::Enumeration:
1427 removeMemberFromList(MemberListType::DecEnumMembers(),md);
1428 removeMemberFromList(MemberListType::DocEnumMembers(),md);
1429 break;
1430 case MemberType::EnumValue: // enum values are shown inside their enums
1431 break;
1432 case MemberType::Define:
1433 removeMemberFromList(MemberListType::DecDefineMembers(),md);
1434 removeMemberFromList(MemberListType::DocDefineMembers(),md);
1435 break;
1436 default:
1437 err("FileDefImpl::removeMember(): unexpected member remove in file!\n");
1438 }
1439}
1440
1441/*! Adds compound definition \a cd to the list of all compounds of this file */
1443{
1444 if (cd->isHidden()) return;
1445
1447
1448 if (Config_getBool(OPTIMIZE_OUTPUT_SLICE))
1449 {
1451 {
1452 list = &m_interfaces;
1453 }
1454 else if (cd->compoundType()==ClassDef::Struct)
1455 {
1456 list = &m_structs;
1457 }
1458 else if (cd->compoundType()==ClassDef::Exception)
1459 {
1460 list = &m_exceptions;
1461 }
1462 }
1463
1464 list->add(cd->name(),cd);
1465}
1466
1468{
1469 if (cd->isHidden()) return;
1470 m_concepts.add(cd->name(),cd);
1471}
1472
1473/*! Adds namespace definition \a nd to the list of all compounds of this file */
1475{
1476 if (nd->isHidden()) return;
1477 m_namespaces.add(nd->name(),nd);
1478}
1479
1481{
1482 if (Config_getBool(FULL_PATH_NAMES))
1483 return m_fileName;
1484 else
1485 return DefinitionMixin::name();
1486}
1487
1488void FileDefImpl::addSourceRef(int line,const Definition *d,const MemberDef *md)
1489{
1490 //printf("FileDefImpl::addSourceRef(%d,%s,%s)\n",line,qPrint(d?d->name():"nullptr"),qPrint(md?md->name():"nullptr"));
1491 if (d)
1492 {
1493 m_srcDefMap.emplace(line,d);
1494 if (md) m_srcMemberMap.emplace(line,md);
1495 //printf("Adding member %s with anchor %s at line %d to file %s\n",
1496 // md?qPrint(md->name()):"<none>",md?qPrint(md->anchor()):"<none>",line,qPrint(name()));
1497 }
1498}
1499
1501{
1502 auto it = m_srcDefMap.find(lineNr);
1503 //printf("%s::getSourceDefinition(%d)=%s\n",qPrint(name()),lineNr,it!=m_srcDefMap.end()?qPrint(it->second->name()):"none");
1504 return it!=m_srcDefMap.end() ? it->second : nullptr;
1505}
1506
1508{
1509 auto it = m_srcMemberMap.find(lineNr);
1510 //printf("%s::getSourceMember(%d)=%s\n",qPrint(name()),lineNr,it!=m_srcMemberMap.end()?qPrint(it->second->name()):"none");
1511 return it!=m_srcMemberMap.end() ? it->second : nullptr;
1512}
1513
1514
1516{
1518 //printf("%p: FileDefImpl::addUsingDirective: %s:%d\n",this,qPrint(name()),usingDirList->count());
1519}
1520
1522{
1523 //printf("%p: FileDefImpl::getUsedNamespace: %s:%d\n",this,qPrint(name()),usingDirList?usingDirList->count():0);
1524 return m_usingDirList;
1525}
1526
1531
1533{
1534 //printf("FileDefImpl::addIncludeDependency(%p,%s,%d)\n",(void*)fd,qPrint(incName),kind);
1535 QCString iName = fd ? fd->absFilePath() : incName;
1536 if (!iName.isEmpty() && m_includeMap.find(iName.str())==m_includeMap.end())
1537 {
1538 m_includeList.emplace_back(fd,incName,kind);
1539 m_includeMap.emplace(iName.str(),&m_includeList.back());
1540 }
1541}
1542
1544{
1545 if (visitedFiles.find(this)!=visitedFiles.end()) return; // file already processed
1546 visitedFiles.insert(this);
1547 //printf("( FileDefImpl::addIncludedUsingDirectives for file %s\n",qPrint(name()));
1548
1549 if (!m_includeList.empty()) // file contains #includes
1550 {
1551 {
1552 for (const auto &ii : m_includeList) // foreach #include...
1553 {
1554 if (ii.fileDef) // ...that is a known file
1555 {
1556 // recurse into this file
1557 const_cast<FileDef*>(ii.fileDef)->addIncludedUsingDirectives(visitedFiles);
1558 }
1559 }
1560 }
1561 {
1562 // iterate through list from last to first
1563 for (auto ii_it = m_includeList.rbegin(); ii_it!=m_includeList.rend(); ++ii_it)
1564 {
1565 auto &ii = *ii_it;
1566 if (ii.fileDef && ii.fileDef!=this)
1567 {
1568 // add using directives
1569 auto unl = ii.fileDef->getUsedNamespaces();
1570 for (auto it = unl.rbegin(); it!=unl.rend(); ++it)
1571 {
1572 auto *nd = *it;
1573 //printf(" adding using directive for %s\n",qPrint(nd->qualifiedName()));
1574 m_usingDirList.prepend(nd->qualifiedName(),nd);
1575 }
1576 // add using declarations
1577 auto udl = ii.fileDef->getUsedDefinitions();
1578 for (auto it = udl.rbegin(); it!=udl.rend(); ++it)
1579 {
1580 auto *d = *it;
1581 m_usingDeclList.prepend(d->qualifiedName(),d);
1582 }
1583 }
1584 }
1585 }
1586 }
1587 //printf(") end FileDefImpl::addIncludedUsingDirectives for file %s\n",qPrint(name()));
1588}
1589
1590
1592{
1593 //printf("FileDefImpl::addIncludedByDependency(%p,%s,%d)\n",fd,incName,local);
1594 QCString iName = fd ? fd->absFilePath() : incName;
1595 if (!iName.isEmpty() && m_includedByMap.find(iName.str())==m_includedByMap.end())
1596 {
1597 m_includedByList.emplace_back(fd,incName,kind);
1598 m_includedByMap.emplace(iName.str(),&m_includedByList.back());
1599 }
1600}
1601
1603{
1604 if (name.isEmpty()) return false;
1605 return m_includeMap.find(name.str())!=m_includeMap.end();
1606}
1607
1609{
1610 bool sourceBrowser = Config_getBool(SOURCE_BROWSER);
1611 bool verbatimHeaders = Config_getBool(VERBATIM_HEADERS);
1612 return !isReference() &&
1613 (sourceBrowser ||
1614 (verbatimHeaders && (guessSection(name()).isHeader() || !m_includedByMap.empty()))
1615 ) &&
1617}
1618
1619
1621{
1624 theTranslator->trFile(true,true),
1626 QCString(),
1627 nullptr
1628 );
1629 for (const auto &mg : m_memberGroups)
1630 {
1631 mg->addListReferences(this);
1632 }
1633 for (auto &ml : m_memberLists)
1634 {
1635 if (ml->listType().isDocumentation())
1636 {
1637 ml->addListReferences(this);
1638 }
1639 }
1640}
1641
1643{
1645 for (const auto &mg : m_memberGroups)
1646 {
1647 mg->addRequirementReferences(this);
1648 }
1649 for (auto &ml : m_memberLists)
1650 {
1651 if (ml->listType().isDocumentation())
1652 {
1653 ml->addRequirementReferences(this);
1654 }
1655 }
1656}
1657
1658//-------------------------------------------------------------------
1659
1661{
1663 NamespaceDefSet visitedNamespaces;
1664 for (auto &nd : usingDirList)
1665 {
1667 if (ndm)
1668 {
1669 ndm->combineUsingRelations(visitedNamespaces);
1670 }
1671 }
1672
1673 for (auto &nd : usingDirList)
1674 {
1675 // add used namespaces of namespace nd to this namespace
1676 for (const auto &und : nd->getUsedNamespaces())
1677 {
1678 addUsingDirective(und);
1679 }
1680 // add used classes of namespace nd to this namespace
1681 for (const auto &ud : nd->getUsedDefinitions())
1682 {
1684 }
1685 }
1686}
1687
1689{
1690 static const std::unordered_set<std::string> docExtensions =
1691 { "doc", "txt", "dox", "md", "markdown" };
1692
1693 int lastDot = name().findRev('.');
1694 return (lastDot!=-1 && docExtensions.find(name().mid(lastDot+1).str())!=docExtensions.end()) ||
1695 getLanguageFromFileName(getFileNameExtension(name())) == SrcLangExt::Markdown;
1696}
1697
1699{
1700 QCString vercmd = Config_getString(FILE_VERSION_FILTER);
1701 if (!vercmd.isEmpty() && !m_filePath.isEmpty() && !isReference() &&
1702 m_filePath!="generated" && m_filePath!="graph_legend.dox")
1703 {
1704 msg("Version of {} : ",m_filePath);
1705 QCString cmd = vercmd+" \""+m_filePath+"\"";
1706 Debug::print(Debug::ExtCmd,0,"Executing popen(`{}`)\n",cmd);
1707 FILE *f=Portable::popen(cmd,"r");
1708 if (!f)
1709 {
1710 err("could not execute {}\n",vercmd);
1711 return;
1712 }
1713 const int bufSize=1024;
1714 char buf[bufSize];
1715 int numRead = static_cast<int>(fread(buf,1,bufSize-1,f));
1717 if (numRead>0 && numRead<bufSize)
1718 {
1719 buf[numRead]='\0';
1720 m_fileVersion=QCString(buf,numRead).stripWhiteSpace();
1721 if (!m_fileVersion.isEmpty())
1722 {
1723 msg("{}\n",m_fileVersion);
1724 return;
1725 }
1726 }
1727 msg("no version available\n");
1728 }
1729}
1730
1731
1733{
1734 if (Htags::useHtags)
1735 {
1737 }
1738 else
1739 {
1740 return m_outputDiskName+"_source";
1741 }
1742}
1743
1748
1749/*! Returns the name of the verbatim copy of this file (if any). */
1751{
1752 return getSourceFileBase();
1753}
1754
1756{
1757 bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS);
1758 bool sortMemberDocs = Config_getBool(SORT_MEMBER_DOCS);
1759 const auto &ml = m_memberLists.get(lt,MemberListContainer::File);
1760 ml->setNeedsSorting(
1761 (ml->listType().isDeclaration() && sortBriefDocs) ||
1762 (ml->listType().isDocumentation() && sortMemberDocs));
1763 ml->push_back(md);
1764 if (ml->listType().isDeclaration())
1765 {
1767 if (mdm)
1768 {
1769 mdm->setSectionList(this,ml.get());
1770 }
1771 }
1772}
1773
1775{
1776 for (auto &ml : m_memberLists)
1777 {
1778 if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(false); }
1779 }
1780
1781 for (const auto &mg : m_memberGroups)
1782 {
1783 MemberList &mlg = const_cast<MemberList&>(mg->members());
1784 if (mlg.needsSorting()) { mlg.sort(); mlg.setNeedsSorting(false); }
1785 }
1786
1787 std::stable_sort(m_includedByList.begin(),m_includedByList.end(),
1788 [](const auto &fi1,const auto &fi2) { return fi1.includeName < fi2.includeName; });
1789
1790 if (Config_getBool(SORT_BRIEF_DOCS))
1791 {
1792 auto classComp = [](const ClassLinkedRefMap::Ptr &c1,const ClassLinkedRefMap::Ptr &c2)
1793 {
1794 return Config_getBool(SORT_BY_SCOPE_NAME) ?
1795 qstricmp_sort(c1->name(), c2->name())<0 :
1796 qstricmp_sort(c1->className(), c2->className())<0;
1797 };
1798
1799 std::stable_sort(m_classes.begin(), m_classes.end(), classComp);
1800 std::stable_sort(m_interfaces.begin(),m_interfaces.end(),classComp);
1801 std::stable_sort(m_structs.begin(), m_structs.end(), classComp);
1802 std::stable_sort(m_exceptions.begin(),m_exceptions.end(),classComp);
1803
1804 auto conceptComp = [](const ConceptLinkedRefMap::Ptr &c1,const ConceptLinkedRefMap::Ptr &c2)
1805 {
1806 return qstricmp_sort(c1->name(),c2->name())<0;
1807 };
1808
1809 std::stable_sort(m_concepts.begin(), m_concepts.end(), conceptComp);
1810
1811 auto namespaceComp = [](const NamespaceLinkedRefMap::Ptr &n1,const NamespaceLinkedRefMap::Ptr &n2)
1812 {
1813 return qstricmp_sort(n1->name(),n2->name())<0;
1814 };
1815
1816 std::stable_sort(m_namespaces.begin(),m_namespaces.end(),namespaceComp);
1817 }
1818}
1819
1821{
1822 for (auto &ml : m_memberLists)
1823 {
1824 if (ml->listType()==lt)
1825 {
1826 return ml.get();
1827 }
1828 }
1829 return nullptr;
1830}
1831
1833{
1834 bool optVhdl = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
1835 MemberList * ml = getMemberList(lt);
1836 if (ml)
1837 {
1838 if (optVhdl) // use specific declarations function
1839 {
1840
1841 VhdlDocGen::writeVhdlDeclarations(ml,ol,nullptr,nullptr,this,nullptr,nullptr);
1842 }
1843 else
1844 {
1845 ml->writeDeclarations(ol,nullptr,nullptr,this,nullptr,nullptr,title,QCString());
1846 }
1847 }
1848}
1849
1851{
1852 MemberList * ml = getMemberList(lt);
1853 if (ml) ml->writeDocumentation(ol,name(),this,title,ml->listType().toLabel());
1854}
1855
1857{
1858 bool showFiles = Config_getBool(SHOW_FILES);
1859 return hasDocumentation() && !isReference() && (showFiles || isLinkableViaGroup());
1860}
1861
1863 StringUnorderedSet &filesVisited,const FileDef *fd,StringVector &incFiles)
1864{
1865 for (const auto &ii : fd->includeFileList())
1866 {
1867 if (ii.fileDef && !ii.fileDef->isReference() &&
1868 filesVisited.find(ii.fileDef->absFilePath().str())==filesVisited.end())
1869 {
1870 //printf("FileDefImpl::addIncludeDependency(%s)\n",qPrint(ii->fileDef->absFilePath()));
1871 incFiles.push_back(ii.fileDef->absFilePath().str());
1872 filesVisited.insert(ii.fileDef->absFilePath().str());
1873 getAllIncludeFilesRecursively(filesVisited,ii.fileDef,incFiles);
1874 }
1875 }
1876}
1877
1879{
1880 StringUnorderedSet includes;
1881 ::getAllIncludeFilesRecursively(includes,this,incFiles);
1882}
1883
1885{
1886 if (Config_getBool(HIDE_COMPOUND_REFERENCE))
1887 {
1888 return name();
1889 }
1890 else
1891 {
1893 }
1894}
1895
1897{
1898 return m_fileVersion;
1899}
1900
1905
1910
1912{
1913 for (auto &ml : m_memberLists)
1914 {
1915 ml->countDecMembers();
1916 ml->countDocMembers();
1917 }
1918 for (const auto &mg : m_memberGroups)
1919 {
1920 mg->countDecMembers();
1921 mg->countDocMembers();
1922 }
1923}
1924
1926{
1927 MemberList *ml = getMemberList(MemberListType::AllMembersList());
1928 return ml ? ml->numDocMembers() : 0;
1929}
1930
1932{
1933 MemberList *ml = getMemberList(MemberListType::AllMembersList());
1934 return ml ? ml->numDecMembers() : 0;
1935}
1936
1941
1946
1948{
1949 return m_hasIncludeGraph;
1950}
1951
1953{
1954 return m_hasIncludedByGraph;
1955}
1956
1957// -----------------------
1958
1959bool compareFileDefs(const FileDef *fd1, const FileDef *fd2)
1960{
1961 return qstricmp_sort(fd1->name(),fd2->name()) < 0;
1962}
1963
1964// --- Cast functions
1965
1967{
1968 if (d==nullptr) return nullptr;
1969 if (d && typeid(*d)==typeid(FileDefImpl))
1970 {
1971 return static_cast<FileDef*>(d);
1972 }
1973 else
1974 {
1975 return nullptr;
1976 }
1977}
1978
1980{
1981 if (d==nullptr) return nullptr;
1982 if (d && typeid(*d)==typeid(FileDefImpl))
1983 {
1984 return static_cast<const FileDef*>(d);
1985 }
1986 else
1987 {
1988 return nullptr;
1989 }
1990}
1991
Clang parser object for a single translation unit, which consists of a source file and the directly o...
Definition clangparser.h:25
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.
@ Interface
Definition classdef.h:112
@ Exception
Definition classdef.h:115
virtual CompoundType compoundType() const =0
Returns the type of compound this is, i.e. class/struct/union/...
void writeDeclaration(OutputList &ol, const ClassDef::CompoundType *filter, const QCString &header, bool localNames) const
Definition classlist.cpp:53
bool declVisible(const ClassDef::CompoundType *filter=nullptr) const
Definition classlist.cpp:29
void writeDocumentation(OutputList &ol, const Definition *container=nullptr) const
Definition classlist.cpp:74
void writeDeclaration(OutputList &ol, const QCString &header, bool localNames) const
bool declVisible() const
@ ExtCmd
Definition debug.h:36
static void print(DebugMask mask, int prio, fmt::format_string< Args... > fmt, Args &&... args)
Definition debug.h:77
The common base class of all entity definitions found in the sources.
Definition definition.h:77
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
virtual bool isLinkable() const =0
virtual bool isHidden() const =0
virtual QCString getReference() const =0
virtual QCString qualifiedName() const =0
virtual QCString getOutputFileBase() const =0
virtual bool isReference() const =0
virtual const QCString & name() const =0
bool isReference() const override
QCString briefDescription(bool abbreviate=false) const override
const QCString & name() const override
bool isLinkableViaGroup() const override
bool hasBriefDescription() const override
QCString docFile() const override
QCString getDefFileExtension() const override
bool hasRequirementRefs() const override
QCString briefFile() const override
DefinitionMixin(const QCString &defFileName, int defLine, int defColumn, const QCString &name, const char *b=nullptr, const char *d=nullptr, bool isSymbol=true)
void setLanguage(SrcLangExt lang) override
void setReference(const QCString &r) override
void writeRequirementRefs(OutputList &ol) const override
const RefItemVector & xrefListItems() const override
const QCString & localName() const override
const FileDef * getBodyDef() const override
int getStartBodyLine() 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 writeNavigationPath(OutputList &ol) const =0
Class implementing OutputCodeIntf by throwing away everything.
Definition devnullgen.h:21
A model of a directory symbol.
Definition dirdef.h:110
Representation of an include dependency graph.
bool isTooBig() const
bool isTrivial() const
static bool suppressDocWarnings
Definition doxygen.h:130
static bool parseSourcesNeeded
Definition doxygen.h:123
static bool clangAssistedParsing
Definition doxygen.h:136
static ParserManager * parserManager
Definition doxygen.h:129
A model of a file symbol.
Definition filedef.h:99
virtual QCString includeName() const =0
virtual bool generateSourceFile() const =0
virtual QCString absFilePath() const =0
virtual const IncludeInfoList & includeFileList() const =0
bool isDocumentationFile() const override
Definition filedef.cpp:1688
void findSectionsInDocumentation() override
Definition filedef.cpp:345
void setModuleDef(ModuleDef *mod) override
Definition filedef.cpp:190
void addIncludedUsingDirectives(FileDefSet &visitedFiles) override
Definition filedef.cpp:1543
void writeBriefDescription(OutputList &ol)
Definition filedef.cpp:545
const LinkedRefMap< const Definition > & getUsedDefinitions() const override
Definition filedef.cpp:154
void setDiskName(const QCString &name) override
Definition filedef.cpp:324
void addSourceRef(int line, const Definition *d, const MemberDef *md) override
Definition filedef.cpp:1488
LinkedRefMap< const Definition > m_usingDeclList
Definition filedef.cpp:241
DirDef * m_dir
Definition filedef.cpp:253
QCString getOutputFileBase() const override
Definition filedef.cpp:1744
void insertNamespace(NamespaceDef *nd) override
Definition filedef.cpp:1474
ModuleDef * getModuleDef() const override
Definition filedef.cpp:152
void writeQuickMemberLinks(OutputList &ol, const MemberDef *currentMd) const override
Definition filedef.cpp:1113
void writeSourceLink(OutputList &ol)
Definition filedef.cpp:701
void writeSummaryLinks(OutputList &ol) const override
Definition filedef.cpp:800
QCString absFilePath() const override
Definition filedef.cpp:140
QCString m_path
Definition filedef.cpp:242
ClassLinkedRefMap m_interfaces
Definition filedef.cpp:259
const ConceptLinkedRefMap & getConcepts() const override
Definition filedef.cpp:162
QCString m_inclDepFileName
Definition filedef.cpp:244
ClassLinkedRefMap m_structs
Definition filedef.cpp:260
void sortMemberLists() override
Definition filedef.cpp:1774
void parseSource(ClangTUParser *clangParser) override
Definition filedef.cpp:1268
void setDiskNameLocal(const QCString &name)
Definition filedef.cpp:308
void addMemberToList(MemberListType lt, MemberDef *md)
Definition filedef.cpp:1755
void acquireFileVersion()
Definition filedef.cpp:1698
QCString m_fileVersion
Definition filedef.cpp:252
void addUsingDirective(NamespaceDef *nd) override
Definition filedef.cpp:1515
void writeNamespaceDeclarations(OutputList &ol, const QCString &title, bool isConstantGroup)
Definition filedef.cpp:716
void countMembers() override
Definition filedef.cpp:1911
void distributeMemberGroupDocumentation() override
Definition filedef.cpp:336
MemberDefLineMap m_srcMemberMap
Definition filedef.cpp:250
ConceptLinkedRefMap m_concepts
Definition filedef.cpp:262
void insertClass(ClassDef *cd) override
Definition filedef.cpp:1442
DefinitionLineMap m_srcDefMap
Definition filedef.cpp:249
QCString getSourceFileBase() const override
Definition filedef.cpp:1732
NamespaceLinkedRefMap m_namespaces
Definition filedef.cpp:257
ModuleDef * m_moduleDef
Definition filedef.cpp:254
IncludeInfoList m_includedByList
Definition filedef.cpp:239
CodeSymbolType codeSymbolType() const override
Definition filedef.cpp:129
void writeClassDeclarations(OutputList &ol, const QCString &title, const ClassLinkedRefMap &list)
Definition filedef.cpp:723
QCString anchor() const override
Definition filedef.cpp:135
bool m_hasIncludeGraph
Definition filedef.cpp:264
const NamespaceLinkedRefMap & getNamespaces() const override
Definition filedef.cpp:161
void removeMember(MemberDef *md) override
Definition filedef.cpp:1393
void addUsingDeclaration(const Definition *d) override
Definition filedef.cpp:1527
ClassLinkedRefMap m_exceptions
Definition filedef.cpp:261
QCString includeName() const override
Definition filedef.cpp:1750
void writeTagFile(TextStream &t) override
Definition filedef.cpp:375
void endMemberDeclarations(OutputList &ol)
Definition filedef.cpp:753
void addListReferences() override
Definition filedef.cpp:1620
void writeMemberDeclarations(OutputList &ol, MemberListType lt, const QCString &title)
Definition filedef.cpp:1832
const MemberGroupList & getMemberGroups() const override
Definition filedef.cpp:160
IncludeInfoMap m_includedByMap
Definition filedef.cpp:238
void insertMember(MemberDef *md) override
Definition filedef.cpp:1319
const LinkedRefMap< NamespaceDef > & getUsedNamespaces() const override
Definition filedef.cpp:1521
void writeInlineClasses(OutputList &ol)
Definition filedef.cpp:735
const QCString & docName() const override
Definition filedef.cpp:141
void writeIncludeFiles(OutputList &ol)
Definition filedef.cpp:601
MemberGroupList m_memberGroups
Definition filedef.cpp:256
void computeAnchors() override
Definition filedef.cpp:330
void writeDetailedDescription(OutputList &ol, const QCString &title)
Definition filedef.cpp:473
QCString m_fileName
Definition filedef.cpp:247
void writeMemberPages(OutputList &ol) override
Definition filedef.cpp:1097
void writeSourceFooter(OutputList &ol) override
Definition filedef.cpp:1261
QCString fileVersion() const override
Definition filedef.cpp:1896
void writeConcepts(OutputList &ol, const QCString &title)
Definition filedef.cpp:729
bool generateSourceFile() const override
Definition filedef.cpp:1608
void writeIncludedByGraph(OutputList &ol)
Definition filedef.cpp:675
const QCString & name() const override
Definition filedef.cpp:1480
bool m_isSource
Definition filedef.cpp:251
const MemberDef * getSourceMember(int lineNr) const override
Definition filedef.cpp:1507
QCString m_outputDiskName
Definition filedef.cpp:246
bool isIncluded(const QCString &name) const override
Definition filedef.cpp:1602
~FileDefImpl() override
Definition filedef.cpp:304
const IncludeInfoList & includeFileList() const override
Definition filedef.cpp:155
void removeMemberFromList(MemberListType lt, MemberDef *md)
Definition filedef.cpp:1387
void getAllIncludeFilesRecursively(StringVector &incFiles) const override
Definition filedef.cpp:1878
MemberLists m_memberLists
Definition filedef.cpp:255
LinkedRefMap< NamespaceDef > m_usingDirList
Definition filedef.cpp:240
QCString getVersion() const override
Definition filedef.cpp:147
void writeAuthorSection(OutputList &ol)
Definition filedef.cpp:788
void insertConcept(ConceptDef *cd) override
Definition filedef.cpp:1467
const MemberLists & getMemberLists() const override
Definition filedef.cpp:159
void addIncludedByDependency(const FileDef *fd, const QCString &incName, IncludeKind kind) override
Definition filedef.cpp:1591
IncludeInfoMap m_includeMap
Definition filedef.cpp:236
bool m_subGrouping
Definition filedef.cpp:263
QCString m_inclByDepFileName
Definition filedef.cpp:245
DirDef * getDirDef() const override
Definition filedef.cpp:151
void overrideIncludeGraph(bool e) override
Definition filedef.cpp:1937
ClassLinkedRefMap m_classes
Definition filedef.cpp:258
QCString m_docname
Definition filedef.cpp:248
void overrideIncludedByGraph(bool e) override
Definition filedef.cpp:1942
const IncludeInfoList & includedByFileList() const override
Definition filedef.cpp:156
bool hasIncludedByGraph() const override
Definition filedef.cpp:1952
void writePageNavigation(OutputList &ol) const override
Definition filedef.cpp:866
QCString displayName(bool=true) const override
Definition filedef.cpp:132
bool subGrouping() const override
Definition filedef.cpp:167
QCString m_filePath
Definition filedef.cpp:243
void writeMemberDocumentation(OutputList &ol, MemberListType lt, const QCString &title)
Definition filedef.cpp:1850
void writeSourceHeader(OutputList &ol) override
Definition filedef.cpp:1157
FileDefImpl(const QCString &p, const QCString &n, const QCString &ref=QCString(), const QCString &dn=QCString())
Definition filedef.cpp:280
void writeSourceBody(OutputList &ol, ClangTUParser *clangParser) override
Definition filedef.cpp:1210
void writeIncludeGraph(OutputList &ol)
Definition filedef.cpp:650
QCString title() const override
Definition filedef.cpp:1884
void addMembersToMemberGroup() override
Definition filedef.cpp:1297
int numDocMembers() const override
Definition filedef.cpp:1925
QCString getPath() const override
Definition filedef.cpp:146
bool m_hasIncludedByGraph
Definition filedef.cpp:265
IncludeInfoList m_includeList
Definition filedef.cpp:237
void startMemberDocumentation(OutputList &ol)
Definition filedef.cpp:758
int numDecMembers() const override
Definition filedef.cpp:1931
void writeClassesToTagFile(TextStream &t, const ClassLinkedRefMap &list)
Definition filedef.cpp:589
MemberList * getMemberList(MemberListType lt) const override
Definition filedef.cpp:1820
void startMemberDeclarations(OutputList &ol)
Definition filedef.cpp:748
bool isSource() const override
Definition filedef.cpp:142
void combineUsingRelations() override
Definition filedef.cpp:1660
bool isLinkableInProject() const override
Definition filedef.cpp:1856
void endMemberDocumentation(OutputList &ol)
Definition filedef.cpp:767
QCString includedByDependencyGraphFileName() const override
Definition filedef.cpp:1906
const ClassLinkedRefMap & getClasses() const override
Definition filedef.cpp:163
QCString fileName() const override
Definition filedef.cpp:133
bool hasIncludeGraph() const override
Definition filedef.cpp:1947
void writeDocumentation(OutputList &ol) override
Definition filedef.cpp:874
void addRequirementReferences() override
Definition filedef.cpp:1642
bool isLinkable() const override
Definition filedef.cpp:149
void addIncludeDependency(const FileDef *fd, const QCString &incName, IncludeKind kind) override
Definition filedef.cpp:1532
DefType definitionType() const override
Definition filedef.cpp:128
bool hasDetailedDescription() const override
Definition filedef.cpp:364
QCString includeDependencyGraphFileName() const override
Definition filedef.cpp:1901
void setDirDef(DirDef *dd) override
Definition filedef.cpp:189
void writeMemberGroups(OutputList &ol)
Definition filedef.cpp:776
const Definition * getSourceDefinition(int lineNr) const override
Definition filedef.cpp:1500
static LayoutDocManager & instance()
Returns a reference to this singleton.
Definition layout.cpp:1437
Container class representing a vector of objects with keys.
Definition linkedmap.h:232
bool add(const char *k, T *obj)
Definition linkedmap.h:284
iterator end()
Definition linkedmap.h:367
bool prepend(const char *k, T *obj)
Definition linkedmap.h:317
iterator begin()
Definition linkedmap.h:366
A model of a class/file/namespace member symbol.
Definition memberdef.h:48
virtual const ClassDef * getClassDef() const =0
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:125
bool needsSorting() const
Definition memberlist.h:140
int numDocMembers() const
Definition memberlist.h:138
void writeTagFile(TextStream &, bool useQualifiedName=false, bool showNamespaceMembers=true)
void writeDocumentation(OutputList &ol, const QCString &scopeName, const Definition *container, const QCString &title, const QCString &anchor, bool showEnumValues=false, bool showInline=false) const
void setNeedsSorting(bool b)
MemberListType listType() const
Definition memberlist.h:130
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 setAnchors()
int numDecMembers(const ClassDef *inheritedFrom) const
Definition memberlist.h:133
bool declVisible() const
Wrapper class for the MemberListType type.
Definition types.h:346
constexpr const char * toLabel() const noexcept
Definition types.h:402
const std::unique_ptr< MemberList > & get(MemberListType lt, MemberListContainer con)
Definition memberlist.h:191
void remove(const MemberDef *md)
Definition memberlist.h:84
void sort()
Definition memberlist.h:76
bool contains(const MemberDef *md) const
Definition memberlist.h:89
void push_back(const T &value)
Definition memberlist.h:48
static ModuleManager & instance()
ModuleDef * getPrimaryInterface(const QCString &moduleName) const
An abstract interface of a namespace symbol.
virtual void combineUsingRelations(NamespaceDefSet &visitedNamespace)=0
void writeDeclaration(OutputList &ol, const QCString &title, bool isConstantGroup=false, bool localName=false)
bool declVisible(bool isContantGroup) const
Class representing a list of different code generators.
Definition outputlist.h:165
void add(OutputCodeIntfPtr &&p)
Definition outputlist.h:195
void startCodeFragment(const QCString &style)
Definition outputlist.h:279
Class representing a list of output generators that are written to in parallel.
Definition outputlist.h:315
void writeDoc(const IDocNodeAST *ast, const Definition *ctx, const MemberDef *md, int sectionLevel=-1)
Definition outputlist.h:383
bool isEnabled(OutputType o)
void writeString(const QCString &text)
Definition outputlist.h:411
void disable(OutputType o)
void startInclDepGraph()
Definition outputlist.h:652
void writeRuler()
Definition outputlist.h:521
const OutputCodeList & codeGenerators() const
Definition outputlist.h:358
void startGroupHeader(const QCString &id=QCString(), int extraLevels=0)
Definition outputlist.h:453
void enable(OutputType o)
void endContents()
Definition outputlist.h:620
void endTextBlock(bool paraBreak=false)
Definition outputlist.h:672
void writeObjectLink(const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name)
Definition outputlist.h:439
void docify(const QCString &s)
Definition outputlist.h:437
void generateDoc(const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &docStr, const DocOptions &options)
void startParagraph(const QCString &classDef=QCString())
Definition outputlist.h:407
void startProjectNumber()
Definition outputlist.h:391
void endParagraph()
Definition outputlist.h:409
void endInclDepGraph(DotInclDepGraph &g)
Definition outputlist.h:654
void startMemberSections()
Definition outputlist.h:461
void endTextLink()
Definition outputlist.h:444
void writeSynopsis()
Definition outputlist.h:592
void startTypewriter()
Definition outputlist.h:449
void pushGeneratorState()
void disableAllBut(OutputType o)
void startTextBlock(bool dense=false)
Definition outputlist.h:670
void popGeneratorState()
void writeSummaryLink(const QCString &file, const QCString &anchor, const QCString &title, bool first)
Definition outputlist.h:614
void writeAnchor(const QCString &fileName, const QCString &name)
Definition outputlist.h:523
void endGroupHeader(int extraLevels=0)
Definition outputlist.h:455
void endQuickIndices()
Definition outputlist.h:604
void writePageOutline()
Definition outputlist.h:616
void startContents()
Definition outputlist.h:618
void enableAll()
void endProjectNumber()
Definition outputlist.h:393
void endTypewriter()
Definition outputlist.h:451
void lineBreak(const QCString &style=QCString())
Definition outputlist.h:559
void parseText(const QCString &textStr)
void startTextLink(const QCString &file, const QCString &anchor)
Definition outputlist.h:442
void endMemberSections()
Definition outputlist.h:463
std::unique_ptr< CodeParserInterface > getCodeParser(const QCString &extension)
Gets the interface to the parser associated with a given extension.
Definition parserintf.h:254
This is an alternative implementation of QCString.
Definition qcstring.h:97
QCString & prepend(const char *s)
Definition qcstring.h:420
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:164
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:161
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition qcstring.h:258
const std::string & str() const
Definition qcstring.h:550
QCString right(size_t len) const
Definition qcstring.h:232
QCString & sprintf(const char *format,...)
Definition qcstring.cpp:29
QCString & insert(size_t index, const QCString &s)
Definition qcstring.h:330
int findRev(char c, int index=-1, bool cs=true) const
Definition qcstring.cpp:96
QCString left(size_t len) const
Definition qcstring.h:227
static RequirementManager & instance()
void addRequirementRefsForSymbol(const Definition *symbol)
Text streaming class that buffers data.
Definition textstream.h:36
virtual QCString trSourceFile(const QCString &filename)=0
virtual QCString trInclByDepGraph()=0
virtual QCString trFileReference(const QCString &fileName)=0
virtual QCString trGotoSourceCode()=0
virtual QCString trInclDepGraph(const QCString &fName)=0
virtual QCString trDefinedInSourceFile()=0
virtual QCString trMore()=0
virtual QCString trGeneratedAutomatically(const QCString &s)=0
virtual QCString trAuthor(bool first_capital, bool singular)=0
virtual QCString trGotoDocumentation()=0
virtual QCString trFile(bool first_capital, bool singular)=0
static void writeVhdlDeclarations(const MemberList *, OutputList &, const GroupDef *, const ClassDef *, const FileDef *, const NamespaceDef *, const ModuleDef *)
#define Config_getInt(name)
Definition config.h:34
#define Config_getBool(name)
Definition config.h:33
#define Config_getString(name)
Definition config.h:32
#define NON_COPYABLE(cls)
Macro to help implementing the rule of 5 for a non-copyable & movable class.
Definition construct.h:37
std::unordered_set< std::string > StringUnorderedSet
Definition containers.h:29
std::vector< std::string > StringVector
Definition containers.h:33
void docFindSections(const QCString &input, const Definition *d, const QCString &fileName)
IDocNodeASTPtr validatingParseDoc(IDocParser &parserIntf, const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &input, const DocOptions &options)
IDocParserPtr createDocParser()
factory function to create a parser
Definition docparser.cpp:55
std::unordered_map< std::string, const IncludeInfo * > IncludeInfoMap
Definition filedef.cpp:119
QCString includeClose(SrcLangExt lang, IncludeKind kind)
Definition filedef.cpp:85
std::unordered_map< int, const Definition * > DefinitionLineMap
Definition filedef.cpp:117
QCString includeStatement(SrcLangExt lang, IncludeKind kind)
Definition filedef.cpp:55
std::unique_ptr< FileDef > createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
Definition filedef.cpp:268
bool compareFileDefs(const FileDef *fd1, const FileDef *fd2)
Definition filedef.cpp:1959
FileDef * toFileDef(Definition *d)
Definition filedef.cpp:1966
std::unordered_map< int, const MemberDef * > MemberDefLineMap
Definition filedef.cpp:118
QCString includeOpen(SrcLangExt lang, IncludeKind kind)
Definition filedef.cpp:72
QCString includeTagFileAttributes(SrcLangExt lang, IncludeKind kind)
Definition filedef.cpp:103
static void getAllIncludeFilesRecursively(StringUnorderedSet &filesVisited, const FileDef *fd, StringVector &incFiles)
Definition filedef.cpp:1862
constexpr uint32_t IncludeKind_ObjCMask
Definition filedef.h:67
IncludeKind
Definition filedef.h:47
@ ImportLocal
Definition filedef.h:54
@ ImportModule
Definition filedef.h:55
@ IncludeLocal
Definition filedef.h:50
@ ImportSystemObjC
Definition filedef.h:51
@ ImportLocalObjC
Definition filedef.h:52
@ IncludeSystem
Definition filedef.h:49
@ ImportSystem
Definition filedef.h:53
constexpr uint32_t IncludeKind_ImportMask
Definition filedef.h:65
constexpr uint32_t IncludeKind_LocalMask
Definition filedef.h:63
std::unordered_set< const FileDef * > FileDefSet
Definition filedef.h:44
void startTitle(OutputList &ol, const QCString &fileName, const DefinitionMutable *def)
Definition index.cpp:386
void endTitle(OutputList &ol, const QCString &fileName, const QCString &name)
Definition index.cpp:396
void startFile(OutputList &ol, const QCString &name, bool isSource, const QCString &manName, const QCString &title, HighlightedItem hli, bool additionalIndices, const QCString &altSidebarName, int hierarchyLevel, const QCString &allMembersFile)
Definition index.cpp:403
void endFileWithNavPath(OutputList &ol, const DefinitionMutable *d, bool showPageNavigation)
Definition index.cpp:450
Translator * theTranslator
Definition language.cpp:71
MemberDefMutable * toMemberDefMutable(Definition *d)
#define warn_uncond(fmt,...)
Definition message.h:122
#define msg(fmt,...)
Definition message.h:94
#define err(fmt,...)
Definition message.h:127
FILE * popen(const QCString &name, const QCString &type)
Definition portable.cpp:479
int pclose(FILE *stream)
Definition portable.cpp:488
NamespaceDefMutable * toNamespaceDefMutable(Definition *d)
std::unordered_set< const NamespaceDef * > NamespaceDefSet
Portable versions of functions that are platform dependent.
int qstricmp_sort(const char *str1, const char *str2)
Definition qcstring.h:80
const char * qPrint(const char *s)
Definition qcstring.h:685
Web server based search engine.
std::string_view stripWhiteSpace(std::string_view s)
Given a string view s, returns a new, narrower view on that string, skipping over any leading or trai...
Definition stringutil.h:72
Options to configure the code parser.
Definition parserintf.h:78
static QCString path2URL(const QCString &path)
Definition htags.cpp:157
static bool useHtags
Definition htags.h:23
Represents of a member declaration list with configurable title and subtitle.
Definition layout.h:112
QCString title(SrcLangExt lang) const
Definition layout.cpp:1788
MemberListType type
Definition layout.h:118
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:1800
Definition layout.h:102
QCString title(SrcLangExt lang) const
Definition layout.cpp:1781
CodeSymbolType
Definition types.h:481
SrcLangExt
Definition types.h:207
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5253
QCString convertToHtml(const QCString &s, bool keepEntities)
Definition util.cpp:4006
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:4867
void addGroupListToTitle(OutputList &ol, const Definition *d)
Definition util.cpp:4954
QCString fileToString(const QCString &name, bool filter, bool isSourceCode)
Definition util.cpp:1494
void createSubDirs(const Dir &d)
Definition util.cpp:3679
QCString convertNameToFile(const QCString &name, bool allowDots, bool allowUnderscore)
Definition util.cpp:3543
QCString convertToXML(const QCString &s, bool keepEntities, const bool citeEntry)
Definition util.cpp:3951
QCString detab(const QCString &s, size_t &refIndent)
Definition util.cpp:6760
EntryType guessSection(const QCString &name)
Definition util.cpp:338
QCString removeLongPathMarker(QCString path)
Definition util.cpp:287
QCString stripFromPath(const QCString &path)
Definition util.cpp:321
QCString getFileFilter(const QCString &name, bool isSourceCode)
Definition util.cpp:1422
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5295
void addHtmlExtensionIfMissing(QCString &fName)
Definition util.cpp:4964
A bunch of utility functions.