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 "outputlist.h"
52#include "moduledef.h"
53
54//---------------------------------------------------------------------------
55
57{
58 bool isIDLorJava = lang==SrcLangExt::IDL || lang==SrcLangExt::Java;
59 if (isIDLorJava || (kind & IncludeKind_ImportMask))
60 {
61 return "import ";
62 }
63 else if (kind & IncludeKind_ObjCMask)
64 {
65 return "#import ";
66 }
67 else
68 {
69 return "#include ";
70 }
71}
72
74{
75 if (lang==SrcLangExt::Java || kind==IncludeKind::ImportModule) return "";
76 if ((kind & IncludeKind_LocalMask) || (lang==SrcLangExt::IDL))
77 {
78 return "\"";
79 }
80 else
81 {
82 return "<";
83 }
84}
85
87{
88 if (lang==SrcLangExt::IDL) return "\";";
89 else if (lang==SrcLangExt::Java) return ";";
90
91 switch (kind)
92 {
93 case IncludeKind::ImportLocal: return "\";";
94 case IncludeKind::ImportLocalObjC: return "\"";
95 case IncludeKind::IncludeLocal: return "\"";
96 case IncludeKind::ImportSystem: return ">;";
97 case IncludeKind::ImportSystemObjC: return ">";
98 case IncludeKind::IncludeSystem: return ">";
99 case IncludeKind::ImportModule: return ";";
100 }
101 return "";
102}
103
105{
106 QCString result;
107 bool isIDLorJava = lang==SrcLangExt::IDL || lang==SrcLangExt::Java;
108 result.sprintf("local=\"%s\" import=\"%s\" module=\"%s\" objc=\"%s\"",
109 (kind & IncludeKind_LocalMask) ? "yes" : "no",
110 (isIDLorJava || (kind & IncludeKind_ImportMask)) ? "yes" : "no",
111 (kind==IncludeKind::ImportModule) ? "yes" : "no",
112 (kind & IncludeKind_ObjCMask) ? "yes" : "no");
113 return result;
114}
115
116//---------------------------------------------------------------------------
117
118using DefinitionLineMap = std::unordered_map<int,const Definition *>;
119using MemberDefLineMap = std::unordered_map<int,const MemberDef *>;
120using IncludeInfoMap = std::unordered_map<std::string, const IncludeInfo *>;
121
122class FileDefImpl : public DefinitionMixin<FileDef>
123{
124 public:
125 FileDefImpl(const QCString &p,const QCString &n,const QCString &ref=QCString(),const QCString &dn=QCString());
126 ~FileDefImpl() override;
128
129 DefType definitionType() const override { return TypeFile; }
131 const QCString &name() const override;
132
133 QCString displayName(bool=TRUE) const override { return localName(); }
134 QCString fileName() const override { return m_fileName; }
135 QCString getOutputFileBase() const override;
136 QCString anchor() const override { return QCString(); }
137 QCString getSourceFileBase() const override;
138 QCString includeName() const override;
141 QCString absFilePath() const override { return m_filePath; }
142 const QCString &docName() const override { return m_docname; }
143 bool isSource() const override { return m_isSource; }
144 bool isDocumentationFile() const override;
145 const Definition *getSourceDefinition(int lineNr) const override;
146 const MemberDef *getSourceMember(int lineNr) const override;
147 QCString getPath() const override { return m_path; }
148 QCString getVersion() const override { return m_fileVersion; }
149 bool isLinkableInProject() const override;
150 bool isLinkable() const override { return isLinkableInProject() || isReference(); }
151 bool isIncluded(const QCString &name) const override;
152 DirDef *getDirDef() const override { return m_dir; }
153 ModuleDef *getModuleDef() const override { return m_moduleDef; }
154 const LinkedRefMap<NamespaceDef> &getUsedNamespaces() const override;
156 const IncludeInfoList &includeFileList() const override { return m_includeList; }
157 const IncludeInfoList &includedByFileList() const override { return m_includedByList; }
158 void getAllIncludeFilesRecursively(StringVector &incFiles) const override;
159 MemberList *getMemberList(MemberListType lt) const override;
160 const MemberLists &getMemberLists() const override { return m_memberLists; }
161 const MemberGroupList &getMemberGroups() const override { return m_memberGroups; }
162 const NamespaceLinkedRefMap &getNamespaces() const override { return m_namespaces; }
163 const ConceptLinkedRefMap &getConcepts() const override { return m_concepts; }
164 const ClassLinkedRefMap &getClasses() const override { return m_classes; }
165 QCString title() const override;
166 bool hasDetailedDescription() const override;
167 QCString fileVersion() const override;
168 bool subGrouping() const override { return m_subGrouping; }
169 void countMembers() override;
170 int numDocMembers() const override;
171 int numDecMembers() const override;
172 void addSourceRef(int line,const Definition *d,const MemberDef *md) override;
173 void writeDocumentation(OutputList &ol) override;
174 void writeMemberPages(OutputList &ol) override;
175 void writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const override;
176 void writeSummaryLinks(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
204 bool hasIncludeGraph() const override;
205 bool hasIncludedByGraph() const override;
206 void overrideIncludeGraph(bool e) override;
207 void overrideIncludedByGraph(bool e) override;
208
209 private:
210 void setDiskNameLocal(const QCString &name);
211 void acquireFileVersion();
220 void writeSourceLink(OutputList &ol);
222 bool isConstantGroup);
224 void writeConcepts(OutputList &ol,const QCString &title);
234
252 DirDef *m_dir = nullptr;
263 bool m_hasIncludeGraph = Config_getBool(INCLUDE_GRAPH);
264 bool m_hasIncludedByGraph = Config_getBool(INCLUDED_BY_GRAPH);
265};
266
267std::unique_ptr<FileDef> createFileDef(const QCString &p,const QCString &n,const QCString &ref,const QCString &dn)
268{
269 return std::make_unique<FileDefImpl>(p,n,ref,dn);
270}
271
272
273//---------------------------------------------------------------------------
274
275/*! create a new file definition, where \a p is the file path,
276 \a nm the file name, and \a lref is an HTML anchor name if the
277 file was read from a tag file or nullptr otherwise
278*/
280 const QCString &lref,const QCString &dn)
281 : DefinitionMixin(QCString(p)+nm,1,1,nm,nullptr,nullptr,!p.isEmpty())
282{
284 m_filePath=p+nm;
285 m_fileName=nm;
286
287 setReference(lref);
288 setDiskNameLocal(!dn.isEmpty() ? dn : nm);
289 m_isSource = guessSection(nm).isSource();
290 m_docname = nm;
291 m_dir = nullptr;
292 if (Config_getBool(FULL_PATH_NAMES))
293 {
295 }
297 Config_getBool(FULL_PATH_NAMES) ? m_fileName : DefinitionMixin::name()));
299 m_subGrouping=Config_getBool(SUBGROUPING);
300}
301
302/*! destroy the file definition */
306
308{
309 if (isReference())
310 {
312 m_inclDepFileName = name+"_incl";
313 m_inclByDepFileName = name+"_dep_incl";
314 }
315 else
316 {
320 }
321}
322
327
328/*! Compute the HTML anchor names for all members in the class */
330{
331 MemberList *ml = getMemberList(MemberListType::AllMembersList());
332 if (ml) ml->setAnchors();
333}
334
336{
337 //printf("FileDefImpl::distributeMemberGroupDocumentation()\n");
338 for (const auto &mg : m_memberGroups)
339 {
340 mg->distributeMemberGroupDocumentation();
341 }
342}
343
345{
349 for (const auto &mg : m_memberGroups)
350 {
351 mg->findSectionsInDocumentation(this);
352 }
353
354 for (auto &ml : m_memberLists)
355 {
356 if (ml->listType().isDeclaration())
357 {
358 ml->findSectionsInDocumentation(this);
359 }
360 }
361}
362
364{
365 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
366 bool sourceBrowser = Config_getBool(SOURCE_BROWSER);
367 return ((!briefDescription().isEmpty() && repeatBrief) ||
368 !documentation().stripWhiteSpace().isEmpty() || // avail empty section
369 (sourceBrowser && getStartBodyLine()!=-1 && getBodyDef())
370 );
371}
372
374{
377 tagFile << " <compound kind=\"file\">\n";
378 tagFile << " <name>" << convertToXML(name()) << "</name>\n";
379 tagFile << " <path>" << convertToXML(stripFromPath(getPath())) << "</path>\n";
380 tagFile << " <filename>" << fn << "</filename>\n";
381 for (const auto &ii : m_includeList)
382 {
383 const FileDef *fd=ii.fileDef;
384 if (fd && fd->isLinkable() && !fd->isReference())
385 {
386 QCString attr = includeTagFileAttributes(fd->getLanguage(),ii.kind);
387 tagFile << " <includes id=\""
388 << convertToXML(fd->getOutputFileBase()) << "\" "
389 << "name=\"" << convertToXML(fd->name()) << "\" "
390 << attr << ">"
391 << convertToXML(ii.includeName)
392 << "</includes>\n";
393 }
394 }
395 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::File))
396 {
397 switch (lde->kind())
398 {
399 case LayoutDocEntry::FileClasses:
400 {
402 }
403 break;
404 case LayoutDocEntry::FileInterfaces:
405 {
407 }
408 break;
409 case LayoutDocEntry::FileStructs:
410 {
412 }
413 break;
414 case LayoutDocEntry::FileExceptions:
415 {
417 }
418 break;
419 case LayoutDocEntry::FileConcepts:
420 {
421 for (const auto *nd : m_concepts)
422 {
423 if (nd->isLinkableInProject())
424 {
425 tagFile << " <concept>" << convertToXML(nd->name()) << "</concept>\n";
426 }
427 }
428 }
429 break;
430 case LayoutDocEntry::FileNamespaces:
431 {
432 for (const auto *nd : m_namespaces)
433 {
434 if (nd->isLinkableInProject())
435 {
436 tagFile << " <namespace>" << convertToXML(nd->name()) << "</namespace>\n";
437 }
438 }
439 }
440 break;
441 case LayoutDocEntry::MemberDecl:
442 {
443 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
444 if (lmd)
445 {
446 MemberList * ml = getMemberList(lmd->type);
447 if (ml)
448 {
449 ml->writeTagFile(tagFile,false,false);
450 }
451 }
452 }
453 break;
454 case LayoutDocEntry::MemberGroups:
455 {
456 for (const auto &mg : m_memberGroups)
457 {
458 mg->writeTagFile(tagFile);
459 }
460 }
461 break;
462 default:
463 break;
464 }
465 }
466
468 tagFile << " </compound>\n";
469}
470
472{
474 {
477 ol.writeRuler();
481 ol.writeAnchor(QCString(),"details");
483 ol.startGroupHeader();
484 ol.parseText(title);
485 ol.endGroupHeader();
486
487 ol.startTextBlock();
488 if (!briefDescription().isEmpty() && Config_getBool(REPEAT_BRIEF))
489 {
491 QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
492 }
493 if (!briefDescription().isEmpty() && Config_getBool(REPEAT_BRIEF) &&
494 !documentation().isEmpty())
495 {
499 ol.enableAll();
502 ol.writeString("\n\n");
504 }
505 if (!documentation().isEmpty())
506 {
507 ol.generateDoc(docFile(),docLine(),this,nullptr,documentation()+"\n",TRUE,FALSE,
508 QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
509 }
510 //printf("Writing source ref for file %s\n",qPrint(name()));
511 if (Config_getBool(SOURCE_BROWSER))
512 {
513 ol.startParagraph("definition");
514 QCString refText = theTranslator->trDefinedInSourceFile();
515 int fileMarkerPos = refText.find("@0");
516 if (fileMarkerPos!=-1) // should always pass this.
517 {
518 ol.parseText(refText.left(fileMarkerPos)); //text left from marker 1
520 ol.parseText(refText.right(
521 refText.length()-fileMarkerPos-2)); // text right from marker 2
522 }
523 else
524 {
525 err("translation error: invalid marker in trDefinedInSourceFile()\n");
526 }
527 ol.endParagraph();
528 }
529 ol.endTextBlock();
530 }
531}
532
534{
536 {
537 auto parser { createDocParser() };
538 auto ast { validatingParseDoc(*parser.get(),
539 briefFile(),briefLine(),this,nullptr,
541 QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT)) };
542 if (!ast->isEmpty())
543 {
544 ol.startParagraph();
547 ol.writeString(" - ");
549 ol.writeDoc(ast.get(),this,nullptr);
552 ol.writeString(" \n");
554
555 if (Config_getBool(REPEAT_BRIEF) ||
556 !documentation().stripWhiteSpace().isEmpty()
557 )
558 {
560 ol.startTextLink(QCString(),"details");
561 ol.parseText(theTranslator->trMore());
562 ol.endTextLink();
563 }
565 ol.endParagraph();
566 }
567 }
568 ol.writeSynopsis();
569}
570
572{
573 for (const auto &cd : list)
574 {
575 if (cd->isLinkableInProject())
576 {
577 tagFile << " <class kind=\"" << cd->compoundTypeString() <<
578 "\">" << convertToXML(cd->name()) << "</class>\n";
579 }
580 }
581}
582
584{
585 if (!m_includeList.empty())
586 {
588 for (const auto &ii : m_includeList)
589 {
590 const FileDef *fd=ii.fileDef;
591 ol.startTypewriter();
592 SrcLangExt lang = fd ? fd->getLanguage() : SrcLangExt::Cpp;
593 ol.docify(::includeStatement(lang,ii.kind));
594 ol.docify(::includeOpen(lang,ii.kind));
596 ol.docify(ii.includeName);
597 ol.enableAll();
599
600 // Here we use the include file name as it appears in the file.
601 // we could also we the name as it is used within doxygen,
602 // then we should have used fd->docName() instead of ii->includeName
603 if (fd && fd->isLinkable())
604 {
607 QCString(),ii.includeName);
608 }
609 else
610 {
612 if (ii.kind==IncludeKind::ImportModule && mod && mod->isLinkable())
613 {
615 QCString(),ii.includeName);
616 }
617 else
618 {
619 ol.docify(ii.includeName);
620 }
621 }
622
623 ol.enableAll();
624 ol.docify(::includeClose(lang,ii.kind));
625 ol.endTypewriter();
626 ol.lineBreak();
627 }
628 ol.endTextBlock();
629 }
630}
631
633{
634 if (Config_getBool(HAVE_DOT) && m_hasIncludeGraph /*&& Config_getBool(INCLUDE_GRAPH)*/)
635 {
636 //printf("Graph for file %s\n",qPrint(name()));
637 DotInclDepGraph incDepGraph(this,FALSE);
638 if (incDepGraph.isTooBig())
639 {
640 warn_uncond("Include graph for '%s' not generated, too many nodes (%d), threshold is %d. Consider increasing DOT_GRAPH_MAX_NODES.\n",
641 qPrint(name()), incDepGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
642 }
643 else if (!incDepGraph.isTrivial())
644 {
645 ol.startTextBlock();
648 ol.parseText(theTranslator->trInclDepGraph(name()));
649 ol.endInclDepGraph(incDepGraph);
650 ol.enableAll();
651 ol.endTextBlock(TRUE);
652 }
653 //incDepGraph.writeGraph(Config_getString(HTML_OUTPUT),fd->getOutputFileBase());
654 }
655}
656
658{
659 if (Config_getBool(HAVE_DOT) && m_hasIncludedByGraph /*&& Config_getBool(INCLUDED_BY_GRAPH)*/)
660 {
661 //printf("Graph for file %s\n",qPrint(name()));
662 DotInclDepGraph incDepGraph(this,TRUE);
663 if (incDepGraph.isTooBig())
664 {
665 warn_uncond("Included by graph for '%s' not generated, too many nodes (%d), threshold is %d. Consider increasing DOT_GRAPH_MAX_NODES.\n",
666 qPrint(name()), incDepGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
667 }
668 else if (!incDepGraph.isTrivial())
669 {
670 ol.startTextBlock();
673 ol.parseText(theTranslator->trInclByDepGraph());
674 ol.endInclDepGraph(incDepGraph);
675 ol.enableAll();
676 ol.endTextBlock(TRUE);
677 }
678 //incDepGraph.writeGraph(Config_getString(HTML_OUTPUT),fd->getOutputFileBase());
679 }
680}
681
682
684{
685 //printf("%s: generateSourceFile()=%d\n",qPrint(name()),generateSourceFile());
686 if (generateSourceFile())
687 {
689 ol.startParagraph();
691 ol.parseText(theTranslator->trGotoSourceCode());
692 ol.endTextLink();
693 ol.endParagraph();
694 ol.enableAll();
695 }
696}
697
699 bool const isConstantGroup)
700{
701 // write list of namespaces
702 m_namespaces.writeDeclaration(ol,title,isConstantGroup);
703}
704
706{
707 // write list of classes
708 list.writeDeclaration(ol,nullptr,title,FALSE);
709}
710
712{
713 // write list of classes
714 m_concepts.writeDeclaration(ol,title,FALSE);
715}
716
718{
719 // temporarily undo the disabling could be done by startMemberDocumentation()
720 // as a result of setting SEPARATE_MEMBER_PAGES to YES; see bug730512
721 bool isEnabled = ol.isEnabled(OutputType::Html);
723
724 m_classes.writeDocumentation(ol,this);
725
726 // restore the initial state if needed
727 if (!isEnabled) ol.disable(OutputType::Html);
728}
729
734
739
741{
742 if (Config_getBool(SEPARATE_MEMBER_PAGES))
743 {
746 }
747}
748
750{
751 if (Config_getBool(SEPARATE_MEMBER_PAGES))
752 {
755 }
756}
757
759{
760 /* write user defined member groups */
761 for (const auto &mg : m_memberGroups)
762 {
763 if (!mg->allMembersInSameSection() || !m_subGrouping)
764 {
765 mg->writeDeclarations(ol,nullptr,nullptr,this,nullptr,nullptr);
766 }
767 }
768}
769
771{
772 // write Author section (Man only)
775 ol.startGroupHeader();
776 ol.parseText(theTranslator->trAuthor(TRUE,TRUE));
777 ol.endGroupHeader();
778 ol.parseText(theTranslator->trGeneratedAutomatically(Config_getString(PROJECT_NAME)));
780}
781
783{
786 bool first=TRUE;
787 SrcLangExt lang=getLanguage();
788 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::File))
789 {
790 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
791 if (lde->kind()==LayoutDocEntry::FileClasses && m_classes.declVisible() && ls)
792 {
793 QCString label = "nested-classes";
794 ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
795 first=FALSE;
796 }
797 else if (lde->kind()==LayoutDocEntry::FileInterfaces && m_interfaces.declVisible() && ls)
798 {
799 QCString label = "interfaces";
800 ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
801 first=FALSE;
802 }
803 else if (lde->kind()==LayoutDocEntry::FileStructs && m_structs.declVisible() && ls)
804 {
805 QCString label = "structs";
806 ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
807 first=FALSE;
808 }
809 else if (lde->kind()==LayoutDocEntry::FileExceptions && m_exceptions.declVisible() && ls)
810 {
811 QCString label = "exceptions";
812 ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
813 first=FALSE;
814 }
815 else if (lde->kind()==LayoutDocEntry::FileNamespaces && m_namespaces.declVisible(false) && ls)
816 {
817 QCString label = "namespaces";
818 ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
819 first=FALSE;
820 }
821 else if (lde->kind()==LayoutDocEntry::FileConcepts && m_concepts.declVisible() && ls)
822 {
823 QCString label = "concepts";
824 ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
825 first=FALSE;
826 }
827 else if (lde->kind()==LayoutDocEntry::MemberDecl)
828 {
829 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
830 if (lmd)
831 {
832 MemberList * ml = getMemberList(lmd->type);
833 if (ml && ml->declVisible())
834 {
835 ol.writeSummaryLink(QCString(),ml->listType().toLabel(),lmd->title(lang),first);
836 first=FALSE;
837 }
838 }
839 }
840 }
841 if (!first)
842 {
843 ol.writeString(" </div>\n");
844 }
846}
847
848/*! Write the documentation page for this file to the file of output
849 generators \a ol.
850*/
852{
853 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
854 //funcList->countDecMembers();
855
856 //QCString fn = name();
857 //if (Config_getBool(FULL_PATH_NAMES))
858 //{
859 // fn.prepend(stripFromPath(getPath()));
860 //}
861
862 //printf("WriteDocumentation diskname=%s\n",qPrint(diskname));
863
864 QCString versionTitle;
865 if (!m_fileVersion.isEmpty())
866 {
867 versionTitle=("("+m_fileVersion+")");
868 }
869 QCString title = m_docname+versionTitle;
870 QCString pageTitle=theTranslator->trFileReference(m_docname);
871
872 if (getDirDef())
873 {
874 startFile(ol,getOutputFileBase(),name(),pageTitle,HighlightedItem::FileVisible,!generateTreeView);
875 if (!generateTreeView)
876 {
878 ol.endQuickIndices();
879 }
880 startTitle(ol,getOutputFileBase(),this);
883 ol.parseText(theTranslator->trFileReference(displayName())); // Html only
884 ol.enableAll();
886 ol.parseText(Config_getBool(FULL_PATH_NAMES) ? // other output formats
887 pageTitle :
888 theTranslator->trFileReference(name()));
890 addGroupListToTitle(ol,this);
892 }
893 else
894 {
895 startFile(ol,getOutputFileBase(),name(),pageTitle,HighlightedItem::FileVisible,!generateTreeView);
896 if (!generateTreeView)
897 {
898 ol.endQuickIndices();
899 }
900 startTitle(ol,getOutputFileBase(),this);
901 ol.parseText(pageTitle);
902 addGroupListToTitle(ol,this);
904 }
905
906 ol.startContents();
907
908 if (!m_fileVersion.isEmpty())
909 {
912 ol.docify(versionTitle);
913 ol.endProjectNumber();
914 ol.enableAll();
915 }
916
917 //---------------------------------------- start flexible part -------------------------------
918
919 SrcLangExt lang = getLanguage();
920 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::File))
921 {
922 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
923 switch (lde->kind())
924 {
925 case LayoutDocEntry::BriefDesc:
927 break;
928 case LayoutDocEntry::MemberDeclStart:
930 break;
931 case LayoutDocEntry::FileIncludes:
933 break;
934 case LayoutDocEntry::FileIncludeGraph:
936 break;
937 case LayoutDocEntry::FileIncludedByGraph:
939 break;
940 case LayoutDocEntry::FileSourceLink:
941 writeSourceLink(ol);
942 break;
943 case LayoutDocEntry::FileClasses:
944 if (ls) writeClassDeclarations(ol,ls->title(lang),m_classes);
945 break;
946 case LayoutDocEntry::FileInterfaces:
947 if (ls) writeClassDeclarations(ol,ls->title(lang),m_interfaces);
948 break;
949 case LayoutDocEntry::FileStructs:
950 if (ls) writeClassDeclarations(ol,ls->title(lang),m_structs);
951 break;
952 case LayoutDocEntry::FileExceptions:
953 if (ls) writeClassDeclarations(ol,ls->title(lang),m_exceptions);
954 break;
955 case LayoutDocEntry::FileConcepts:
956 if (ls) writeConcepts(ol,ls->title(lang));
957 break;
958 case LayoutDocEntry::FileNamespaces:
959 if (ls) writeNamespaceDeclarations(ol,ls->title(lang),false);
960 break;
961 case LayoutDocEntry::FileConstantGroups:
962 if (ls) writeNamespaceDeclarations(ol,ls->title(lang),true);
963 break;
964 case LayoutDocEntry::MemberGroups:
966 break;
967 case LayoutDocEntry::MemberDecl:
968 {
969 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
970 if (lmd) writeMemberDeclarations(ol,lmd->type,lmd->title(lang));
971 }
972 break;
973 case LayoutDocEntry::MemberDeclEnd:
975 break;
976 case LayoutDocEntry::DetailedDesc:
977 if (ls) writeDetailedDescription(ol,ls->title(lang));
978 break;
979 case LayoutDocEntry::MemberDefStart:
981 break;
982 case LayoutDocEntry::FileInlineClasses:
984 break;
985 case LayoutDocEntry::MemberDef:
986 {
987 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
988 if (lmd) writeMemberDocumentation(ol,lmd->type,lmd->title(lang));
989 }
990 break;
991 case LayoutDocEntry::MemberDefEnd:
993 break;
994 case LayoutDocEntry::AuthorSection:
996 break;
997 case LayoutDocEntry::ClassIncludes:
998 case LayoutDocEntry::ClassInheritanceGraph:
999 case LayoutDocEntry::ClassNestedClasses:
1000 case LayoutDocEntry::ClassCollaborationGraph:
1001 case LayoutDocEntry::ClassAllMembersLink:
1002 case LayoutDocEntry::ClassUsedFiles:
1003 case LayoutDocEntry::ClassInlineClasses:
1004 case LayoutDocEntry::NamespaceNestedNamespaces:
1005 case LayoutDocEntry::NamespaceNestedConstantGroups:
1006 case LayoutDocEntry::NamespaceClasses:
1007 case LayoutDocEntry::NamespaceConcepts:
1008 case LayoutDocEntry::NamespaceInterfaces:
1009 case LayoutDocEntry::NamespaceStructs:
1010 case LayoutDocEntry::NamespaceExceptions:
1011 case LayoutDocEntry::NamespaceInlineClasses:
1012 case LayoutDocEntry::ConceptDefinition:
1013 case LayoutDocEntry::GroupClasses:
1014 case LayoutDocEntry::GroupConcepts:
1015 case LayoutDocEntry::GroupModules:
1016 case LayoutDocEntry::GroupInlineClasses:
1017 case LayoutDocEntry::GroupNamespaces:
1018 case LayoutDocEntry::GroupDirs:
1019 case LayoutDocEntry::GroupNestedGroups:
1020 case LayoutDocEntry::GroupFiles:
1021 case LayoutDocEntry::GroupGraph:
1022 case LayoutDocEntry::GroupPageDocs:
1023 case LayoutDocEntry::ModuleExports:
1024 case LayoutDocEntry::ModuleClasses:
1025 case LayoutDocEntry::ModuleConcepts:
1026 case LayoutDocEntry::ModuleUsedFiles:
1027 case LayoutDocEntry::DirSubDirs:
1028 case LayoutDocEntry::DirFiles:
1029 case LayoutDocEntry::DirGraph:
1030 err("Internal inconsistency: member '%s' should not be part of "
1031 "LayoutDocManager::File entry list\n",qPrint(lde->entryToString()));
1032 break;
1033 }
1034 }
1035
1036 //---------------------------------------- end flexible part -------------------------------
1037
1038 ol.endContents();
1039
1040 endFileWithNavPath(ol,this);
1041
1042 if (Config_getBool(SEPARATE_MEMBER_PAGES))
1043 {
1044 MemberList *ml = getMemberList(MemberListType::AllMembersList());
1045 if (ml) ml->sort();
1046 writeMemberPages(ol);
1047 }
1048}
1049
1051{
1052 ol.pushGeneratorState();
1054
1055 for (const auto &ml : m_memberLists)
1056 {
1057 if (ml->listType().isDocumentation())
1058 {
1059 ml->writeDocumentationPage(ol,name(),this);
1060 }
1061 }
1062
1063 ol.popGeneratorState();
1064}
1065
1067{
1068 bool createSubDirs=Config_getBool(CREATE_SUBDIRS);
1069
1070 ol.writeString(" <div class=\"navtab\">\n");
1071 ol.writeString(" <table>\n");
1072
1073 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
1074 if (allMemberList)
1075 {
1076 for (const auto &md : *allMemberList)
1077 {
1078 if (md->getFileDef()==this && md->getNamespaceDef()==nullptr && md->isLinkable() && !md->isEnumValue())
1079 {
1080 if (md->isLinkableInProject())
1081 {
1082 QCString fn=md->getOutputFileBase();
1084 if (md==currentMd) // selected item => highlight
1085 {
1086 ol.writeString(" <tr><td class=\"navtabHL\">");
1087 }
1088 else
1089 {
1090 ol.writeString(" <tr><td class=\"navtab\">");
1091 }
1092 ol.writeString("<a class=\"navtab\" ");
1093 ol.writeString("href=\"");
1094 if (createSubDirs) ol.writeString("../../");
1095 ol.writeString(fn+"#"+md->anchor());
1096 ol.writeString("\">");
1097 ol.writeString(convertToHtml(md->localName()));
1098 ol.writeString("</a>");
1099 ol.writeString("</td></tr>\n");
1100 }
1101 }
1102 }
1103 }
1104
1105 ol.writeString(" </table>\n");
1106 ol.writeString(" </div>\n");
1107}
1108
1109/*! Write a source listing of this file to the output */
1111{
1112 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
1114 if (!m_fileVersion.isEmpty())
1115 {
1116 title+=(" ("+m_fileVersion+")");
1117 }
1118 QCString pageTitle = theTranslator->trSourceFile(title);
1120
1121 bool isDocFile = isDocumentationFile();
1122 bool genSourceFile = !isDocFile && generateSourceFile();
1123 if (getDirDef())
1124 {
1126 !generateTreeView,
1127 !isDocFile && genSourceFile ? QCString() : getOutputFileBase(),
1128 0);
1129 if (!generateTreeView)
1130 {
1132 ol.endQuickIndices();
1133 }
1135 ol.parseText(name());
1137 }
1138 else
1139 {
1141 !isDocFile && genSourceFile ? QCString() : getOutputFileBase(),
1142 0);
1144 ol.parseText(title);
1146 }
1147
1148 ol.startContents();
1149
1150 if (isLinkable())
1151 {
1153 ol.parseText(theTranslator->trGotoDocumentation());
1154 ol.endTextLink();
1155
1156 ol.pushGeneratorState();
1158 ol.writeString("\\par\n");
1159 ol.popGeneratorState();
1160 }
1161}
1162
1163void FileDefImpl::writeSourceBody(OutputList &ol,[[maybe_unused]] ClangTUParser *clangParser)
1164{
1165 bool filterSourceFiles = Config_getBool(FILTER_SOURCE_FILES);
1166 OutputCodeList devNullList;
1167 devNullList.add<DevNullCodeGenerator>();
1168#if USE_LIBCLANG
1169 if (Doxygen::clangAssistedParsing && clangParser &&
1171 {
1172 auto &codeOL = ol.codeGenerators();
1173 codeOL.startCodeFragment("DoxyCode");
1174 clangParser->switchToFile(this);
1175 clangParser->writeSources(codeOL,this);
1176 codeOL.endCodeFragment("DoxyCode");
1177 }
1178 else
1179#endif
1180 {
1181 auto intf = Doxygen::parserManager->getCodeParser(getDefFileExtension());
1182 intf->resetCodeParserState();
1183 auto &codeOL = ol.codeGenerators();
1184 codeOL.startCodeFragment("DoxyCode");
1185 bool needs2PassParsing =
1186 Doxygen::parseSourcesNeeded && // we need to parse (filtered) sources for cross-references
1187 !filterSourceFiles && // but user wants to show sources as-is
1188 !getFileFilter(absFilePath(),TRUE).isEmpty(); // and there is a filter used while parsing
1189
1190 if (needs2PassParsing)
1191 {
1192 // parse code for cross-references only (see bug707641)
1193 intf->parseCode(devNullList,QCString(),
1195 getLanguage(),
1196 Config_getBool(STRIP_CODE_COMMENTS),
1197 FALSE,QCString(),this
1198 );
1199 }
1200 intf->parseCode(codeOL,QCString(),
1201 fileToString(absFilePath(),filterSourceFiles,TRUE),
1202 getLanguage(), // lang
1203 Config_getBool(STRIP_CODE_COMMENTS),
1204 FALSE, // isExampleBlock
1205 QCString(), // exampleName
1206 this, // fileDef
1207 -1, // startLine
1208 -1, // endLine
1209 FALSE, // inlineFragment
1210 nullptr, // memberDef
1211 TRUE, // showLineNumbers
1212 nullptr, // searchCtx
1213 !needs2PassParsing // collectXRefs
1214 );
1215 codeOL.endCodeFragment("DoxyCode");
1216 }
1217}
1218
1220{
1221 ol.endContents();
1222 endFileWithNavPath(ol,this);
1223 ol.enableAll();
1224}
1225
1226void FileDefImpl::parseSource([[maybe_unused]] ClangTUParser *clangParser)
1227{
1228 bool filterSourceFiles = Config_getBool(FILTER_SOURCE_FILES);
1229 OutputCodeList devNullList;
1230 devNullList.add<DevNullCodeGenerator>();
1231#if USE_LIBCLANG
1232 if (Doxygen::clangAssistedParsing && clangParser &&
1234 {
1235 clangParser->switchToFile(this);
1236 clangParser->writeSources(devNullList,this);
1237 }
1238 else
1239#endif
1240 {
1241 auto intf = Doxygen::parserManager->getCodeParser(getDefFileExtension());
1242 intf->resetCodeParserState();
1243 intf->parseCode(
1244 devNullList,QCString(),
1245 fileToString(absFilePath(),filterSourceFiles,TRUE),
1246 getLanguage(),
1247 Config_getBool(STRIP_CODE_COMMENTS),
1248 FALSE,QCString(),this
1249 );
1250 }
1251}
1252
1254{
1255 for (auto &ml : m_memberLists)
1256 {
1257 if (ml->listType().isDeclaration())
1258 {
1260 }
1261 }
1262
1263 // add members inside sections to their groups
1264 for (const auto &mg : m_memberGroups)
1265 {
1266 if (mg->allMembersInSameSection() && m_subGrouping)
1267 {
1268 //printf("----> addToDeclarationSection(%s)\n",qPrint(mg->header()));
1269 mg->addToDeclarationSection();
1270 }
1271 }
1272}
1273
1274/*! Adds member definition \a md to the list of all members of this file */
1276{
1277 if (md->isHidden()) return;
1278 //printf("%s:FileDefImpl::insertMember(%s (=%p) list has %d elements)\n",
1279 // qPrint(name()),qPrint(md->name()),md,allMemberList.count());
1280 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
1281 if (allMemberList && allMemberList->contains(md))
1282 {
1283 return;
1284 }
1285
1286 if (allMemberList==nullptr)
1287 {
1288 m_memberLists.emplace_back(std::make_unique<MemberList>(MemberListType::AllMembersList(),MemberListContainer::File));
1289 allMemberList = m_memberLists.back().get();
1290 }
1291 allMemberList->push_back(md);
1292 switch (md->memberType())
1293 {
1295 if (md->getLanguage() == SrcLangExt::Python)
1296 {
1297 addMemberToList(MemberListType::PropertyMembers(),md);
1298 addMemberToList(MemberListType::Properties(),md);
1299 break;
1300 }
1301 // fallthrough, explicitly no break here
1303 addMemberToList(MemberListType::DecVarMembers(),md);
1304 addMemberToList(MemberListType::DocVarMembers(),md);
1305 break;
1307 addMemberToList(MemberListType::DecFuncMembers(),md);
1308 addMemberToList(MemberListType::DocFuncMembers(),md);
1309 break;
1311 addMemberToList(MemberListType::DecTypedefMembers(),md);
1312 addMemberToList(MemberListType::DocTypedefMembers(),md);
1313 break;
1315 addMemberToList(MemberListType::DecSequenceMembers(),md);
1316 addMemberToList(MemberListType::DocSequenceMembers(),md);
1317 break;
1319 addMemberToList(MemberListType::DecDictionaryMembers(),md);
1320 addMemberToList(MemberListType::DocDictionaryMembers(),md);
1321 break;
1323 addMemberToList(MemberListType::DecEnumMembers(),md);
1324 addMemberToList(MemberListType::DocEnumMembers(),md);
1325 break;
1326 case MemberType::EnumValue: // enum values are shown inside their enums
1327 break;
1328 case MemberType::Define:
1329 addMemberToList(MemberListType::DecDefineMembers(),md);
1330 addMemberToList(MemberListType::DocDefineMembers(),md);
1331 break;
1332 default:
1333 err("FileDefImpl::insertMembers(): "
1334 "member '%s' with class scope '%s' inserted in file scope '%s'!\n",
1335 qPrint(md->name()),
1336 md->getClassDef() ? qPrint(md->getClassDef()->name()) : "<global>",
1337 qPrint(name()));
1338 }
1339 //addMemberToGroup(md,groupId);
1340}
1341
1343{
1344 MemberList *ml = getMemberList(lt);
1345 if (ml) ml->remove(md);
1346}
1347
1349{
1350 removeMemberFromList(MemberListType::AllMembersList(),md);
1351 switch(md->memberType())
1352 {
1354 if (md->getLanguage() == SrcLangExt::Python)
1355 {
1356 removeMemberFromList(MemberListType::PropertyMembers(),md);
1357 removeMemberFromList(MemberListType::Properties(),md);
1358 break;
1359 }
1360 // fallthrough, explicitly no break here
1362 removeMemberFromList(MemberListType::DecVarMembers(),md);
1363 removeMemberFromList(MemberListType::DocVarMembers(),md);
1364 break;
1366 removeMemberFromList(MemberListType::DecFuncMembers(),md);
1367 removeMemberFromList(MemberListType::DocFuncMembers(),md);
1368 break;
1370 removeMemberFromList(MemberListType::DecTypedefMembers(),md);
1371 removeMemberFromList(MemberListType::DocTypedefMembers(),md);
1372 break;
1374 removeMemberFromList(MemberListType::DecSequenceMembers(),md);
1375 removeMemberFromList(MemberListType::DocSequenceMembers(),md);
1376 break;
1378 removeMemberFromList(MemberListType::DecDictionaryMembers(),md);
1379 removeMemberFromList(MemberListType::DocDictionaryMembers(),md);
1380 break;
1382 removeMemberFromList(MemberListType::DecEnumMembers(),md);
1383 removeMemberFromList(MemberListType::DocEnumMembers(),md);
1384 break;
1385 case MemberType::EnumValue: // enum values are shown inside their enums
1386 break;
1387 case MemberType::Define:
1388 removeMemberFromList(MemberListType::DecDefineMembers(),md);
1389 removeMemberFromList(MemberListType::DocDefineMembers(),md);
1390 break;
1391 default:
1392 err("FileDefImpl::removeMember(): unexpected member remove in file!\n");
1393 }
1394}
1395
1396/*! Adds compound definition \a cd to the list of all compounds of this file */
1398{
1399 if (cd->isHidden()) return;
1400
1402
1403 if (Config_getBool(OPTIMIZE_OUTPUT_SLICE))
1404 {
1406 {
1407 list = &m_interfaces;
1408 }
1409 else if (cd->compoundType()==ClassDef::Struct)
1410 {
1411 list = &m_structs;
1412 }
1413 else if (cd->compoundType()==ClassDef::Exception)
1414 {
1415 list = &m_exceptions;
1416 }
1417 }
1418
1419 list->add(cd->name(),cd);
1420}
1421
1423{
1424 if (cd->isHidden()) return;
1425 m_concepts.add(cd->name(),cd);
1426}
1427
1428/*! Adds namespace definition \a nd to the list of all compounds of this file */
1430{
1431 if (nd->isHidden()) return;
1432 m_namespaces.add(nd->name(),nd);
1433}
1434
1436{
1437 if (Config_getBool(FULL_PATH_NAMES))
1438 return m_fileName;
1439 else
1440 return DefinitionMixin::name();
1441}
1442
1443void FileDefImpl::addSourceRef(int line,const Definition *d,const MemberDef *md)
1444{
1445 //printf("FileDefImpl::addSourceRef(%d,%s,%s)\n",line,qPrint(d?d->name():"nullptr"),qPrint(md?md->name():"nullptr"));
1446 if (d)
1447 {
1448 m_srcDefMap.emplace(line,d);
1449 if (md) m_srcMemberMap.emplace(line,md);
1450 //printf("Adding member %s with anchor %s at line %d to file %s\n",
1451 // md?qPrint(md->name()):"<none>",md?qPrint(md->anchor()):"<none>",line,qPrint(name()));
1452 }
1453}
1454
1456{
1457 auto it = m_srcDefMap.find(lineNr);
1458 //printf("%s::getSourceDefinition(%d)=%s\n",qPrint(name()),lineNr,it!=m_srcDefMap.end()?qPrint(it->second->name()):"none");
1459 return it!=m_srcDefMap.end() ? it->second : nullptr;
1460}
1461
1463{
1464 auto it = m_srcMemberMap.find(lineNr);
1465 //printf("%s::getSourceMember(%d)=%s\n",qPrint(name()),lineNr,it!=m_srcMemberMap.end()?qPrint(it->second->name()):"none");
1466 return it!=m_srcMemberMap.end() ? it->second : nullptr;
1467}
1468
1469
1471{
1472 m_usingDirList.add(nd->qualifiedName(),nd);
1473 //printf("%p: FileDefImpl::addUsingDirective: %s:%d\n",this,qPrint(name()),usingDirList->count());
1474}
1475
1477{
1478 //printf("%p: FileDefImpl::getUsedNamespace: %s:%d\n",this,qPrint(name()),usingDirList?usingDirList->count():0);
1479 return m_usingDirList;
1480}
1481
1486
1488{
1489 //printf("FileDefImpl::addIncludeDependency(%p,%s,%d)\n",(void*)fd,qPrint(incName),kind);
1490 QCString iName = fd ? fd->absFilePath() : incName;
1491 if (!iName.isEmpty() && m_includeMap.find(iName.str())==m_includeMap.end())
1492 {
1493 m_includeList.emplace_back(fd,incName,kind);
1494 m_includeMap.emplace(iName.str(),&m_includeList.back());
1495 }
1496}
1497
1499{
1500 if (visitedFiles.find(this)!=visitedFiles.end()) return; // file already processed
1501 visitedFiles.insert(this);
1502 //printf("( FileDefImpl::addIncludedUsingDirectives for file %s\n",qPrint(name()));
1503
1504 if (!m_includeList.empty()) // file contains #includes
1505 {
1506 {
1507 for (const auto &ii : m_includeList) // foreach #include...
1508 {
1509 if (ii.fileDef) // ...that is a known file
1510 {
1511 // recurse into this file
1512 const_cast<FileDef*>(ii.fileDef)->addIncludedUsingDirectives(visitedFiles);
1513 }
1514 }
1515 }
1516 {
1517 // iterate through list from last to first
1518 for (auto ii_it = m_includeList.rbegin(); ii_it!=m_includeList.rend(); ++ii_it)
1519 {
1520 auto &ii = *ii_it;
1521 if (ii.fileDef && ii.fileDef!=this)
1522 {
1523 // add using directives
1524 auto unl = ii.fileDef->getUsedNamespaces();
1525 for (auto it = unl.rbegin(); it!=unl.rend(); ++it)
1526 {
1527 auto *nd = *it;
1528 //printf(" adding using directive for %s\n",qPrint(nd->qualifiedName()));
1529 m_usingDirList.prepend(nd->qualifiedName(),nd);
1530 }
1531 // add using declarations
1532 auto udl = ii.fileDef->getUsedDefinitions();
1533 for (auto it = udl.rbegin(); it!=udl.rend(); ++it)
1534 {
1535 auto *d = *it;
1536 m_usingDeclList.prepend(d->qualifiedName(),d);
1537 }
1538 }
1539 }
1540 }
1541 }
1542 //printf(") end FileDefImpl::addIncludedUsingDirectives for file %s\n",qPrint(name()));
1543}
1544
1545
1547{
1548 //printf("FileDefImpl::addIncludedByDependency(%p,%s,%d)\n",fd,incName,local);
1549 QCString iName = fd ? fd->absFilePath() : incName;
1550 if (!iName.isEmpty() && m_includedByMap.find(iName.str())==m_includedByMap.end())
1551 {
1552 m_includedByList.emplace_back(fd,incName,kind);
1553 m_includedByMap.emplace(iName.str(),&m_includedByList.back());
1554 }
1555}
1556
1558{
1559 if (name.isEmpty()) return FALSE;
1560 return m_includeMap.find(name.str())!=m_includeMap.end();
1561}
1562
1564{
1565 bool sourceBrowser = Config_getBool(SOURCE_BROWSER);
1566 bool verbatimHeaders = Config_getBool(VERBATIM_HEADERS);
1567 return !isReference() &&
1568 (sourceBrowser ||
1569 (verbatimHeaders && (guessSection(name()).isHeader() || !m_includedByMap.empty()))
1570 ) &&
1572}
1573
1574
1576{
1577 {
1578 const RefItemVector &xrefItems = xrefListItems();
1579 addRefItem(xrefItems,
1581 theTranslator->trFile(TRUE,TRUE),
1583 QCString(),
1584 nullptr
1585 );
1586 }
1587 for (const auto &mg : m_memberGroups)
1588 {
1589 mg->addListReferences(this);
1590 }
1591 for (auto &ml : m_memberLists)
1592 {
1593 if (ml->listType().isDocumentation())
1594 {
1595 ml->addListReferences(this);
1596 }
1597 }
1598}
1599
1600//-------------------------------------------------------------------
1601
1603{
1605 NamespaceDefSet visitedNamespaces;
1606 for (auto &nd : usingDirList)
1607 {
1609 if (ndm)
1610 {
1611 ndm->combineUsingRelations(visitedNamespaces);
1612 }
1613 }
1614
1615 for (auto &nd : usingDirList)
1616 {
1617 // add used namespaces of namespace nd to this namespace
1618 for (const auto &und : nd->getUsedNamespaces())
1619 {
1620 addUsingDirective(und);
1621 }
1622 // add used classes of namespace nd to this namespace
1623 for (const auto &ud : nd->getUsedDefinitions())
1624 {
1626 }
1627 }
1628}
1629
1631{
1632 static const std::unordered_set<std::string> docExtensions =
1633 { "doc", "txt", "dox", "md", "markdown" };
1634
1635 int lastDot = name().findRev('.');
1636 return (lastDot!=-1 && docExtensions.find(name().mid(lastDot+1).str())!=docExtensions.end()) ||
1638}
1639
1641{
1642 QCString vercmd = Config_getString(FILE_VERSION_FILTER);
1643 if (!vercmd.isEmpty() && !m_filePath.isEmpty() && !isReference() &&
1644 m_filePath!="generated" && m_filePath!="graph_legend.dox")
1645 {
1646 msg("Version of %s : ",qPrint(m_filePath));
1647 QCString cmd = vercmd+" \""+m_filePath+"\"";
1648 Debug::print(Debug::ExtCmd,0,"Executing popen(`%s`)\n",qPrint(cmd));
1649 FILE *f=Portable::popen(cmd,"r");
1650 if (!f)
1651 {
1652 err("could not execute %s\n",qPrint(vercmd));
1653 return;
1654 }
1655 const int bufSize=1024;
1656 char buf[bufSize];
1657 int numRead = static_cast<int>(fread(buf,1,bufSize-1,f));
1659 if (numRead>0 && numRead<bufSize)
1660 {
1661 buf[numRead]='\0';
1662 m_fileVersion=QCString(buf,numRead).stripWhiteSpace();
1663 if (!m_fileVersion.isEmpty())
1664 {
1665 msg("%s\n",qPrint(m_fileVersion));
1666 return;
1667 }
1668 }
1669 msg("no version available\n");
1670 }
1671}
1672
1673
1675{
1676 if (Htags::useHtags)
1677 {
1679 }
1680 else
1681 {
1682 return m_outputDiskName+"_source";
1683 }
1684}
1685
1690
1691/*! Returns the name of the verbatim copy of this file (if any). */
1693{
1694 return getSourceFileBase();
1695}
1696
1698{
1699 bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS);
1700 bool sortMemberDocs = Config_getBool(SORT_MEMBER_DOCS);
1701 const auto &ml = m_memberLists.get(lt,MemberListContainer::File);
1702 ml->setNeedsSorting(
1703 (ml->listType().isDeclaration() && sortBriefDocs) ||
1704 (ml->listType().isDocumentation() && sortMemberDocs));
1705 ml->push_back(md);
1706 if (ml->listType().isDeclaration())
1707 {
1709 if (mdm)
1710 {
1711 mdm->setSectionList(this,ml.get());
1712 }
1713 }
1714}
1715
1717{
1718 for (auto &ml : m_memberLists)
1719 {
1720 if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(FALSE); }
1721 }
1722
1723 for (const auto &mg : m_memberGroups)
1724 {
1725 MemberList &mlg = const_cast<MemberList&>(mg->members());
1726 if (mlg.needsSorting()) { mlg.sort(); mlg.setNeedsSorting(FALSE); }
1727 }
1728
1729 std::stable_sort(m_includedByList.begin(),m_includedByList.end(),
1730 [](const auto &fi1,const auto &fi2) { return fi1.includeName < fi2.includeName; });
1731
1732 if (Config_getBool(SORT_BRIEF_DOCS))
1733 {
1734 auto classComp = [](const ClassLinkedRefMap::Ptr &c1,const ClassLinkedRefMap::Ptr &c2)
1735 {
1736 return Config_getBool(SORT_BY_SCOPE_NAME) ?
1737 qstricmp_sort(c1->name(), c2->name())<0 :
1738 qstricmp_sort(c1->className(), c2->className())<0;
1739 };
1740
1741 std::stable_sort(m_classes.begin(), m_classes.end(), classComp);
1742 std::stable_sort(m_interfaces.begin(),m_interfaces.end(),classComp);
1743 std::stable_sort(m_structs.begin(), m_structs.end(), classComp);
1744 std::stable_sort(m_exceptions.begin(),m_exceptions.end(),classComp);
1745
1746 auto namespaceComp = [](const NamespaceLinkedRefMap::Ptr &n1,const NamespaceLinkedRefMap::Ptr &n2)
1747 {
1748 return qstricmp_sort(n1->name(),n2->name())<0;
1749 };
1750
1751 std::stable_sort(m_namespaces.begin(),m_namespaces.end(),namespaceComp);
1752 }
1753}
1754
1756{
1757 for (auto &ml : m_memberLists)
1758 {
1759 if (ml->listType()==lt)
1760 {
1761 return ml.get();
1762 }
1763 }
1764 return nullptr;
1765}
1766
1768{
1769 bool optVhdl = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
1770 MemberList * ml = getMemberList(lt);
1771 if (ml)
1772 {
1773 if (optVhdl) // use specific declarations function
1774 {
1775
1776 VhdlDocGen::writeVhdlDeclarations(ml,ol,nullptr,nullptr,this,nullptr,nullptr);
1777 }
1778 else
1779 {
1780 ml->writeDeclarations(ol,nullptr,nullptr,this,nullptr,nullptr,title,QCString());
1781 }
1782 }
1783}
1784
1786{
1787 MemberList * ml = getMemberList(lt);
1788 if (ml) ml->writeDocumentation(ol,name(),this,title);
1789}
1790
1792{
1793 bool showFiles = Config_getBool(SHOW_FILES);
1794 return hasDocumentation() && !isReference() && (showFiles || isLinkableViaGroup());
1795}
1796
1798 StringUnorderedSet &filesVisited,const FileDef *fd,StringVector &incFiles)
1799{
1800 for (const auto &ii : fd->includeFileList())
1801 {
1802 if (ii.fileDef && !ii.fileDef->isReference() &&
1803 filesVisited.find(ii.fileDef->absFilePath().str())==filesVisited.end())
1804 {
1805 //printf("FileDefImpl::addIncludeDependency(%s)\n",qPrint(ii->fileDef->absFilePath()));
1806 incFiles.push_back(ii.fileDef->absFilePath().str());
1807 filesVisited.insert(ii.fileDef->absFilePath().str());
1808 getAllIncludeFilesRecursively(filesVisited,ii.fileDef,incFiles);
1809 }
1810 }
1811}
1812
1814{
1815 StringUnorderedSet includes;
1816 ::getAllIncludeFilesRecursively(includes,this,incFiles);
1817}
1818
1820{
1821 return theTranslator->trFileReference(name());
1822}
1823
1825{
1826 return m_fileVersion;
1827}
1828
1833
1838
1840{
1841 for (auto &ml : m_memberLists)
1842 {
1843 ml->countDecMembers();
1844 ml->countDocMembers();
1845 }
1846 for (const auto &mg : m_memberGroups)
1847 {
1848 mg->countDecMembers();
1849 mg->countDocMembers();
1850 }
1851}
1852
1854{
1855 MemberList *ml = getMemberList(MemberListType::AllMembersList());
1856 return ml ? ml->numDocMembers() : 0;
1857}
1858
1860{
1861 MemberList *ml = getMemberList(MemberListType::AllMembersList());
1862 return ml ? ml->numDecMembers() : 0;
1863}
1864
1869
1874
1876{
1877 return m_hasIncludeGraph;
1878}
1879
1881{
1882 return m_hasIncludedByGraph;
1883}
1884
1885// -----------------------
1886
1887bool compareFileDefs(const FileDef *fd1, const FileDef *fd2)
1888{
1889 return qstricmp_sort(fd1->name(),fd2->name()) < 0;
1890}
1891
1892// --- Cast functions
1893
1895{
1896 if (d==nullptr) return nullptr;
1897 if (d && typeid(*d)==typeid(FileDefImpl))
1898 {
1899 return static_cast<FileDef*>(d);
1900 }
1901 else
1902 {
1903 return nullptr;
1904 }
1905}
1906
1908{
1909 if (d==nullptr) return nullptr;
1910 if (d && typeid(*d)==typeid(FileDefImpl))
1911 {
1912 return static_cast<const FileDef*>(d);
1913 }
1914 else
1915 {
1916 return nullptr;
1917 }
1918}
1919
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.
void writeDeclaration(OutputList &ol, const ClassDef::CompoundType *filter, const QCString &header, bool localNames) const
Definition classlist.cpp:53
@ ExtCmd
Definition debug.h:35
static void print(DebugMask mask, int prio, const char *fmt,...)
Definition debug.cpp:81
The common base class of all entity definitions found in the sources.
Definition definition.h:76
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
const QCString & name() const override
bool isLinkableViaGroup() const override
bool hasBriefDescription() const override
QCString docFile() const override
QCString getDefFileExtension() const override
QCString briefFile() const override
void setLanguage(SrcLangExt lang) override
void setReference(const QCString &r) override
const RefItemVector & xrefListItems() const override
QCString briefDescription(bool abbreviate=FALSE) const override
DefinitionMixin(const QCString &defFileName, int defLine, int defColumn, const QCString &name, const char *b=nullptr, const char *d=nullptr, bool isSymbol=TRUE)
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:132
static bool parseSourcesNeeded
Definition doxygen.h:123
static bool clangAssistedParsing
Definition doxygen.h:138
static ParserManager * parserManager
Definition doxygen.h:131
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:1630
void findSectionsInDocumentation() override
Definition filedef.cpp:344
void setModuleDef(ModuleDef *mod) override
Definition filedef.cpp:190
void addIncludedUsingDirectives(FileDefSet &visitedFiles) override
Definition filedef.cpp:1498
void writeBriefDescription(OutputList &ol)
Definition filedef.cpp:533
const LinkedRefMap< const Definition > & getUsedDefinitions() const override
Definition filedef.cpp:155
void setDiskName(const QCString &name) override
Definition filedef.cpp:323
void addSourceRef(int line, const Definition *d, const MemberDef *md) override
Definition filedef.cpp:1443
LinkedRefMap< const Definition > m_usingDeclList
Definition filedef.cpp:240
DirDef * m_dir
Definition filedef.cpp:252
QCString getOutputFileBase() const override
Definition filedef.cpp:1686
void insertNamespace(NamespaceDef *nd) override
Definition filedef.cpp:1429
ModuleDef * getModuleDef() const override
Definition filedef.cpp:153
void writeQuickMemberLinks(OutputList &ol, const MemberDef *currentMd) const override
Definition filedef.cpp:1066
void writeSourceLink(OutputList &ol)
Definition filedef.cpp:683
void writeSummaryLinks(OutputList &ol) const override
Definition filedef.cpp:782
QCString absFilePath() const override
Definition filedef.cpp:141
QCString m_path
Definition filedef.cpp:241
ClassLinkedRefMap m_interfaces
Definition filedef.cpp:258
const ConceptLinkedRefMap & getConcepts() const override
Definition filedef.cpp:163
QCString m_inclDepFileName
Definition filedef.cpp:243
ClassLinkedRefMap m_structs
Definition filedef.cpp:259
void sortMemberLists() override
Definition filedef.cpp:1716
void parseSource(ClangTUParser *clangParser) override
Definition filedef.cpp:1226
void setDiskNameLocal(const QCString &name)
Definition filedef.cpp:307
void addMemberToList(MemberListType lt, MemberDef *md)
Definition filedef.cpp:1697
void acquireFileVersion()
Definition filedef.cpp:1640
QCString m_fileVersion
Definition filedef.cpp:251
void addUsingDirective(NamespaceDef *nd) override
Definition filedef.cpp:1470
void writeNamespaceDeclarations(OutputList &ol, const QCString &title, bool isConstantGroup)
Definition filedef.cpp:698
void countMembers() override
Definition filedef.cpp:1839
void distributeMemberGroupDocumentation() override
Definition filedef.cpp:335
MemberDefLineMap m_srcMemberMap
Definition filedef.cpp:249
ConceptLinkedRefMap m_concepts
Definition filedef.cpp:261
void insertClass(ClassDef *cd) override
Definition filedef.cpp:1397
DefinitionLineMap m_srcDefMap
Definition filedef.cpp:248
QCString getSourceFileBase() const override
Definition filedef.cpp:1674
NamespaceLinkedRefMap m_namespaces
Definition filedef.cpp:256
ModuleDef * m_moduleDef
Definition filedef.cpp:253
IncludeInfoList m_includedByList
Definition filedef.cpp:238
CodeSymbolType codeSymbolType() const override
Definition filedef.cpp:130
void writeClassDeclarations(OutputList &ol, const QCString &title, const ClassLinkedRefMap &list)
Definition filedef.cpp:705
QCString anchor() const override
Definition filedef.cpp:136
bool m_hasIncludeGraph
Definition filedef.cpp:263
const NamespaceLinkedRefMap & getNamespaces() const override
Definition filedef.cpp:162
void removeMember(MemberDef *md) override
Definition filedef.cpp:1348
void addUsingDeclaration(const Definition *d) override
Definition filedef.cpp:1482
ClassLinkedRefMap m_exceptions
Definition filedef.cpp:260
QCString includeName() const override
Definition filedef.cpp:1692
void writeTagFile(TextStream &t) override
Definition filedef.cpp:373
void endMemberDeclarations(OutputList &ol)
Definition filedef.cpp:735
void addListReferences() override
Definition filedef.cpp:1575
void writeMemberDeclarations(OutputList &ol, MemberListType lt, const QCString &title)
Definition filedef.cpp:1767
const MemberGroupList & getMemberGroups() const override
Definition filedef.cpp:161
IncludeInfoMap m_includedByMap
Definition filedef.cpp:237
void insertMember(MemberDef *md) override
Definition filedef.cpp:1275
const LinkedRefMap< NamespaceDef > & getUsedNamespaces() const override
Definition filedef.cpp:1476
void writeInlineClasses(OutputList &ol)
Definition filedef.cpp:717
const QCString & docName() const override
Definition filedef.cpp:142
void writeIncludeFiles(OutputList &ol)
Definition filedef.cpp:583
MemberGroupList m_memberGroups
Definition filedef.cpp:255
void computeAnchors() override
Definition filedef.cpp:329
void writeDetailedDescription(OutputList &ol, const QCString &title)
Definition filedef.cpp:471
QCString m_fileName
Definition filedef.cpp:246
void writeMemberPages(OutputList &ol) override
Definition filedef.cpp:1050
void writeSourceFooter(OutputList &ol) override
Definition filedef.cpp:1219
QCString fileVersion() const override
Definition filedef.cpp:1824
void writeConcepts(OutputList &ol, const QCString &title)
Definition filedef.cpp:711
bool generateSourceFile() const override
Definition filedef.cpp:1563
void writeIncludedByGraph(OutputList &ol)
Definition filedef.cpp:657
const QCString & name() const override
Definition filedef.cpp:1435
bool m_isSource
Definition filedef.cpp:250
const MemberDef * getSourceMember(int lineNr) const override
Definition filedef.cpp:1462
QCString m_outputDiskName
Definition filedef.cpp:245
bool isIncluded(const QCString &name) const override
Definition filedef.cpp:1557
~FileDefImpl() override
Definition filedef.cpp:303
const IncludeInfoList & includeFileList() const override
Definition filedef.cpp:156
void removeMemberFromList(MemberListType lt, MemberDef *md)
Definition filedef.cpp:1342
void getAllIncludeFilesRecursively(StringVector &incFiles) const override
Definition filedef.cpp:1813
MemberLists m_memberLists
Definition filedef.cpp:254
LinkedRefMap< NamespaceDef > m_usingDirList
Definition filedef.cpp:239
QCString getVersion() const override
Definition filedef.cpp:148
void writeAuthorSection(OutputList &ol)
Definition filedef.cpp:770
void insertConcept(ConceptDef *cd) override
Definition filedef.cpp:1422
const MemberLists & getMemberLists() const override
Definition filedef.cpp:160
void addIncludedByDependency(const FileDef *fd, const QCString &incName, IncludeKind kind) override
Definition filedef.cpp:1546
IncludeInfoMap m_includeMap
Definition filedef.cpp:235
bool m_subGrouping
Definition filedef.cpp:262
QCString m_inclByDepFileName
Definition filedef.cpp:244
DirDef * getDirDef() const override
Definition filedef.cpp:152
void overrideIncludeGraph(bool e) override
Definition filedef.cpp:1865
ClassLinkedRefMap m_classes
Definition filedef.cpp:257
QCString m_docname
Definition filedef.cpp:247
void overrideIncludedByGraph(bool e) override
Definition filedef.cpp:1870
const IncludeInfoList & includedByFileList() const override
Definition filedef.cpp:157
bool hasIncludedByGraph() const override
Definition filedef.cpp:1880
QCString displayName(bool=TRUE) const override
Definition filedef.cpp:133
bool subGrouping() const override
Definition filedef.cpp:168
QCString m_filePath
Definition filedef.cpp:242
void writeMemberDocumentation(OutputList &ol, MemberListType lt, const QCString &title)
Definition filedef.cpp:1785
void writeSourceHeader(OutputList &ol) override
Definition filedef.cpp:1110
FileDefImpl(const QCString &p, const QCString &n, const QCString &ref=QCString(), const QCString &dn=QCString())
Definition filedef.cpp:279
void writeSourceBody(OutputList &ol, ClangTUParser *clangParser) override
Definition filedef.cpp:1163
void writeIncludeGraph(OutputList &ol)
Definition filedef.cpp:632
QCString title() const override
Definition filedef.cpp:1819
void addMembersToMemberGroup() override
Definition filedef.cpp:1253
int numDocMembers() const override
Definition filedef.cpp:1853
QCString getPath() const override
Definition filedef.cpp:147
bool m_hasIncludedByGraph
Definition filedef.cpp:264
IncludeInfoList m_includeList
Definition filedef.cpp:236
void startMemberDocumentation(OutputList &ol)
Definition filedef.cpp:740
int numDecMembers() const override
Definition filedef.cpp:1859
void writeClassesToTagFile(TextStream &t, const ClassLinkedRefMap &list)
Definition filedef.cpp:571
MemberList * getMemberList(MemberListType lt) const override
Definition filedef.cpp:1755
void startMemberDeclarations(OutputList &ol)
Definition filedef.cpp:730
bool isSource() const override
Definition filedef.cpp:143
void combineUsingRelations() override
Definition filedef.cpp:1602
bool isLinkableInProject() const override
Definition filedef.cpp:1791
void endMemberDocumentation(OutputList &ol)
Definition filedef.cpp:749
QCString includedByDependencyGraphFileName() const override
Definition filedef.cpp:1834
const ClassLinkedRefMap & getClasses() const override
Definition filedef.cpp:164
QCString fileName() const override
Definition filedef.cpp:134
bool hasIncludeGraph() const override
Definition filedef.cpp:1875
void writeDocumentation(OutputList &ol) override
Definition filedef.cpp:851
bool isLinkable() const override
Definition filedef.cpp:150
void addIncludeDependency(const FileDef *fd, const QCString &incName, IncludeKind kind) override
Definition filedef.cpp:1487
DefType definitionType() const override
Definition filedef.cpp:129
bool hasDetailedDescription() const override
Definition filedef.cpp:363
QCString includeDependencyGraphFileName() const override
Definition filedef.cpp:1829
void setDirDef(DirDef *dd) override
Definition filedef.cpp:189
void writeMemberGroups(OutputList &ol)
Definition filedef.cpp:758
const Definition * getSourceDefinition(int lineNr) const override
Definition filedef.cpp:1455
static LayoutDocManager & instance()
Returns a reference to this singleton.
Definition layout.cpp:1423
Container class representing a vector of objects with keys.
Definition linkedmap.h:232
bool add(const char *k, T *obj)
Adds an object reference to the ordered vector if it was not added already.
Definition linkedmap.h:284
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:108
bool needsSorting() const
Definition memberlist.h:120
int numDocMembers() const
Definition memberlist.h:118
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)
int numDecMembers() const
Definition memberlist.h:116
void setNeedsSorting(bool b)
MemberListType listType() const
Definition memberlist.h:113
void writeDocumentation(OutputList &ol, const QCString &scopeName, const Definition *container, const QCString &title, bool showEnumValues=FALSE, bool showInline=FALSE) const
void setAnchors()
bool declVisible() const
Wrapper class for the MemberListType type.
Definition types.h:184
constexpr const char * toLabel() const
Definition types.h:240
void remove(const MemberDef *md)
Definition memberlist.h:83
void sort()
Definition memberlist.h:75
bool contains(const MemberDef *md) const
Definition memberlist.h:88
void push_back(const T &value)
Definition memberlist.h:47
static ModuleManager & instance()
ModuleDef * getPrimaryInterface(const QCString &moduleName) const
An abstract interface of a namespace symbol.
virtual void combineUsingRelations(NamespaceDefSet &visitedNamespace)=0
Class representing a list of different code generators.
Definition outputlist.h:164
void add(OutputCodeIntfPtr &&p)
Definition outputlist.h:194
void startCodeFragment(const QCString &style)
Definition outputlist.h:278
Class representing a list of output generators that are written to in parallel.
Definition outputlist.h:314
bool isEnabled(OutputType o)
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 disable(OutputType o)
void startInclDepGraph()
Definition outputlist.h:651
void writeRuler()
Definition outputlist.h:522
const OutputCodeList & codeGenerators() const
Definition outputlist.h:357
void enable(OutputType o)
void endContents()
Definition outputlist.h:619
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 docify(const QCString &s)
Definition outputlist.h:438
void startParagraph(const QCString &classDef=QCString())
Definition outputlist.h:408
void startProjectNumber()
Definition outputlist.h:392
void startTextBlock(bool dense=FALSE)
Definition outputlist.h:669
void endParagraph()
Definition outputlist.h:410
void endInclDepGraph(DotInclDepGraph &g)
Definition outputlist.h:653
void startMemberSections()
Definition outputlist.h:462
void endTextLink()
Definition outputlist.h:445
void writeSynopsis()
Definition outputlist.h:593
void startTypewriter()
Definition outputlist.h:450
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 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 endGroupHeader(int extraLevels=0)
Definition outputlist.h:456
void endQuickIndices()
Definition outputlist.h:605
void startContents()
Definition outputlist.h:617
void enableAll()
void endProjectNumber()
Definition outputlist.h:394
void endTypewriter()
Definition outputlist.h:452
void lineBreak(const QCString &style=QCString())
Definition outputlist.h:560
void parseText(const QCString &textStr)
void startTextLink(const QCString &file, const QCString &anchor)
Definition outputlist.h:443
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
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:153
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition qcstring.h:245
const std::string & str() const
Definition qcstring.h:537
QCString right(size_t len) const
Definition qcstring.h:219
QCString & sprintf(const char *format,...)
Definition qcstring.cpp:29
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition qcstring.cpp:91
QCString & insert(size_t index, const QCString &s)
Definition qcstring.h:317
QCString left(size_t len) const
Definition qcstring.h:214
Text streaming class that buffers data.
Definition textstream.h:36
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)
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()
std::unordered_map< std::string, const IncludeInfo * > IncludeInfoMap
Definition filedef.cpp:120
QCString includeClose(SrcLangExt lang, IncludeKind kind)
Definition filedef.cpp:86
std::unordered_map< int, const Definition * > DefinitionLineMap
Definition filedef.cpp:118
QCString includeStatement(SrcLangExt lang, IncludeKind kind)
Definition filedef.cpp:56
std::unique_ptr< FileDef > createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
Definition filedef.cpp:267
bool compareFileDefs(const FileDef *fd1, const FileDef *fd2)
Definition filedef.cpp:1887
FileDef * toFileDef(Definition *d)
Definition filedef.cpp:1894
std::unordered_map< int, const MemberDef * > MemberDefLineMap
Definition filedef.cpp:119
QCString includeOpen(SrcLangExt lang, IncludeKind kind)
Definition filedef.cpp:73
QCString includeTagFileAttributes(SrcLangExt lang, IncludeKind kind)
Definition filedef.cpp:104
static void getAllIncludeFilesRecursively(StringUnorderedSet &filesVisited, const FileDef *fd, StringVector &incFiles)
Definition filedef.cpp:1797
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:395
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
void endFileWithNavPath(OutputList &ol, const Definition *d)
Definition index.cpp:441
Translator * theTranslator
Definition language.cpp:71
MemberDefMutable * toMemberDefMutable(Definition *d)
void msg(const char *fmt,...)
Definition message.cpp:98
#define warn_uncond(fmt,...)
Definition message.h:79
#define err(fmt,...)
Definition message.h:84
FILE * popen(const QCString &name, const QCString &type)
Definition portable.cpp:496
int pclose(FILE *stream)
Definition portable.cpp:505
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: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
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
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:109
QCString title(SrcLangExt lang) const
Definition layout.cpp:1533
MemberListType type
Definition layout.h:115
Represents of a member definition list with configurable title.
Definition layout.h:125
MemberListType type
Definition layout.h:130
QCString title(SrcLangExt lang) const
Definition layout.cpp:1545
Definition layout.h:99
QCString title(SrcLangExt lang) const
Definition layout.cpp:1526
CodeSymbolType
Definition types.h:319
@ Enumeration
Definition types.h:395
@ EnumValue
Definition types.h:396
@ Dictionary
Definition types.h:406
@ Sequence
Definition types.h:405
@ Variable
Definition types.h:393
@ Property
Definition types.h:401
@ Typedef
Definition types.h:394
@ Function
Definition types.h:392
SrcLangExt
Language as given by extension.
Definition types.h:42
@ Markdown
Definition types.h:57
@ Python
Definition types.h:52
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5549
QCString convertToHtml(const QCString &s, bool keepEntities)
Definition util.cpp:4317
void addRefItem(const RefItemVector &sli, const QCString &key, const QCString &prefix, const QCString &name, const QCString &title, const QCString &args, const Definition *scope)
Definition util.cpp:5146
void addGroupListToTitle(OutputList &ol, const Definition *d)
Definition util.cpp:5233
QCString fileToString(const QCString &name, bool filter, bool isSourceCode)
Definition util.cpp:1414
void createSubDirs(const Dir &d)
Definition util.cpp:3994
static QCString stripFromPath(const QCString &p, const StringVector &l)
Definition util.cpp:309
QCString convertNameToFile(const QCString &name, bool allowDots, bool allowUnderscore)
Definition util.cpp:3858
QCString convertToXML(const QCString &s, bool keepEntities)
Definition util.cpp:4266
EntryType guessSection(const QCString &name)
Definition util.cpp:349
QCString removeLongPathMarker(QCString path)
Definition util.cpp:298
QCString getFileFilter(const QCString &name, bool isSourceCode)
Definition util.cpp:1342
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5591
void addHtmlExtensionIfMissing(QCString &fName)
Definition util.cpp:5243
A bunch of utility functions.