Doxygen
Loading...
Searching...
No Matches
index.cpp
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Copyright (C) 1997-2023 by Dimitri van Heesch.
4 *
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation under the terms of the GNU General Public License is hereby
7 * granted. No representations are made about the suitability of this software
8 * for any purpose. It is provided "as is" without express or implied warranty.
9 * See the GNU General Public License for more details.
10 *
11 * Documents produced by Doxygen are derivative works derived from the
12 * input used in their production; they are not affected by this license.
13 *
14 */
15
16/** @file
17 * @brief This file contains functions for the various index pages.
18 */
19
20#include <cstdlib>
21#include <array>
22
23#include <assert.h>
24
25#include "message.h"
26#include "index.h"
27#include "indexlist.h"
28#include "doxygen.h"
29#include "config.h"
30#include "filedef.h"
31#include "outputlist.h"
32#include "util.h"
33#include "groupdef.h"
34#include "language.h"
35#include "htmlgen.h"
36#include "htmlhelp.h"
37#include "ftvhelp.h"
38#include "dot.h"
40#include "dotlegendgraph.h"
41#include "pagedef.h"
42#include "dirdef.h"
43#include "vhdldocgen.h"
44#include "layout.h"
45#include "memberlist.h"
46#include "classlist.h"
47#include "namespacedef.h"
48#include "filename.h"
49#include "tooltip.h"
50#include "utf8.h"
51#include "portable.h"
52#include "moduledef.h"
53#include "sitemap.h"
54#include "conceptdef.h"
55
56#define MAX_ITEMS_BEFORE_MULTIPAGE_INDEX 200
57#define MAX_ITEMS_BEFORE_QUICK_INDEX 30
58
59constexpr auto alphaSepar = "<div class=\"alphasepar\"></div>";
60
61// helpers
63static void countFiles(int &htmlFiles,int &files);
64static int countGroups();
65static int countDirs();
66static int countNamespaces();
67static int countConcepts();
69static void countRelatedPages(int &docPages,int &indexPages);
70
71
73{
89 int indexedPages = 0;
93 std::array<int, ClassMemberHighlight::Total> documentedClassMembers = {};
94 std::array<int, FileMemberHighlight::Total> documentedFileMembers = {};
95 std::array<int,NamespaceMemberHighlight::Total> documentedNamespaceMembers = {};
96 std::array<int, ModuleMemberHighlight::Total> documentedModuleMembers = {};
97 std::array<MemberIndexMap,ClassMemberHighlight::Total> classIndexLetterUsed;
98 std::array<MemberIndexMap,FileMemberHighlight::Total> fileIndexLetterUsed;
99 std::array<MemberIndexMap,NamespaceMemberHighlight::Total> namespaceIndexLetterUsed;
100 std::array<MemberIndexMap,ModuleMemberHighlight::Total> moduleIndexLetterUsed;
101};
102
103Index::Index() : p(std::make_unique<Private>())
104{
105}
106
107Index::~Index() = default;
108
110{
111 static Index index;
112 return index;
113}
114
115int Index::numAnnotatedClasses() const { return p->annotatedClasses; }
116int Index::numAnnotatedClassesPrinted() const { return p->annotatedClassesPrinted; }
117int Index::numHierarchyClasses() const { return p->hierarchyClasses; }
118int Index::numAnnotatedInterfaces() const { return p->annotatedInterfaces; }
119int Index::numAnnotatedInterfacesPrinted() const { return p->annotatedInterfacesPrinted; }
120int Index::numHierarchyInterfaces() const { return p->hierarchyInterfaces; }
121int Index::numAnnotatedStructs() const { return p->annotatedStructs; }
122int Index::numAnnotatedStructsPrinted() const { return p->annotatedStructsPrinted; }
123int Index::numAnnotatedExceptions() const { return p->annotatedExceptions; }
124int Index::numAnnotatedExceptionsPrinted() const { return p->annotatedExceptionsPrinted; }
125int Index::numHierarchyExceptions() const { return p->hierarchyExceptions; }
126int Index::numDocumentedGroups() const { return p->documentedGroups; }
127int Index::numDocumentedNamespaces() const { return p->documentedNamespaces; }
128int Index::numDocumentedConcepts() const { return p->documentedConcepts; }
129int Index::numDocumentedModules() const { return p->documentedModules; }
130int Index::numIndexedPages() const { return p->indexedPages; }
131int Index::numDocumentedFiles() const { return p->documentedFiles; }
132int Index::numDocumentedPages() const { return p->documentedPages; }
133int Index::numDocumentedDirs() const { return p->documentedDirs; }
134int Index::numDocumentedClassMembers(ClassMemberHighlight::Enum e) const { return p->documentedClassMembers[e]; }
135int Index::numDocumentedFileMembers(FileMemberHighlight::Enum e) const { return p->documentedFileMembers[e]; }
136int Index::numDocumentedNamespaceMembers(NamespaceMemberHighlight::Enum e) const { return p->documentedNamespaceMembers[e]; }
137int Index::numDocumentedModuleMembers(ModuleMemberHighlight::Enum e) const { return p->documentedModuleMembers[e]; }
138
140{
141 return p->classIndexLetterUsed[static_cast<int>(e)];
142}
143
145{
146 return p->fileIndexLetterUsed[static_cast<int>(e)];
147}
148
150{
151 return p->namespaceIndexLetterUsed[static_cast<int>(e)];
152}
153
155{
156 return p->moduleIndexLetterUsed[static_cast<int>(e)];
157}
158
160{
161 p->documentedClassMembers[i]=0;
162 p->classIndexLetterUsed[i].clear();
163}
164
166{
167 p->documentedFileMembers[i]=0;
168 p->fileIndexLetterUsed[i].clear();
169}
170
172{
173 p->documentedNamespaceMembers[i]=0;
174 p->namespaceIndexLetterUsed[i].clear();
175}
176
178{
179 p->documentedModuleMembers[i]=0;
180 p->moduleIndexLetterUsed[i].clear();
181}
182
183static void MemberIndexMap_add(Index::MemberIndexMap &map,const std::string &letter,const MemberDef *md)
184{
185 auto it = map.find(letter);
186 if (it!=map.end())
187 {
188 it->second.push_back(md);
189 }
190 else
191 {
192 map.emplace(letter,std::vector<const MemberDef*>({md}));
193 }
194}
195
196void Index::incrementDocumentedClassMembers(int i,const std::string &letter,const MemberDef *md)
197{
198 p->documentedClassMembers[i]++;
199 MemberIndexMap_add(p->classIndexLetterUsed[i],letter,md);
200}
201
202void Index::incrementDocumentedFileMembers(int i,const std::string &letter,const MemberDef *md)
203{
204 p->documentedFileMembers[i]++;
205 MemberIndexMap_add(p->fileIndexLetterUsed[i],letter,md);
206}
207
208void Index::incrementDocumentedNamespaceMembers(int i,const std::string &letter,const MemberDef *md)
209{
210 p->documentedNamespaceMembers[i]++;
211 MemberIndexMap_add(p->namespaceIndexLetterUsed[i],letter,md);
212}
213
214void Index::incrementDocumentedModuleMembers(int i,const std::string &letter,const MemberDef *md)
215{
216 p->documentedModuleMembers[i]++;
217 MemberIndexMap_add(p->moduleIndexLetterUsed[i],letter,md);
218}
219
220
222{
223 auto sortMemberIndexList = [](MemberIndexMap &map)
224 {
225 for (auto &[name,list] : map)
226 {
227 std::stable_sort(list.begin(),list.end(),
228 [](const MemberDef *md1,const MemberDef *md2)
229 {
230 // consider candidates A::a, B::b, B::a, A::b, A::A, B::B,
231 // want after sorting: A::A, A::a, B::a, B::B, A::b, B::b
232 // so we can later group entries
233 // - A: A
234 // - a: A, B
235 // - B: B
236 // - b: A, B
237 int result = dstricmp_sort(md1->name(),md2->name());
238 if (result==0) // next compare with full scope
239 {
240 result = dstricmp_sort(md1->qualifiedName(),md2->qualifiedName());
241 }
242 return result<0;
243 });
244 }
245 };
246
247 for (auto &idx : p->classIndexLetterUsed)
248 {
249 sortMemberIndexList(idx);
250 }
251 for (auto &idx : p->fileIndexLetterUsed)
252 {
253 sortMemberIndexList(idx);
254 }
255 for (auto &idx : p->namespaceIndexLetterUsed)
256 {
257 sortMemberIndexList(idx);
258 }
259 for (auto &idx : p->moduleIndexLetterUsed)
260 {
261 sortMemberIndexList(idx);
262 }
263}
264
266{
267 for (int j=0;j<ClassMemberHighlight::Total;j++)
268 {
270 }
271 for (int j=0;j<NamespaceMemberHighlight::Total;j++)
272 {
274 }
275 for (int j=0;j<FileMemberHighlight::Total;j++)
276 {
278 }
279 for (int j=0;j<ModuleMemberHighlight::Total;j++)
280 {
282 }
283
284 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
285 p->annotatedClasses = countAnnotatedClasses(&p->annotatedClassesPrinted, ClassDef::Class); // "classes" + "annotated"
286 p->hierarchyClasses = countClassHierarchy(ClassDef::Class); // "hierarchy"
287 // "interfaces" + "annotated"
288 p->annotatedInterfaces = sliceOpt ? countAnnotatedClasses(&p->annotatedInterfacesPrinted, ClassDef::Interface) : 0;
289 // "interfacehierarchy"
290 p->hierarchyInterfaces = sliceOpt ? countClassHierarchy(ClassDef::Interface) : 0;
291 // "structs" + "annotated"
292 p->annotatedStructs = sliceOpt ? countAnnotatedClasses(&p->annotatedStructsPrinted, ClassDef::Struct) : 0;
293 // "exceptions" + "annotated"
294 p->annotatedExceptions = sliceOpt ? countAnnotatedClasses(&p->annotatedExceptionsPrinted, ClassDef::Exception) : 0;
295 // "exceptionhierarchy"
296 p->hierarchyExceptions = sliceOpt ? countClassHierarchy(ClassDef::Exception) : 0;
297 countFiles(p->documentedFiles,p->documentedFiles); // "files"
298 countRelatedPages(p->documentedPages,p->indexedPages); // "pages"
299 p->documentedGroups = countGroups(); // "topics"
300 p->documentedNamespaces = countNamespaces(); // "namespaces"
301 p->documentedConcepts = countConcepts(); // "concepts"
302 p->documentedDirs = countDirs(); // "dirs"
303 p->documentedModules = ModuleManager::instance().numDocumentedModules();
304 // "globals"
305 // "namespacemembers"
306 // "functions"
307}
308
309
310static void startIndexHierarchy(OutputList &ol,int level)
311{
315 if (level<6) ol.startIndexList();
317
322 ol.startItemList();
324}
325
326static void endIndexHierarchy(OutputList &ol,int level)
327{
331 if (level<6) ol.endIndexList();
333
338 ol.endItemList();
340}
341
342//----------------------------------------------------------------------------
343
345
346//----------------------------------------------------------------------------
347
348static void startQuickIndexList(OutputList &ol,bool letterTabs=false)
349{
350 if (letterTabs)
351 {
352 ol.writeString(" <div id=\"navrow4\" class=\"tabs3\">\n");
353 }
354 else
355 {
356 ol.writeString(" <div id=\"navrow3\" class=\"tabs2\">\n");
357 }
358 ol.writeString(" <ul class=\"tablist\">\n");
359}
360
362{
363 ol.writeString(" </ul>\n");
364 ol.writeString(" </div>\n");
365}
366
367static void startQuickIndexItem(OutputList &ol,const DString &l,
368 bool hl,bool /* compact */,bool &first)
369{
370 first=false;
371 ol.writeString(" <li");
372 if (hl) ol.writeString(" class=\"current\"");
373 ol.writeString("><a ");
374 ol.writeString("href=\"");
375 ol.writeString(l);
376 ol.writeString("\">");
377 ol.writeString("<span>");
378}
379
381{
382 ol.writeString("</span>");
383 ol.writeString("</a>");
384 ol.writeString("</li>\n");
385}
386
387void startTitle(OutputList &ol,const DString &fileName,const DefinitionMutable *def)
388{
389 bool generateOutlinePanel = Config_getBool(GENERATE_TREEVIEW) && Config_getBool(PAGE_OUTLINE_PANEL);
391 if (!generateOutlinePanel && def) def->writeSummaryLinks(ol);
392 ol.startTitleHead(fileName);
395}
396
397void endTitle(OutputList &ol,const DString &fileName,const DString &name)
398{
400 ol.endTitleHead(fileName,name);
401 ol.endHeaderSection();
402}
403
404void startFile(OutputList &ol,const DString &name,bool isSource,const DString &manName,
405 const DString &title,HighlightedItem hli,bool additionalIndices,
406 const DString &altSidebarName, int hierarchyLevel, const DString &allMembersFile)
407{
408 bool disableIndex = Config_getBool(DISABLE_INDEX);
409 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
410 bool fullSidebar = Config_getBool(FULL_SIDEBAR);
411 bool quickLinksAfterSplitbar = !disableIndex && generateTreeView && fullSidebar;
412 ol.startFile(name,isSource,manName,title,hierarchyLevel);
414 if (!disableIndex && !quickLinksAfterSplitbar)
415 {
416 ol.writeQuickLinks(hli,name);
417 }
418 if (!additionalIndices)
419 {
420 ol.endQuickIndices();
421 }
422 ol.writeSplitBar(!altSidebarName.empty() ? altSidebarName : name, allMembersFile);
423 if (quickLinksAfterSplitbar)
424 {
425 ol.writeQuickLinks(hli,name);
426 }
427 ol.writeSearchInfo();
428}
429
430void endFile(OutputList &ol,bool skipNavIndex,bool skipEndContents,
431 const DString &navPath)
432{
433 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
436 if (!skipNavIndex)
437 {
438 if (!skipEndContents) ol.endContents();
439 if (generateTreeView)
440 {
441 ol.writeString("</div><!-- doc-content -->\n");
442 ol.writeString("</div><!-- container -->\n");
443 }
444 }
445
446 ol.writeFooter(navPath); // write the footer
448 ol.endFile();
449}
450
451void endFileWithNavPath(OutputList &ol,const DefinitionMutable *d,bool showPageNavigation)
452{
453 bool generateTreeview = Config_getBool(GENERATE_TREEVIEW);
454 bool generateOutlinePanel = Config_getBool(PAGE_OUTLINE_PANEL);
455 DString navPath;
456 if (generateTreeview)
457 {
460 ol.writeString("</div><!-- doc-content -->\n");
461 if (generateOutlinePanel && showPageNavigation) d->writePageNavigation(ol);
462 ol.writeString("</div><!-- container -->\n");
464 navPath = toDefinition(const_cast<DefinitionMutable*>(d))->navigationPathAsString();
465 }
466 endFile(ol,generateTreeview,true,navPath);
467}
468
469//----------------------------------------------------------------------
470
471static void writeMemberToIndex(const Definition *def,const MemberDef *md,bool addToIndex)
472{
473 bool isAnonymous = md->isAnonymous();
474 const MemberVector &enumList = md->enumFieldList();
475 bool isDir = md->isEnumerate() && std::any_of(enumList.begin(),enumList.end(),[](const auto &emd) { return emd->hasDocumentation(); });
476 auto defType = def->definitionType();
477 bool namespaceMemberInFileDocs = md->getNamespaceDef() && defType==Definition::TypeFile;
478 bool lAddToIndex = addToIndex && !namespaceMemberInFileDocs;
479 DString name = namespaceMemberInFileDocs || defType==Definition::TypeModule ?
480 md->qualifiedName() : md->name();
481 if (md->getOuterScope()==def ||
482 (md->getNamespaceDef()!=nullptr && defType==Definition::TypeFile) ||
484 {
486 name,md->getReference(),md->getOutputFileBase(),md->anchor(),false,lAddToIndex && md->getGroupDef()==nullptr);
487 }
488 else // inherited member
489 {
491 name,def->getReference(),def->getOutputFileBase(),md->anchor(),false,lAddToIndex && md->getGroupDef()==nullptr);
492 }
493 if (isDir)
494 {
495 if (!isAnonymous)
496 {
498 }
499 for (const auto &emd : enumList)
500 {
501 if (emd->hasDocumentation())
502 {
503 namespaceMemberInFileDocs = emd->getNamespaceDef() && defType==Definition::TypeFile;
504 lAddToIndex = addToIndex && !namespaceMemberInFileDocs;
505 DString ename = namespaceMemberInFileDocs || defType==Definition::TypeModule ?
506 emd->qualifiedName() : emd->name();
507 if (emd->getOuterScope()==def ||
508 (emd->getNamespaceDef()!=nullptr && defType==Definition::TypeFile) ||
510 {
512 ename,emd->getReference(),emd->getOutputFileBase(),emd->anchor(),false,lAddToIndex && emd->getGroupDef()==nullptr);
513 }
514 else // inherited member
515 {
517 ename,def->getReference(),def->getOutputFileBase(),emd->anchor(),false,lAddToIndex && emd->getGroupDef()==nullptr);
518 }
519 }
520 }
521 if (!isAnonymous)
522 {
524 }
525 }
526}
527
528//----------------------------------------------------------------------
529template<class T>
531 const DString &name,const DString &anchor,
532 bool addToIndex=true,bool preventSeparateIndex=false,
533 const ConceptLinkedRefMap *concepts = nullptr)
534
535{
536 int numClasses=0;
537 for (const auto &cd : def->getClasses())
538 {
539 if (cd->isLinkable()) numClasses++;
540 }
541 int numConcepts=0;
542 if (concepts)
543 {
544 for (const auto &cd : *concepts)
545 {
546 if (cd->isLinkable()) numConcepts++;
547 }
548 }
549 bool hasMembers = !def->getMemberLists().empty() || !def->getMemberGroups().empty() || (numClasses>0) || (numConcepts>0);
550 Doxygen::indexList->addContentsItem(hasMembers,name,
551 def->getReference(),def->getOutputFileBase(),anchor,
552 hasMembers && !preventSeparateIndex,
553 addToIndex,
554 def,
555 convertToHtml(name));
556 //printf("addMembersToIndex(def=%s hasMembers=%d numClasses=%d)\n",qPrint(def->name()),hasMembers,numClasses);
557 if (hasMembers || numClasses>0 || numConcepts>0)
558 {
560 for (const auto &lde : LayoutDocManager::instance().docEntries(part))
561 {
562 auto kind = lde->kind();
563 if (kind==LayoutDocEntry::MemberDef)
564 {
565 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
566 if (lmd)
567 {
568 MemberList *ml = def->getMemberList(lmd->type);
569 if (ml)
570 {
571 for (const auto &md : *ml)
572 {
573 if (md->visibleInIndex())
574 {
575 writeMemberToIndex(def,md,addToIndex);
576 }
577 }
578 }
579 }
580 }
581 else if (kind==LayoutDocEntry::NamespaceClasses ||
582 kind==LayoutDocEntry::FileClasses ||
583 kind==LayoutDocEntry::ClassNestedClasses ||
584 kind==LayoutDocEntry::ModuleClasses
585 )
586 {
587 for (const auto &cd : def->getClasses())
588 {
589 if (cd->isLinkable() && (cd->partOfGroups().empty() || def->definitionType()==Definition::TypeGroup))
590 {
591 bool inlineSimpleStructs = Config_getBool(INLINE_SIMPLE_STRUCTS);
592 bool isNestedClass = def->definitionType()==Definition::TypeClass;
593 addMembersToIndex(cd,LayoutDocManager::Class,cd->displayName(lde->kind()==LayoutDocEntry::FileClasses),cd->anchor(),
594 addToIndex && (isNestedClass || (cd->isSimple() && inlineSimpleStructs)),
595 preventSeparateIndex || cd->isEmbeddedInOuterScope());
596 }
597 }
598 }
599 else if ((kind==LayoutDocEntry::FileConcepts || kind==LayoutDocEntry::ModuleConcepts) && concepts)
600 {
601 for (const auto &cd : *concepts)
602 {
603 if (cd->isLinkable() && (cd->partOfGroups().empty() || def->definitionType()==Definition::TypeGroup))
604 {
605 Doxygen::indexList->addContentsItem(false,cd->displayName(),
606 cd->getReference(),cd->getOutputFileBase(),DString(),
607 addToIndex,
608 false,
609 cd);
610 }
611 }
612 }
613 }
614
616 }
617}
618
619
620//----------------------------------------------------------------------------
621/*! Generates HTML Help tree of classes */
622
623static void writeClassTreeToOutput(OutputList &ol,const BaseClassList &bcl,int level,FTVHelp* ftv,bool addToIndex,ClassDefSet &visitedClasses)
624{
625 if (bcl.empty()) return;
626 bool started=false;
627 for (const auto &bcd : bcl)
628 {
629 ClassDef *cd=bcd.classDef;
630 if (cd->getLanguage()==SrcLangExt::VHDL && VhdlDocGen::convert(cd->protection())!=VhdlDocGen::ENTITYCLASS)
631 {
632 continue;
633 }
634
635 bool b = cd->getLanguage()==SrcLangExt::VHDL ? classHasVisibleRoot(cd->subClasses()) : classHasVisibleRoot(cd->baseClasses());
636
637 if (cd->isVisibleInHierarchy() && b) // classHasVisibleRoot(cd->baseClasses()))
638 {
639 if (!started)
640 {
641 startIndexHierarchy(ol,level);
642 if (addToIndex)
643 {
645 }
646 if (ftv)
647 {
648 ftv->incContentsDepth();
649 }
650 started=true;
651 }
653 //printf("Passed...\n");
654 bool hasChildren = visitedClasses.find(cd)==visitedClasses.end() &&
656 DString escapedName = convertToHtml(cd->displayName()); // avoid objective-C '<Protocol>' to be interpreted as XML/HTML tag
657 //printf("tree4: Has children %s: %d\n",qPrint(cd->name()),hasChildren);
658 if (cd->isLinkable())
659 {
660 //printf("Writing class %s\n",qPrint(cd->displayName()));
663 cd->getDefLine(),
664 cd,
665 nullptr,
666 escapedName,
667 DocOptions()
668 .setSingleLine(true)
669 .setAutolinkSupport(false));
671 if (cd->isReference())
672 {
673 ol.startTypewriter();
674 ol.docify(" [external]");
675 ol.endTypewriter();
676 }
677 if (addToIndex)
678 {
680 }
681 if (ftv)
682 {
683 if (cd->getLanguage()==SrcLangExt::VHDL)
684 {
685 ftv->addContentsItem(hasChildren,bcd.usedName,cd->getReference(),cd->getOutputFileBase(),cd->anchor(),false,false,cd);
686 }
687 else
688 {
689 ftv->addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor(),false,false,cd,escapedName);
690 }
691 }
692 }
693 else
694 {
696 ol.parseText(cd->name());
698 if (addToIndex)
699 {
701 }
702 if (ftv)
703 {
704 ftv->addContentsItem(hasChildren,cd->displayName(),DString(),DString(),DString(),false,false,cd,escapedName);
705 }
706 }
707 if (hasChildren)
708 {
709 //printf("Class %s at %p visited=%d\n",qPrint(cd->name()),cd,cd->visited);
710 visitedClasses.insert(cd);
711 if (cd->getLanguage()==SrcLangExt::VHDL)
712 {
713 writeClassTreeToOutput(ol,cd->baseClasses(),level+1,ftv,addToIndex,visitedClasses);
714 }
715 else
716 {
717 writeClassTreeToOutput(ol,cd->subClasses(),level+1,ftv,addToIndex,visitedClasses);
718 }
719 }
720 ol.endIndexListItem();
721 }
722 }
723 if (started)
724 {
725 endIndexHierarchy(ol,level);
726 if (addToIndex)
727 {
729 }
730 if (ftv)
731 {
732 ftv->decContentsDepth();
733 }
734 }
735}
736
737//----------------------------------------------------------------------------
738
739static bool dirHasVisibleChildren(const DirDef *dd)
740{
741 if (dd->hasDocumentation()) return true;
742
743 for (const auto &fd : dd->getFiles())
744 {
745 bool genSourceFile = false;
746 if (fd->visibleInIndex(genSourceFile))
747 {
748 return true;
749 }
750 if (genSourceFile)
751 {
752 return true;
753 }
754 }
755
756 for(const auto &subdd : dd->subDirs())
757 {
758 if (dirHasVisibleChildren(subdd))
759 {
760 return true;
761 }
762 }
763 return false;
764}
765
766//----------------------------------------------------------------------------
767static void writeDirTreeNode(OutputList &ol, const DirDef *dd, int level, FTVHelp* ftv,bool addToIndex)
768{
769 if (level>20)
770 {
771 warn(dd->getDefFileName(),dd->getDefLine(),
772 "maximum nesting level exceeded for directory {}: "
773 "check for possible recursive directory relation!",dd->name());
774 return;
775 }
776
777 if (!dirHasVisibleChildren(dd))
778 {
779 return;
780 }
781
782 bool tocExpand = true; //Config_getBool(TOC_EXPAND);
783 bool isDir = !dd->subDirs().empty() || // there are subdirs
784 (tocExpand && // or toc expand and
785 !dd->getFiles().empty() // there are files
786 );
787 //printf("gd='%s': pageDict=%d\n",qPrint(gd->name()),gd->pageDict->count());
788 if (addToIndex)
789 {
792 }
793 if (ftv)
794 {
795 ftv->addContentsItem(isDir,dd->shortName(),dd->getReference(),
796 dd->getOutputFileBase(),DString(),false,true,dd);
797 ftv->incContentsDepth();
798 }
799
803 dd->getDefLine(),
804 dd,
805 nullptr,
806 dd->shortName(),
807 DocOptions()
808 .setSingleLine(true)
809 .setAutolinkSupport(false));
811 if (dd->isReference())
812 {
813 ol.startTypewriter();
814 ol.docify(" [external]");
815 ol.endTypewriter();
816 }
817
818 // write sub directories
819 if (dd->subDirs().size()>0)
820 {
821 startIndexHierarchy(ol,level+1);
822 for(const auto &subdd : dd->subDirs())
823 {
824 writeDirTreeNode(ol,subdd,level+1,ftv,addToIndex);
825 }
826 endIndexHierarchy(ol,level+1);
827 }
828
829 int fileCount=0;
830 if (!dd->getFiles().empty())
831 {
832 for (const auto &fd : dd->getFiles())
833 {
834 //bool allExternals = Config_getBool(ALLEXTERNALS);
835 //if ((allExternals && fd->isLinkable()) || fd->isLinkableInProject())
836 //{
837 // fileCount++;
838 //}
839 bool genSourceFile = false;
840 if (fd->visibleInIndex(genSourceFile))
841 {
842 fileCount++;
843 }
844 else if (genSourceFile)
845 {
846 fileCount++;
847 }
848 }
849 if (fileCount>0)
850 {
851 startIndexHierarchy(ol,level+1);
852 for (const auto &fd : dd->getFiles())
853 {
854 bool src = false;
855 bool doc = fd->visibleInIndex(src);
856 DString reference;
857 DString outputBase;
858 if (doc)
859 {
860 reference = fd->getReference();
861 outputBase = fd->getOutputFileBase();
862 }
863 if (doc || src)
864 {
866 ol.startIndexItem(reference,outputBase);
867 ol.generateDoc(fd->getDefFileName(),
868 fd->getDefLine(),
869 fd,
870 nullptr,
871 fd->displayName(),
872 DocOptions()
873 .setSingleLine(true)
874 .setAutolinkSupport(false));
875 ol.endIndexItem(reference,outputBase);
876 ol.endIndexListItem();
877 if (ftv && (src || doc))
878 {
879 ftv->addContentsItem(false,
880 fd->displayName(),
881 reference,outputBase,
882 DString(),false,false,fd);
883 }
884 }
885 }
886 endIndexHierarchy(ol,level+1);
887 }
888 }
889
890 if (tocExpand && addToIndex)
891 {
892 // write files of this directory
893 if (fileCount>0)
894 {
895 for (const auto &fd : dd->getFiles())
896 {
897 bool src = false;
898 bool doc = fd->visibleInIndex(src);
899 if (doc)
900 {
901 addMembersToIndex(fd,LayoutDocManager::File,fd->displayName(),DString(),
902 !fd->isLinkableViaGroup(),false,&fd->getConcepts());
903 }
904 else if (src)
905 {
907 false, fd->name(), DString(),
908 fd->getSourceFileBase(), DString(), false, true, fd);
909 }
910 }
911 }
912 }
913 ol.endIndexListItem();
914
915 if (addToIndex)
916 {
918 }
919 if (ftv)
920 {
921 ftv->decContentsDepth();
922 }
923}
924
925static void writeDirHierarchy(OutputList &ol, FTVHelp* ftv,bool addToIndex)
926{
927 if (ftv)
928 {
931 }
933 for (const auto &dd : *Doxygen::dirLinkedMap)
934 {
935 if (dd->getOuterScope()==Doxygen::globalScope)
936 {
937 writeDirTreeNode(ol,dd.get(),0,ftv,addToIndex);
938 }
939 }
940 if (ftv)
941 {
942 for (const auto &fn : *Doxygen::inputNameLinkedMap)
943 {
944 for (const auto &fd : *fn)
945 {
946 if (fd->getDirDef()==nullptr) // top level file
947 {
948 bool src = false;
949 bool doc = fd->visibleInIndex(src);
950 DString reference, outputBase;
951 if (doc)
952 {
953 reference = fd->getReference();
954 outputBase = fd->getOutputFileBase();
955 }
956 if (doc || src)
957 {
958 ftv->addContentsItem(false,fd->displayName(),
959 reference, outputBase, DString(),
960 false,false,fd.get());
961 }
962 if (addToIndex)
963 {
964 if (doc)
965 {
966 addMembersToIndex(fd.get(),LayoutDocManager::File,fd->displayName(),DString(),true,false,&fd->getConcepts());
967 }
968 else if (src)
969 {
971 false, fd->displayName(), DString(),
972 fd->getSourceFileBase(), DString(), false, true, fd.get());
973 }
974 }
975 }
976 }
977 }
978 }
979 endIndexHierarchy(ol,0);
980 if (ftv)
981 {
983 }
984}
985
986
987//----------------------------------------------------------------------------
988
989static void writeClassTreeForList(OutputList &ol,const ClassLinkedMap &cl,bool &started,FTVHelp* ftv,bool addToIndex,
990 ClassDef::CompoundType ct,ClassDefSet &visitedClasses)
991{
992 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
993 for (const auto &cd : cl)
994 {
995 bool b = false;
996 if (cd->getLanguage()==SrcLangExt::VHDL)
997 {
998 if (VhdlDocGen::convert(cd->protection())!=VhdlDocGen::ENTITYCLASS)
999 {
1000 continue;
1001 }
1002 b=!classHasVisibleRoot(cd->subClasses());
1003 }
1004 else if (sliceOpt && cd->compoundType() != ct)
1005 {
1006 continue;
1007 }
1008 else
1009 {
1010 b=!classHasVisibleRoot(cd->baseClasses());
1011 }
1012
1013 if (b) //filter on root classes
1014 {
1015 if (cd->isVisibleInHierarchy()) // should it be visible
1016 {
1017 if (!started)
1018 {
1019 startIndexHierarchy(ol,0);
1020 if (addToIndex)
1021 {
1023 }
1024 started=true;
1025 }
1026 ol.startIndexListItem();
1027 bool hasChildren = visitedClasses.find(cd.get())==visitedClasses.end() &&
1028 classHasVisibleChildren(cd.get());
1029 //printf("list: Has children %s: %d\n",qPrint(cd->name()),hasChildren);
1030 DString escapedName = convertToHtml(cd->displayName()); // avoid objective-C '<Protocol>' to be interpreted as XML/HTML tag
1031 if (cd->isLinkable())
1032 {
1033 //printf("Writing class %s isLinkable()=%d isLinkableInProject()=%d cd->isImplicitTemplateinstance()=%d\n",
1034 // qPrint(cd->displayName()),cd->isLinkable(),cd->isLinkableInProject(),cd->isImplicitTemplateInstance());
1035 ol.startIndexItem(cd->getReference(),cd->getOutputFileBase());
1036 ol.generateDoc(cd->getDefFileName(),
1037 cd->getDefLine(),
1038 cd.get(),
1039 nullptr,
1040 escapedName,
1041 DocOptions()
1042 .setSingleLine(true)
1043 .setAutolinkSupport(false));
1044 ol.endIndexItem(cd->getReference(),cd->getOutputFileBase());
1045 if (cd->isReference())
1046 {
1047 ol.startTypewriter();
1048 ol.docify(" [external]");
1049 ol.endTypewriter();
1050 }
1051 if (addToIndex)
1052 {
1053 if (cd->getLanguage()!=SrcLangExt::VHDL) // prevents double insertion in Design Unit List
1054 {
1055 Doxygen::indexList->addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor(),false,false,cd.get(),escapedName);
1056 }
1057 }
1058 if (ftv)
1059 {
1060 ftv->addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor(),false,false,cd.get(),escapedName);
1061 }
1062 }
1063 else
1064 {
1066 ol.parseText(cd->displayName());
1068 if (addToIndex)
1069 {
1070 Doxygen::indexList->addContentsItem(hasChildren,cd->displayName(),DString(),DString(),DString(),false,false,cd.get(),escapedName);
1071 }
1072 if (ftv)
1073 {
1074 ftv->addContentsItem(hasChildren,cd->displayName(),DString(),DString(),DString(),false,false,cd.get(),escapedName);
1075 }
1076 }
1077 if (cd->getLanguage()==SrcLangExt::VHDL && hasChildren)
1078 {
1079 writeClassTreeToOutput(ol,cd->baseClasses(),1,ftv,addToIndex,visitedClasses);
1080 visitedClasses.insert(cd.get());
1081 }
1082 else if (hasChildren)
1083 {
1084 writeClassTreeToOutput(ol,cd->subClasses(),1,ftv,addToIndex,visitedClasses);
1085 visitedClasses.insert(cd.get());
1086 }
1087 ol.endIndexListItem();
1088 }
1089 }
1090 }
1091}
1092
1093static void writeClassHierarchy(OutputList &ol, FTVHelp* ftv,bool addToIndex,ClassDef::CompoundType ct)
1094{
1095 ClassDefSet visitedClasses;
1096 if (ftv)
1097 {
1098 ol.pushGeneratorState();
1100 }
1101 bool started=false;
1102 writeClassTreeForList(ol,*Doxygen::classLinkedMap,started,ftv,addToIndex,ct,visitedClasses);
1103 writeClassTreeForList(ol,*Doxygen::hiddenClassLinkedMap,started,ftv,addToIndex,ct,visitedClasses);
1104 if (started)
1105 {
1106 endIndexHierarchy(ol,0);
1107 if (addToIndex)
1108 {
1110 }
1111 }
1112 if (ftv)
1113 {
1114 ol.popGeneratorState();
1115 }
1116}
1117
1118//----------------------------------------------------------------------------
1119
1121{
1122 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
1123 int count=0;
1124 for (const auto &cd : cl)
1125 {
1126 if (sliceOpt && cd->compoundType() != ct)
1127 {
1128 continue;
1129 }
1130 if (!classHasVisibleRoot(cd->baseClasses())) // filter on root classes
1131 {
1132 if (cd->isVisibleInHierarchy()) // should it be visible
1133 {
1134 if (!cd->subClasses().empty()) // should have sub classes
1135 {
1136 count++;
1137 }
1138 }
1139 }
1140 }
1141 return count;
1142}
1143
1145{
1146 int count=0;
1149 return count;
1150}
1151
1152//----------------------------------------------------------------------------
1153
1155{
1156 if (Index::instance().numHierarchyClasses()==0) return;
1157 ol.pushGeneratorState();
1158 //1.{
1161
1162 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassHierarchy);
1163 DString title = lne ? lne->title() : theTranslator->trClassHierarchy();
1164 bool addToIndex = lne==nullptr || lne->visible();
1165
1166 startFile(ol,"hierarchy",false,DString(), title, HighlightedItem::ClassHierarchy);
1167 startTitle(ol,DString());
1168 ol.parseText(title);
1169 endTitle(ol,DString(),DString());
1170 ol.startContents();
1171 ol.startTextBlock();
1172
1173 if (Config_getBool(HAVE_DOT) && Config_getBool(GRAPHICAL_HIERARCHY))
1174 {
1175 ol.pushGeneratorState();
1179 ol.startParagraph();
1180 ol.startTextLink("inherits",DString());
1182 ol.endTextLink();
1183 ol.endParagraph();
1184 ol.popGeneratorState();
1185 }
1187 ol.endTextBlock();
1188
1189 // ---------------
1190 // Static class hierarchy for Latex/RTF
1191 // ---------------
1192 ol.pushGeneratorState();
1193 //2.{
1196
1197 writeClassHierarchy(ol,nullptr,addToIndex,ClassDef::Class);
1198
1200 ol.popGeneratorState();
1201 //2.}
1202
1203 // ---------------
1204 // Dynamic class hierarchical index for HTML
1205 // ---------------
1206 ol.pushGeneratorState();
1207 //2.{
1209
1210 {
1211 if (addToIndex)
1212 {
1213 Doxygen::indexList->addContentsItem(true,title,DString(),"hierarchy",DString(),true,true);
1214 }
1215 FTVHelp ftv(false);
1216 writeClassHierarchy(ol,&ftv,addToIndex,ClassDef::Class);
1217 TextStream t;
1219 ol.pushGeneratorState();
1221 ol.writeString(t.str());
1222 ol.popGeneratorState();
1223 }
1224 ol.popGeneratorState();
1225 //2.}
1226 // ------
1227
1228 endFile(ol);
1229 ol.popGeneratorState();
1230 //1.}
1231}
1232
1233//----------------------------------------------------------------------------
1234
1236{
1237 if (Index::instance().numHierarchyClasses()==0) return;
1239 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassHierarchy);
1240 DString title = lne ? lne->title() : theTranslator->trClassHierarchy();
1241 startFile(ol,"inherits",false,DString(),title,HighlightedItem::ClassHierarchy,false,"hierarchy");
1242 startTitle(ol,DString());
1243 ol.parseText(title);
1244 endTitle(ol,DString(),DString());
1245 ol.startContents();
1246 ol.startTextBlock();
1247 ol.startParagraph();
1248 ol.startTextLink("hierarchy",DString());
1250 ol.endTextLink();
1251 ol.endParagraph();
1252 ol.endTextBlock();
1255 endFile(ol);
1256 ol.enableAll();
1257}
1258
1259//----------------------------------------------------------------------------
1260
1262{
1263 if (Index::instance().numHierarchyInterfaces()==0) return;
1264 ol.pushGeneratorState();
1265 //1.{
1267
1268 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::InterfaceHierarchy);
1269 DString title = lne ? lne->title() : theTranslator->trInterfaceHierarchy();
1270 bool addToIndex = lne==nullptr || lne->visible();
1271
1272 startFile(ol,"interfacehierarchy",false,DString(), title, HighlightedItem::InterfaceHierarchy);
1273 startTitle(ol,DString());
1274 ol.parseText(title);
1275 endTitle(ol,DString(),DString());
1276 ol.startContents();
1277 ol.startTextBlock();
1278
1279 if (Config_getBool(HAVE_DOT) && Config_getBool(GRAPHICAL_HIERARCHY))
1280 {
1283 ol.startParagraph();
1284 ol.startTextLink("interfaceinherits",DString());
1286 ol.endTextLink();
1287 ol.endParagraph();
1290 }
1292 ol.endTextBlock();
1293
1294 // ---------------
1295 // Static interface hierarchy for Latex/RTF
1296 // ---------------
1297 ol.pushGeneratorState();
1298 //2.{
1301
1302 writeClassHierarchy(ol,nullptr,addToIndex,ClassDef::Interface);
1303
1305 ol.popGeneratorState();
1306 //2.}
1307
1308 // ---------------
1309 // Dynamic interface hierarchical index for HTML
1310 // ---------------
1311 ol.pushGeneratorState();
1312 //2.{
1314
1315 {
1316 if (addToIndex)
1317 {
1318 Doxygen::indexList->addContentsItem(true,title,DString(),"interfacehierarchy",DString(),true,true);
1319 }
1320 FTVHelp ftv(false);
1321 writeClassHierarchy(ol,&ftv,addToIndex,ClassDef::Interface);
1322 TextStream t;
1324 ol.pushGeneratorState();
1326 ol.writeString(t.str());
1327 ol.popGeneratorState();
1328 }
1329 ol.popGeneratorState();
1330 //2.}
1331 // ------
1332
1333 endFile(ol);
1334 ol.popGeneratorState();
1335 //1.}
1336}
1337
1338//----------------------------------------------------------------------------
1339
1341{
1342 if (Index::instance().numHierarchyInterfaces()==0) return;
1344 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::InterfaceHierarchy);
1345 DString title = lne ? lne->title() : theTranslator->trInterfaceHierarchy();
1346 startFile(ol,"interfaceinherits",false,DString(),title,HighlightedItem::InterfaceHierarchy,false,"interfacehierarchy");
1347 startTitle(ol,DString());
1348 ol.parseText(title);
1349 endTitle(ol,DString(),DString());
1350 ol.startContents();
1351 ol.startTextBlock();
1352 ol.startParagraph();
1353 ol.startTextLink("interfacehierarchy",DString());
1355 ol.endTextLink();
1356 ol.endParagraph();
1357 ol.endTextBlock();
1360 endFile(ol);
1361 ol.enableAll();
1362}
1363
1364//----------------------------------------------------------------------------
1365
1367{
1368 if (Index::instance().numHierarchyExceptions()==0) return;
1369 ol.pushGeneratorState();
1370 //1.{
1372
1373 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ExceptionHierarchy);
1374 DString title = lne ? lne->title() : theTranslator->trExceptionHierarchy();
1375 bool addToIndex = lne==nullptr || lne->visible();
1376
1377 startFile(ol,"exceptionhierarchy",false,DString(), title, HighlightedItem::ExceptionHierarchy);
1378 startTitle(ol,DString());
1379 ol.parseText(title);
1380 endTitle(ol,DString(),DString());
1381 ol.startContents();
1382 ol.startTextBlock();
1383
1384 if (Config_getBool(HAVE_DOT) && Config_getBool(GRAPHICAL_HIERARCHY))
1385 {
1388 ol.startParagraph();
1389 ol.startTextLink("exceptioninherits",DString());
1391 ol.endTextLink();
1392 ol.endParagraph();
1395 }
1397 ol.endTextBlock();
1398
1399 // ---------------
1400 // Static exception hierarchy for Latex/RTF
1401 // ---------------
1402 ol.pushGeneratorState();
1403 //2.{
1406
1407 writeClassHierarchy(ol,nullptr,addToIndex,ClassDef::Exception);
1408
1410 ol.popGeneratorState();
1411 //2.}
1412
1413 // ---------------
1414 // Dynamic exception hierarchical index for HTML
1415 // ---------------
1416 ol.pushGeneratorState();
1417 //2.{
1419
1420 {
1421 if (addToIndex)
1422 {
1423 Doxygen::indexList->addContentsItem(true,title,DString(),"exceptionhierarchy",DString(),true,true);
1424 }
1425 FTVHelp ftv(false);
1426 writeClassHierarchy(ol,&ftv,addToIndex,ClassDef::Exception);
1427 TextStream t;
1429 ol.pushGeneratorState();
1431 ol.writeString(t.str());
1432 ol.popGeneratorState();
1433 }
1434 ol.popGeneratorState();
1435 //2.}
1436 // ------
1437
1438 endFile(ol);
1439 ol.popGeneratorState();
1440 //1.}
1441}
1442
1443//----------------------------------------------------------------------------
1444
1446{
1447 if (Index::instance().numHierarchyExceptions()==0) return;
1449 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ExceptionHierarchy);
1450 DString title = lne ? lne->title() : theTranslator->trExceptionHierarchy();
1451 startFile(ol,"exceptioninherits",false,DString(),title,HighlightedItem::ExceptionHierarchy,false,"exceptionhierarchy");
1452 startTitle(ol,DString());
1453 ol.parseText(title);
1454 endTitle(ol,DString(),DString());
1455 ol.startContents();
1456 ol.startTextBlock();
1457 ol.startParagraph();
1458 ol.startTextLink("exceptionhierarchy",DString());
1460 ol.endTextLink();
1461 ol.endParagraph();
1462 ol.endTextBlock();
1465 endFile(ol);
1466 ol.enableAll();
1467}
1468
1469//----------------------------------------------------------------------------
1470
1471static void countFiles(int &allFiles,int &docFiles)
1472{
1473 allFiles=0;
1474 docFiles=0;
1475 for (const auto &fn : *Doxygen::inputNameLinkedMap)
1476 {
1477 for (const auto &fd: *fn)
1478 {
1479 bool src = false;
1480 bool doc = fd->visibleInIndex(src);
1481 if (doc || src)
1482 {
1483 allFiles++;
1484 }
1485 if (doc)
1486 {
1487 docFiles++;
1488 }
1489 }
1490 }
1491}
1492
1493static void writeSingleFileIndex(OutputList &ol,const FileDef *fd)
1494{
1495 //printf("Found filedef %s\n",qPrint(fd->name()));
1496 bool doc = fd->isLinkableInProject();
1497 bool src = fd->generateSourceFile();
1498 bool nameOk = !fd->isDocumentationFile();
1499 if (nameOk && (doc || src) && !fd->isReference())
1500 {
1501 DString path;
1502 if (Config_getBool(FULL_PATH_NAMES))
1503 {
1504 path=stripFromPath(fd->getPath());
1505 }
1506 DString fullName=fd->name();
1507 if (!path.empty())
1508 {
1509 if (path.at(path.length()-1)!='/') fullName.prepend("/");
1510 fullName.prepend(path);
1511 }
1512
1513 ol.startIndexKey();
1514 ol.docify(path);
1515 if (doc)
1516 {
1518 //if (addToIndex)
1519 //{
1520 // addMembersToIndex(fd,LayoutDocManager::File,fullName,DString());
1521 //}
1522 }
1523 else if (src)
1524 {
1526 }
1527 if (doc && src)
1528 {
1529 ol.pushGeneratorState();
1531 ol.docify(" ");
1532 ol.startTextLink(fd->includeName(),DString());
1533 ol.docify("[");
1535 ol.docify("]");
1536 ol.endTextLink();
1537 ol.popGeneratorState();
1538 }
1539 ol.endIndexKey();
1540 bool hasBrief = !fd->briefDescription().empty();
1541 ol.startIndexValue(hasBrief);
1542 if (hasBrief)
1543 {
1544 ol.generateDoc(fd->briefFile(),
1545 fd->briefLine(),
1546 fd,
1547 nullptr,
1548 fd->briefDescription(true),
1549 DocOptions()
1550 .setSingleLine(true)
1551 .setLinkFromIndex(true));
1552 }
1553 if (doc)
1554 {
1555 ol.endIndexValue(fd->getOutputFileBase(),hasBrief);
1556 }
1557 else // src
1558 {
1559 ol.endIndexValue(fd->getSourceFileBase(),hasBrief);
1560 }
1561 //ol.popGeneratorState();
1562 // --------------------------------------------------------
1563 }
1564}
1565//----------------------------------------------------------------------------
1566
1568{
1569 if (Index::instance().numDocumentedDirs()==0) return;
1570 ol.pushGeneratorState();
1572
1574 startFile(ol,"dirs",false,DString(),title,HighlightedItem::Files);
1575 startTitle(ol,title);
1576 ol.parseText(title);
1577 endTitle(ol,DString(),DString());
1578
1579 ol.startIndexList();
1580 for (const auto &dir : *Doxygen::dirLinkedMap)
1581 {
1582 if (dir->hasDocumentation())
1583 {
1584 writeDirTreeNode(ol, dir.get(), 1, nullptr, false);
1585 }
1586 }
1587
1588 ol.endIndexList();
1589
1590 endFile(ol);
1591 ol.popGeneratorState();
1592}
1593
1594//----------------------------------------------------------------------------
1595
1597{
1598 if (Index::instance().numDocumentedFiles()==0 || !Config_getBool(SHOW_FILES)) return;
1599
1600 ol.pushGeneratorState();
1603
1604 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::FileList);
1605 if (lne==nullptr) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Files); // fall back
1606 DString title = lne ? lne->title() : theTranslator->trFileList();
1607 bool addToIndex = lne==nullptr || lne->visible();
1608
1609 startFile(ol,"files",false,DString(),title,HighlightedItem::Files);
1610 startTitle(ol,DString());
1611 //if (!Config_getString(PROJECT_NAME).empty())
1612 //{
1613 // title.prepend(Config_getString(PROJECT_NAME)+" ");
1614 //}
1615 ol.parseText(title);
1616 endTitle(ol,DString(),DString());
1617 ol.startContents();
1618 ol.startTextBlock();
1619
1620 if (addToIndex)
1621 {
1622 Doxygen::indexList->addContentsItem(true,title,DString(),"files",DString(),true,true);
1624 }
1625
1626 ol.parseText(lne ? lne->intro() : theTranslator->trFileListDescription(Config_getBool(EXTRACT_ALL)));
1627 ol.endTextBlock();
1628
1629 // ---------------
1630 // Flat file index
1631 // ---------------
1632
1633 // 1. {
1634 ol.pushGeneratorState();
1636
1637 ol.startIndexList();
1638 if (Config_getBool(FULL_PATH_NAMES))
1639 {
1640 std::unordered_map<std::string,size_t> pathMap;
1641 std::vector<FilesInDir> outputFiles;
1642
1643 // re-sort input files in (dir,file) output order instead of (file,dir) input order
1644 for (const auto &fn : *Doxygen::inputNameLinkedMap)
1645 {
1646 for (const auto &fd : *fn)
1647 {
1648 DString path=fd->getPath();
1649 if (path.empty()) path="[external]";
1650 auto it = pathMap.find(path.str());
1651 if (it!=pathMap.end()) // existing path -> append
1652 {
1653 outputFiles.at(it->second).files.push_back(fd.get());
1654 }
1655 else // new path -> create path entry + append
1656 {
1657 pathMap.emplace(path.str(),outputFiles.size());
1658 outputFiles.emplace_back(path);
1659 outputFiles.back().files.push_back(fd.get());
1660 }
1661 }
1662 }
1663
1664 // sort the files by path
1665 std::stable_sort(outputFiles.begin(),
1666 outputFiles.end(),
1667 [](const auto &fp1,const auto &fp2) { return dstricmp_sort(fp1.path,fp2.path)<0; });
1668 // sort the files inside the directory by name
1669 for (auto &fp : outputFiles)
1670 {
1671 std::stable_sort(fp.files.begin(), fp.files.end(), compareFileDefs);
1672 }
1673 // write the results
1674 for (const auto &fp : outputFiles)
1675 {
1676 for (const auto &fd : fp.files)
1677 {
1678 writeSingleFileIndex(ol,fd);
1679 }
1680 }
1681 }
1682 else
1683 {
1684 for (const auto &fn : *Doxygen::inputNameLinkedMap)
1685 {
1686 for (const auto &fd : *fn)
1687 {
1688 writeSingleFileIndex(ol,fd.get());
1689 }
1690 }
1691 }
1692 ol.endIndexList();
1693
1694 // 1. }
1695 ol.popGeneratorState();
1696
1697 // ---------------
1698 // Hierarchical file index for HTML
1699 // ---------------
1700 ol.pushGeneratorState();
1702
1703 {
1704 FTVHelp ftv(false);
1705 writeDirHierarchy(ol,&ftv,addToIndex);
1706 TextStream t;
1708 ol.writeString(t.str());
1709 }
1710
1711 ol.popGeneratorState();
1712 // ------
1713
1714 if (addToIndex)
1715 {
1717 }
1718
1719 endFile(ol);
1720 ol.popGeneratorState();
1721}
1722
1723//----------------------------------------------------------------------------
1725{
1726 int count=0;
1727 for (const auto &nd : *Doxygen::namespaceLinkedMap)
1728 {
1729 if (nd->isLinkableInProject()) count++;
1730 }
1731 return count;
1732}
1733
1734//----------------------------------------------------------------------------
1735static int countConcepts()
1736{
1737 int count=0;
1738 for (const auto &cd : *Doxygen::conceptLinkedMap)
1739 {
1740 if (cd->isLinkableInProject()) count++;
1741 }
1742 return count;
1743}
1744
1745
1746//----------------------------------------------------------------------------
1747template<typename Ptr> const ClassDef *get_pointer(const Ptr &p);
1748template<> const ClassDef *get_pointer(const ClassLinkedMap::Ptr &p) { return p.get(); }
1749template<> const ClassDef *get_pointer(const ClassLinkedRefMap::Ptr &p) { return p; }
1750
1751template<class ListType>
1752static void writeClassTree(const ListType &cl,FTVHelp *ftv,bool addToIndex,bool globalOnly,ClassDef::CompoundType ct)
1753{
1754 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
1755 for (const auto &cdi : cl)
1756 {
1757 const ClassDef *cd = get_pointer(cdi);
1758 if (cd->getLanguage()==SrcLangExt::VHDL)
1759 {
1762 )// no architecture
1763 {
1764 continue;
1765 }
1766 }
1767
1768 if (sliceOpt && cd->compoundType() != ct)
1769 {
1770 continue;
1771 }
1772
1773 if (!globalOnly ||
1774 cd->getOuterScope()==nullptr ||
1776 )
1777 {
1778 int count=0;
1779 for (const auto &ccd : cd->getClasses())
1780 {
1781 if (ccd->isLinkableInProject() && !ccd->isImplicitTemplateInstance())
1782 {
1783 count++;
1784 }
1785 }
1787 {
1788 DString displayName = cd->displayName(false);
1789 if (ftv)
1790 {
1791 ftv->addContentsItem(count>0,displayName,cd->getReference(),
1792 cd->getOutputFileBase(),cd->anchor(),false,true,cd,convertToHtml(displayName));
1793 }
1794 if (addToIndex &&
1795 (cd->getOuterScope()==nullptr ||
1797 )
1798 )
1799 {
1800 addMembersToIndex(cd,LayoutDocManager::Class,
1801 displayName,
1802 cd->anchor(),
1803 cd->partOfGroups().empty() && !cd->isSimple());
1804 }
1805 if (count>0)
1806 {
1807 if (ftv) ftv->incContentsDepth();
1808 writeClassTree(cd->getClasses(),ftv,addToIndex,false,ct);
1809 if (ftv) ftv->decContentsDepth();
1810 }
1811 }
1812 }
1813 }
1814}
1815
1816static void writeNamespaceMembers(const NamespaceDef *nd,bool addToIndex)
1817{
1818 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
1819 {
1820 if (lde->kind()==LayoutDocEntry::MemberDef)
1821 {
1822 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
1823 if (lmd)
1824 {
1825 MemberList *ml = nd->getMemberList(lmd->type);
1826 if (ml)
1827 {
1828 for (const auto &md : *ml)
1829 {
1830 //printf(" member %s visible=%d\n",qPrint(md->name()),md->visibleInIndex());
1831 if (md->visibleInIndex())
1832 {
1833 writeMemberToIndex(nd,md,addToIndex);
1834 }
1835 }
1836 }
1837 }
1838 }
1839 }
1840}
1841
1842static void writeModuleMembers(const ModuleDef *mod,bool addToIndex)
1843{
1844 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Module))
1845 {
1846 if (lde->kind()==LayoutDocEntry::MemberDecl)
1847 {
1848 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
1849 if (lmd)
1850 {
1851 MemberList *ml = mod->getMemberList(lmd->type);
1852 if (ml)
1853 {
1854 for (const auto &md : *ml)
1855 {
1856 //printf(" member %s visible=%d\n",qPrint(md->name()),md->visibleInIndex());
1857 if (md->visibleInIndex())
1858 {
1859 writeMemberToIndex(mod,md,addToIndex);
1860 }
1861 }
1862 }
1863 }
1864 }
1865 }
1866}
1867
1868
1869static void writeConceptList(const ConceptLinkedRefMap &concepts, FTVHelp *ftv,bool addToIndex);
1870static void writeNamespaceTree(const NamespaceLinkedRefMap &nsLinkedMap,FTVHelp *ftv,
1871 bool rootOnly,bool addToIndex);
1872
1874 bool rootOnly,bool addToIndex)
1875{
1876 if (!nd->isAnonymous() &&
1877 (!rootOnly || nd->getOuterScope()==Doxygen::globalScope))
1878 {
1879
1880 bool hasNestedNamespace = namespaceHasNestedNamespace(nd);
1881 bool hasChildren = hasNestedNamespace ||
1884 bool isLinkable = nd->isLinkable();
1885 int visibleMembers = nd->countVisibleMembers();
1886
1887 //printf("namespace %s hasChildren=%d visibleMembers=%d\n",qPrint(nd->name()),hasChildren,visibleMembers);
1888
1889 DString ref;
1890 DString file;
1891 if (isLinkable)
1892 {
1893 ref = nd->getReference();
1894 file = nd->getOutputFileBase();
1895 if (nd->getLanguage()==SrcLangExt::VHDL) // UGLY HACK
1896 {
1897 file=file.replace(0,dstrlen("namespace"),"class");
1898 }
1899 }
1900
1901 bool isDir = hasChildren || visibleMembers>0;
1902 if (isLinkable || isDir)
1903 {
1904 ftv->addContentsItem(hasNestedNamespace,nd->localName(),ref,file,DString(),false,nd->partOfGroups().empty(),nd);
1905
1906 if (addToIndex)
1907 {
1908 Doxygen::indexList->addContentsItem(isDir,nd->localName(),ref,file,DString(),
1909 hasChildren && !file.empty(),nd->partOfGroups().empty());
1910 }
1911 if (addToIndex && isDir)
1912 {
1914 }
1915
1916 if (isDir)
1917 {
1918 ftv->incContentsDepth();
1919 writeNamespaceTree(nd->getNamespaces(),ftv,false,addToIndex);
1920 writeClassTree(nd->getClasses(),nullptr,addToIndex,false,ClassDef::Class);
1921 writeConceptList(nd->getConcepts(),nullptr,addToIndex);
1922 writeNamespaceMembers(nd,addToIndex);
1923 ftv->decContentsDepth();
1924 }
1925 if (addToIndex && isDir)
1926 {
1928 }
1929 }
1930 }
1931}
1932
1933static void writeNamespaceTree(const NamespaceLinkedRefMap &nsLinkedMap,FTVHelp *ftv,
1934 bool rootOnly,bool addToIndex)
1935{
1936 for (const auto &nd : nsLinkedMap)
1937 {
1938 if (nd->isVisibleInHierarchy())
1939 {
1940 writeNamespaceTreeElement(nd,ftv,rootOnly,addToIndex);
1941 }
1942 }
1943}
1944
1945static void writeNamespaceTree(const NamespaceLinkedMap &nsLinkedMap,FTVHelp *ftv,
1946 bool rootOnly,bool addToIndex)
1947{
1948 for (const auto &nd : nsLinkedMap)
1949 {
1950 if (nd->isVisibleInHierarchy())
1951 {
1952 writeNamespaceTreeElement(nd.get(),ftv,rootOnly,addToIndex);
1953 }
1954 }
1955}
1956
1957static void writeClassTreeInsideNamespace(const NamespaceLinkedRefMap &nsLinkedMap,FTVHelp *ftv,
1958 bool rootOnly,bool addToIndex,ClassDef::CompoundType ct);
1959
1961 bool rootOnly,bool addToIndex,ClassDef::CompoundType ct)
1962{
1963 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
1964 if (!nd->isAnonymous() &&
1965 (!rootOnly || nd->getOuterScope()==Doxygen::globalScope))
1966 {
1967 bool isDir = namespaceHasNestedClass(nd,sliceOpt,ct);
1968 bool isLinkable = nd->isLinkableInProject();
1969
1970 //printf("writeClassTreeInsideNamespaceElement namespace %s isLinkable=%d isDir=%d\n",qPrint(nd->name()),isLinkable,isDir);
1971
1972 DString ref;
1973 DString file;
1974 if (isLinkable)
1975 {
1976 ref = nd->getReference();
1977 file = nd->getOutputFileBase();
1978 if (nd->getLanguage()==SrcLangExt::VHDL) // UGLY HACK
1979 {
1980 file=file.replace(0,dstrlen("namespace"),"class");
1981 }
1982 }
1983
1984 if (isDir)
1985 {
1986 ftv->addContentsItem(isDir,nd->localName(),ref,file,DString(),false,true,nd);
1987
1988 if (addToIndex)
1989 {
1990 // the namespace entry is already shown under the namespace list so don't
1991 // add it to the nav index and don't create a separate index file for it otherwise
1992 // it will overwrite the one written for the namespace list.
1993 Doxygen::indexList->addContentsItem(isDir,nd->localName(),ref,file,DString(),
1994 false, // separateIndex
1995 false // addToNavIndex
1996 );
1997 }
1998 if (addToIndex)
1999 {
2001 }
2002
2003 ftv->incContentsDepth();
2004 writeClassTreeInsideNamespace(nd->getNamespaces(),ftv,false,addToIndex,ct);
2005 ClassLinkedRefMap d = nd->getClasses();
2006 if (sliceOpt)
2007 {
2008 if (ct == ClassDef::Interface)
2009 {
2010 d = nd->getInterfaces();
2011 }
2012 else if (ct == ClassDef::Struct)
2013 {
2014 d = nd->getStructs();
2015 }
2016 else if (ct == ClassDef::Exception)
2017 {
2018 d = nd->getExceptions();
2019 }
2020 }
2021 writeClassTree(d,ftv,addToIndex,false,ct);
2022 ftv->decContentsDepth();
2023
2024 if (addToIndex)
2025 {
2027 }
2028 }
2029 }
2030}
2031
2033 bool rootOnly,bool addToIndex,ClassDef::CompoundType ct)
2034{
2035 for (const auto &nd : nsLinkedMap)
2036 {
2037 writeClassTreeInsideNamespaceElement(nd,ftv,rootOnly,addToIndex,ct);
2038 }
2039}
2040
2042 bool rootOnly,bool addToIndex,ClassDef::CompoundType ct)
2043{
2044 for (const auto &nd : nsLinkedMap)
2045 {
2046 writeClassTreeInsideNamespaceElement(nd.get(),ftv,rootOnly,addToIndex,ct);
2047 }
2048}
2049
2051{
2052 if (Index::instance().numDocumentedNamespaces()==0) return;
2053 ol.pushGeneratorState();
2056 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::NamespaceList);
2057 if (lne==nullptr) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Namespaces); // fall back
2058 DString title = lne ? lne->title() : theTranslator->trNamespaceList();
2059 bool addToIndex = lne==nullptr || lne->visible();
2060 startFile(ol,"namespaces",false,DString(),title,HighlightedItem::Namespaces);
2061 startTitle(ol,DString());
2062 ol.parseText(title);
2063 endTitle(ol,DString(),DString());
2064 ol.startContents();
2065 ol.startTextBlock();
2066 ol.parseText(lne ? lne->intro() : theTranslator->trNamespaceListDescription(Config_getBool(EXTRACT_ALL)));
2067 ol.endTextBlock();
2068
2069 bool first=true;
2070
2071 // ---------------
2072 // Linear namespace index for Latex/RTF
2073 // ---------------
2074 ol.pushGeneratorState();
2076
2077 for (const auto &nd : *Doxygen::namespaceLinkedMap)
2078 {
2079 if (nd->isLinkableInProject())
2080 {
2081 if (first)
2082 {
2083 ol.startIndexList();
2084 first=false;
2085 }
2086 //ol.writeStartAnnoItem("namespace",nd->getOutputFileBase(),0,nd->name());
2087 ol.startIndexKey();
2088 if (nd->getLanguage()==SrcLangExt::VHDL)
2089 {
2090 ol.writeObjectLink(DString(), nd->getOutputFileBase().replace(0,dstrlen("namespace"),"class"),DString(),nd->displayName());
2091 }
2092 else
2093 {
2094 ol.writeObjectLink(DString(),nd->getOutputFileBase(),DString(),nd->displayName());
2095 }
2096 ol.endIndexKey();
2097
2098 bool hasBrief = !nd->briefDescription().empty();
2099 ol.startIndexValue(hasBrief);
2100 if (hasBrief)
2101 {
2102 ol.generateDoc(nd->briefFile(),
2103 nd->briefLine(),
2104 nd.get(),
2105 nullptr,
2106 nd->briefDescription(true),
2107 DocOptions()
2108 .setSingleLine(true)
2109 .setLinkFromIndex(true));
2110 }
2111 ol.endIndexValue(nd->getOutputFileBase(),hasBrief);
2112
2113 }
2114 }
2115 if (!first) ol.endIndexList();
2116
2117 ol.popGeneratorState();
2118
2119 // ---------------
2120 // Hierarchical namespace index for HTML
2121 // ---------------
2122 ol.pushGeneratorState();
2124
2125 {
2126 if (addToIndex)
2127 {
2128 Doxygen::indexList->addContentsItem(true,title,DString(),"namespaces",DString(),true,true);
2130 }
2131 FTVHelp ftv(false);
2132 writeNamespaceTree(*Doxygen::namespaceLinkedMap,&ftv,true,addToIndex);
2133 TextStream t;
2135 ol.writeString(t.str());
2136 if (addToIndex)
2137 {
2139 }
2140 }
2141
2142 ol.popGeneratorState();
2143 // ------
2144
2145 endFile(ol);
2146 ol.popGeneratorState();
2147}
2148
2149//----------------------------------------------------------------------------
2150
2152{
2153 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
2154 int count=0;
2155 int countPrinted=0;
2156 for (const auto &cd : *Doxygen::classLinkedMap)
2157 {
2158 if (sliceOpt && cd->compoundType() != ct)
2159 {
2160 continue;
2161 }
2162 if (cd->isLinkableInProject() && !cd->isImplicitTemplateInstance())
2163 {
2164 if (!cd->isEmbeddedInOuterScope())
2165 {
2166 countPrinted++;
2167 }
2168 count++;
2169 }
2170 }
2171 *cp = countPrinted;
2172 return count;
2173}
2174
2175
2177{
2178 //LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassList);
2179 //bool addToIndex = lne==nullptr || lne->visible();
2180 bool first=true;
2181
2182 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
2183
2184 for (const auto &cd : *Doxygen::classLinkedMap)
2185 {
2186 if (cd->getLanguage()==SrcLangExt::VHDL &&
2187 (VhdlDocGen::convert(cd->protection())==VhdlDocGen::PACKAGECLASS ||
2189 ) // no architecture
2190 {
2191 continue;
2192 }
2193 if (first)
2194 {
2195 ol.startIndexList();
2196 first=false;
2197 }
2198
2199 if (sliceOpt && cd->compoundType() != ct)
2200 {
2201 continue;
2202 }
2203
2204 ol.pushGeneratorState();
2205 if (cd->isEmbeddedInOuterScope())
2206 {
2210 }
2211 if (cd->isLinkableInProject() && !cd->isImplicitTemplateInstance())
2212 {
2213 ol.startIndexKey();
2214 if (cd->getLanguage()==SrcLangExt::VHDL)
2215 {
2217 ol.docify(prot);
2218 ol.writeString(" ");
2219 }
2220 ol.writeObjectLink(DString(),cd->getOutputFileBase(),cd->anchor(),cd->displayName());
2221 ol.endIndexKey();
2222 bool hasBrief = !cd->briefDescription().empty();
2223 ol.startIndexValue(hasBrief);
2224 if (hasBrief)
2225 {
2226 ol.generateDoc(cd->briefFile(),
2227 cd->briefLine(),
2228 cd.get(),
2229 nullptr,
2230 cd->briefDescription(true),
2231 DocOptions()
2232 .setSingleLine(true)
2233 .setLinkFromIndex(true));
2234 }
2235 ol.endIndexValue(cd->getOutputFileBase(),hasBrief);
2236
2237 //if (addToIndex)
2238 //{
2239 // addMembersToIndex(cd,LayoutDocManager::Class,cd->displayName(),cd->anchor());
2240 //}
2241 }
2242 ol.popGeneratorState();
2243 }
2244 if (!first) ol.endIndexList();
2245}
2246
2247inline bool isId1(int c)
2248{
2249 return (c<127 && c>31); // printable ASCII character
2250}
2251
2252static DString letterToLabel(const DString &startLetter)
2253{
2254 if (startLetter.empty()) return startLetter;
2255 const char *p = startLetter.data();
2256 char c = *p;
2257 DString result;
2258 if (isId1(c))
2259 {
2260 result+=c;
2261 }
2262 else
2263 {
2264 result="0x";
2265 const char hex[]="0123456789abcdef";
2266 while ((c=*p++))
2267 {
2268 result+=hex[static_cast<unsigned char>(c)>>4];
2269 result+=hex[static_cast<unsigned char>(c)&0xf];
2270 }
2271 }
2272 return result;
2273}
2274
2275//----------------------------------------------------------------------------
2276
2277
2278using UsedIndexLetters = std::set<std::string>;
2279
2280// write an alphabetical index of all class with a header for each letter
2281static void writeAlphabeticalClassList(OutputList &ol, ClassDef::CompoundType ct, int /* annotatedCount */)
2282{
2283 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
2284
2285 // What starting letters are used
2286 UsedIndexLetters indexLettersUsed;
2287
2288 // first count the number of headers
2289 for (const auto &cd : *Doxygen::classLinkedMap)
2290 {
2291 if (sliceOpt && cd->compoundType() != ct)
2292 continue;
2293 if (cd->getLanguage()==SrcLangExt::VHDL && !(VhdlDocGen::convert(cd->protection())==VhdlDocGen::ENTITYCLASS ))// no architecture
2294 continue;
2295
2296 if (cd->isLinkableInProject() && !cd->isImplicitTemplateInstance())
2297 {
2298 // get the first UTF8 character (after the part that should be ignored)
2299 int index = getPrefixIndex(cd->className());
2300 std::string letter = getUTF8CharAt(cd->className().str(),index);
2301 if (!letter.empty())
2302 {
2303 indexLettersUsed.insert(convertUTF8ToUpper(letter));
2304 }
2305 }
2306 }
2307
2308 // write quick link index (row of letters)
2309 DString alphaLinks = "<div class=\"qindex\">";
2310 bool first=true;
2311 for (const auto &letter : indexLettersUsed)
2312 {
2313 if (!first) alphaLinks += alphaSepar;
2314 first=false;
2315 DString li = letterToLabel(letter);
2316 alphaLinks += "<a class=\"qindex\" href=\"#letter_" +
2317 li + "\">" +
2318 letter + "</a>";
2319 }
2320 alphaLinks += "</div>\n";
2321 ol.writeString(alphaLinks);
2322
2323 std::map<std::string, std::vector<const ClassDef*> > classesByLetter;
2324
2325 // fill the columns with the class list (row elements in each column,
2326 // expect for the columns with number >= itemsInLastRow, which get one
2327 // item less.
2328 for (const auto &cd : *Doxygen::classLinkedMap)
2329 {
2330 if (sliceOpt && cd->compoundType() != ct)
2331 continue;
2332 if (cd->getLanguage()==SrcLangExt::VHDL && !(VhdlDocGen::convert(cd->protection())==VhdlDocGen::ENTITYCLASS ))// no architecture
2333 continue;
2334
2335 if (cd->isLinkableInProject() && !cd->isImplicitTemplateInstance())
2336 {
2337 DString className = cd->className();
2338 int index = getPrefixIndex(className);
2339 std::string letter = getUTF8CharAt(className.str(),index);
2340 if (!letter.empty())
2341 {
2342 letter = convertUTF8ToUpper(letter);
2343 auto it = classesByLetter.find(letter);
2344 if (it!=classesByLetter.end()) // add class to the existing list
2345 {
2346 it->second.push_back(cd.get());
2347 }
2348 else // new entry
2349 {
2350 classesByLetter.emplace(letter, std::vector<const ClassDef*>({ cd.get() }));
2351 }
2352 }
2353 }
2354 }
2355
2356 // sort the class lists per letter while ignoring the prefix
2357 for (auto &[letter,list] : classesByLetter)
2358 {
2359 std::stable_sort(list.begin(), list.end(),
2360 [](const auto &c1,const auto &c2)
2361 {
2362 DString n1 = c1->className();
2363 DString n2 = c2->className();
2364 return dstricmp_sort(n1.data()+getPrefixIndex(n1), n2.data()+getPrefixIndex(n2))<0;
2365 });
2366 }
2367
2368 // generate table
2369 if (!classesByLetter.empty())
2370 {
2371 ol.writeString("<div class=\"classindex\">\n");
2372 int counter=0;
2373 for (const auto &cl : classesByLetter)
2374 {
2375 DString parity = (counter++%2)==0 ? "even" : "odd";
2376 ol.writeString("<dl class=\"classindex " + parity + "\">\n");
2377
2378 // write character heading
2379 ol.writeString("<dt class=\"alphachar\">");
2380 DString s = letterToLabel(cl.first);
2381 ol.writeString("<a id=\"letter_");
2382 ol.writeString(s);
2383 ol.writeString("\" name=\"letter_");
2384 ol.writeString(s);
2385 ol.writeString("\">");
2386 ol.writeString(cl.first);
2387 ol.writeString("</a>");
2388 ol.writeString("</dt>\n");
2389
2390 // write class links
2391 for (const auto &cd : cl.second)
2392 {
2393 ol.writeString("<dd>");
2394 DString namesp,cname;
2395 extractNamespaceName(cd->name(),cname,namesp);
2396 DString nsDispName;
2397 SrcLangExt lang = cd->getLanguage();
2399 if (sep!="::")
2400 {
2401 nsDispName=substitute(namesp,"::",sep);
2402 cname=substitute(cname,"::",sep);
2403 }
2404 else
2405 {
2406 nsDispName=namesp;
2407 }
2408
2409 ol.writeObjectLink(cd->getReference(),
2410 cd->getOutputFileBase(),cd->anchor(),cname);
2411 if (!namesp.empty())
2412 {
2413 ol.writeString(" (");
2414 NamespaceDef *nd = getResolvedNamespace(namesp);
2415 if (nd && nd->isLinkable())
2416 {
2418 nd->getOutputFileBase(),DString(),nsDispName);
2419 }
2420 else
2421 {
2422 ol.docify(nsDispName);
2423 }
2424 ol.writeString(")");
2425 }
2426 ol.writeString("</dd>");
2427 }
2428
2429 ol.writeString("</dl>\n");
2430 }
2431 ol.writeString("</div>\n");
2432 }
2433}
2434
2435//----------------------------------------------------------------------------
2436
2438{
2439 if (Index::instance().numAnnotatedClasses()==0) return;
2440 ol.pushGeneratorState();
2442 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassIndex);
2443 DString title = lne ? lne->title() : theTranslator->trCompoundIndex();
2444 bool addToIndex = lne==nullptr || lne->visible();
2445
2446 startFile(ol,"classes",false,DString(),title,HighlightedItem::Classes);
2447
2448 startTitle(ol,DString());
2449 ol.parseText(title);
2450 endTitle(ol,DString(),DString());
2451
2452 if (addToIndex)
2453 {
2454 Doxygen::indexList->addContentsItem(false,title,DString(),"classes",DString(),false,true);
2455 }
2456
2457 ol.startContents();
2458 writeAlphabeticalClassList(ol, ClassDef::Class, Index::instance().numAnnotatedClasses());
2459 endFile(ol); // contains ol.endContents()
2460
2461 ol.popGeneratorState();
2462}
2463
2464//----------------------------------------------------------------------------
2465
2467{
2468 if (Index::instance().numAnnotatedInterfaces()==0) return;
2469 ol.pushGeneratorState();
2471 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::InterfaceIndex);
2472 DString title = lne ? lne->title() : theTranslator->trInterfaceIndex();
2473 bool addToIndex = lne==nullptr || lne->visible();
2474
2475 startFile(ol,"interfaces",false,DString(),title,HighlightedItem::Interfaces);
2476
2477 startTitle(ol,DString());
2478 ol.parseText(title);
2479 endTitle(ol,DString(),DString());
2480
2481 if (addToIndex)
2482 {
2483 Doxygen::indexList->addContentsItem(false,title,DString(),"interfaces",DString(),false,true);
2484 }
2485
2486 ol.startContents();
2487 writeAlphabeticalClassList(ol, ClassDef::Interface, Index::instance().numAnnotatedInterfaces());
2488 endFile(ol); // contains ol.endContents()
2489
2490 ol.popGeneratorState();
2491}
2492
2493//----------------------------------------------------------------------------
2494
2496{
2497 if (Index::instance().numAnnotatedStructs()==0) return;
2498 ol.pushGeneratorState();
2500 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::StructIndex);
2501 DString title = lne ? lne->title() : theTranslator->trStructIndex();
2502 bool addToIndex = lne==nullptr || lne->visible();
2503
2504 startFile(ol,"structs",false,DString(),title,HighlightedItem::Structs);
2505
2506 startTitle(ol,DString());
2507 ol.parseText(title);
2508 endTitle(ol,DString(),DString());
2509
2510 if (addToIndex)
2511 {
2512 Doxygen::indexList->addContentsItem(false,title,DString(),"structs",DString(),false,true);
2513 }
2514
2515 ol.startContents();
2516 writeAlphabeticalClassList(ol, ClassDef::Struct, Index::instance().numAnnotatedStructs());
2517 endFile(ol); // contains ol.endContents()
2518
2519 ol.popGeneratorState();
2520}
2521
2522//----------------------------------------------------------------------------
2523
2525{
2526 if (Index::instance().numAnnotatedExceptions()==0) return;
2527 ol.pushGeneratorState();
2529 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ExceptionIndex);
2530 DString title = lne ? lne->title() : theTranslator->trExceptionIndex();
2531 bool addToIndex = lne==nullptr || lne->visible();
2532
2533 startFile(ol,"exceptions",false,DString(),title,HighlightedItem::Exceptions);
2534
2535 startTitle(ol,DString());
2536 ol.parseText(title);
2537 endTitle(ol,DString(),DString());
2538
2539 if (addToIndex)
2540 {
2541 Doxygen::indexList->addContentsItem(false,title,DString(),"exceptions",DString(),false,true);
2542 }
2543
2544 ol.startContents();
2545 writeAlphabeticalClassList(ol, ClassDef::Exception, Index::instance().numAnnotatedExceptions());
2546 endFile(ol); // contains ol.endContents()
2547
2548 ol.popGeneratorState();
2549}
2550
2551//----------------------------------------------------------------------------
2552
2577
2579{
2580 //printf("writeAnnotatedIndex: count=%d printed=%d\n", ctx.numAnnotated, ctx.numPrinted);
2581 if (ctx.numAnnotated==0) return;
2582
2583 ol.pushGeneratorState();
2585 if (ctx.numPrinted==0)
2586 {
2589 }
2591 if (lne==nullptr) lne = LayoutDocManager::instance().rootNavEntry()->find(ctx.fallbackKind); // fall back
2592 DString title = lne ? lne->title() : ctx.listDefaultTitleText;
2593 bool addToIndex = lne==nullptr || lne->visible();
2594
2595 startFile(ol,ctx.fileBaseName,false,DString(),title,ctx.hiItem);
2596
2597 startTitle(ol,DString());
2598 ol.parseText(title);
2599 endTitle(ol,DString(),DString());
2600
2601 ol.startContents();
2602
2603 ol.startTextBlock();
2604 ol.parseText(lne ? lne->intro() : ctx.listDefaultIntroText);
2605 ol.endTextBlock();
2606
2607 // ---------------
2608 // Linear class index for Latex/RTF
2609 // ---------------
2610 ol.pushGeneratorState();
2613
2615
2617 ol.popGeneratorState();
2618
2619 // ---------------
2620 // Hierarchical class index for HTML
2621 // ---------------
2622 ol.pushGeneratorState();
2624
2625 {
2626 if (addToIndex)
2627 {
2628 Doxygen::indexList->addContentsItem(true,title,DString(),ctx.fileBaseName,DString(),true,true);
2630 }
2631 FTVHelp ftv(false);
2633 writeClassTree(*Doxygen::classLinkedMap,&ftv,addToIndex,true,ctx.compoundType);
2634 TextStream t;
2636 ol.writeString(t.str());
2637 if (addToIndex)
2638 {
2640 }
2641 }
2642
2643 ol.popGeneratorState();
2644 // ------
2645
2646 endFile(ol); // contains ol.endContents()
2647 ol.popGeneratorState();
2648}
2649
2650//----------------------------------------------------------------------------
2651
2653{
2654 const auto &index = Index::instance();
2656 AnnotatedIndexContext(index.numAnnotatedClasses(),index.numAnnotatedClassesPrinted(),
2657 LayoutNavEntry::ClassList,LayoutNavEntry::Classes,
2660 "annotated",
2662}
2663
2664//----------------------------------------------------------------------------
2665
2667{
2668 const auto &index = Index::instance();
2670 AnnotatedIndexContext(index.numAnnotatedInterfaces(),index.numAnnotatedInterfacesPrinted(),
2671 LayoutNavEntry::InterfaceList,LayoutNavEntry::Interfaces,
2674 "annotatedinterfaces",
2676}
2677
2678//----------------------------------------------------------------------------
2679
2681{
2682 const auto &index = Index::instance();
2684 AnnotatedIndexContext(index.numAnnotatedStructs(),index.numAnnotatedStructsPrinted(),
2685 LayoutNavEntry::StructList,LayoutNavEntry::Structs,
2688 "annotatedstructs",
2690}
2691
2692//----------------------------------------------------------------------------
2693
2695{
2696 const auto &index = Index::instance();
2698 AnnotatedIndexContext(index.numAnnotatedExceptions(),index.numAnnotatedExceptionsPrinted(),
2699 LayoutNavEntry::ExceptionList,LayoutNavEntry::Exceptions,
2702 "annotatedexceptions",
2704}
2705
2706//----------------------------------------------------------------------------
2707static void writeClassLinkForMember(OutputList &ol,const MemberDef *md,const DString &separator,
2708 DString &prevClassName)
2709{
2710 const ClassDef *cd=md->getClassDef();
2711 if ( cd && prevClassName!=cd->displayName())
2712 {
2713 ol.writeString(separator);
2715 cd->displayName());
2716 prevClassName = cd->displayName();
2717 }
2718}
2719
2720static void writeFileLinkForMember(OutputList &ol,const MemberDef *md,const DString &separator,
2721 DString &prevFileName)
2722{
2723 const FileDef *fd=md->getFileDef();
2724 if (fd && prevFileName!=fd->name())
2725 {
2726 ol.writeString(separator);
2728 fd->name());
2729 prevFileName = fd->name();
2730 }
2731}
2732
2733static void writeNamespaceLinkForMember(OutputList &ol,const MemberDef *md,const DString &separator,
2734 DString &prevNamespaceName)
2735{
2736 const NamespaceDef *nd=md->getNamespaceDef();
2737 if (nd && prevNamespaceName!=nd->displayName())
2738 {
2739 ol.writeString(separator);
2741 nd->displayName());
2742 prevNamespaceName = nd->displayName();
2743 }
2744}
2745
2746static void writeModuleLinkForMember(OutputList &ol,const MemberDef *md,const DString &separator,
2747 DString &prevModuleName)
2748{
2749 const ModuleDef *mod=md->getModuleDef();
2750 if (mod && prevModuleName!=mod->displayName())
2751 {
2752 ol.writeString(separator);
2753 // link to the member declaration in the module page
2754 ol.writeObjectLink(mod->getReference(),mod->getOutputFileBase(),"r_"+md->anchor(),
2755 mod->displayName());
2756 prevModuleName = mod->displayName();
2757 }
2758}
2759
2760
2761static void writeMemberList(OutputList &ol,bool useSections,const std::string &page,
2762 const Index::MemberIndexMap &memberIndexMap,
2764{
2765 int index = static_cast<int>(type);
2766 const int numIndices = 4;
2767 ASSERT(index<numIndices);
2768
2769 typedef void (*writeLinkForMember_t)(OutputList &ol,const MemberDef *md,const DString &separator,
2770 DString &prevNamespaceName);
2771
2772 // each index tab has its own write function
2773 static writeLinkForMember_t writeLinkForMemberMap[numIndices] =
2774 {
2779 };
2780 DString prevName;
2781 DString prevDefName;
2782 bool first=true;
2783 bool firstSection=true;
2784 bool firstItem=true;
2785 const Index::MemberIndexList *mil = nullptr;
2786 std::string letter;
2787 for (const auto &kv : memberIndexMap)
2788 {
2789 if (!page.empty()) // specific page mode
2790 {
2791 auto it = memberIndexMap.find(page);
2792 if (it != memberIndexMap.end())
2793 {
2794 mil = &it->second;
2795 letter = page;
2796 }
2797 }
2798 else // do all pages
2799 {
2800 mil = &kv.second;
2801 letter = kv.first;
2802 }
2803 if (mil==nullptr || mil->empty()) continue;
2804 for (const auto &md : *mil)
2805 {
2806 const char *sep = nullptr;
2807 bool isFunc=!md->isObjCMethod() &&
2808 (md->isFunction() || md->isSlot() || md->isSignal());
2809 DString name=type==Definition::TypeModule ? md->qualifiedName() : md->name();
2810 int startIndex = getPrefixIndex(name);
2811 if (name.data()+startIndex!=prevName) // new entry
2812 {
2813 if ((prevName.empty() ||
2814 tolower(name.at(startIndex))!=tolower(prevName.at(0))) &&
2815 useSections) // new section
2816 {
2817 if (!firstItem) ol.endItemListItem();
2818 if (!firstSection) ol.endItemList();
2819 DString cs = letterToLabel(letter);
2820 DString anchor = "index_"+convertToId(cs);
2821 DString title = "- "+letter+" -";
2822 ol.startSection(anchor,title,SectionType::Subsection);
2823 ol.docify(title);
2825 ol.startItemList();
2826 firstSection=false;
2827 firstItem=true;
2828 }
2829 else if (!useSections && first)
2830 {
2831 ol.startItemList();
2832 first=false;
2833 }
2834
2835 // member name
2836 if (!firstItem) ol.endItemListItem();
2837 ol.startItemListItem();
2838 firstItem=false;
2839 ol.docify(name);
2840 if (isFunc) ol.docify("()");
2841 //ol.writeString("\n");
2842
2843 // link to class
2844 prevDefName="";
2845 sep = "&#160;:&#160;";
2846 prevName = name.data()+startIndex;
2847 }
2848 else // same entry
2849 {
2850 sep = ", ";
2851 // link to class for other members with the same name
2852 }
2853 if (index<numIndices)
2854 {
2855 // write the link for the specific list type
2856 writeLinkForMemberMap[index](ol,md,sep,prevDefName);
2857 }
2858 }
2859 if (!page.empty())
2860 {
2861 break;
2862 }
2863 }
2864 if (!firstItem) ol.endItemListItem();
2865 ol.endItemList();
2866}
2867
2868//----------------------------------------------------------------------------
2869
2871{
2872 bool hideFriendCompounds = Config_getBool(HIDE_FRIEND_COMPOUNDS);
2873 const ClassDef *cd=nullptr;
2874
2875 if (md->isLinkableInProject() &&
2876 (cd=md->getClassDef()) &&
2877 cd->isLinkableInProject() &&
2879 {
2880 DString n = md->name();
2881 std::string letter = getUTF8CharAt(n.str(),getPrefixIndex(n));
2882 if (!letter.empty())
2883 {
2884 letter = convertUTF8ToLower(letter);
2885 bool isFriendToHide = hideFriendCompounds &&
2886 (md->typeString()=="friend class" ||
2887 md->typeString()=="friend struct" ||
2888 md->typeString()=="friend union");
2889 if (!(md->isFriend() && isFriendToHide) &&
2890 (!md->isEnumValue() || (md->getEnumScope() && !md->getEnumScope()->isStrong()))
2891 )
2892 {
2894 }
2895 if (md->isFunction() || md->isSlot() || md->isSignal())
2896 {
2898 }
2899 else if (md->isVariable())
2900 {
2902 }
2903 else if (md->isTypedef())
2904 {
2906 }
2907 else if (md->isEnumerate())
2908 {
2910 }
2911 else if (md->isEnumValue() && md->getEnumScope() && !md->getEnumScope()->isStrong())
2912 {
2914 }
2915 else if (md->isProperty())
2916 {
2918 }
2919 else if (md->isEvent())
2920 {
2922 }
2923 else if (md->isRelated() || md->isForeign() ||
2924 (md->isFriend() && !isFriendToHide))
2925 {
2927 }
2928 }
2929 }
2930}
2931
2932//----------------------------------------------------------------------------
2933
2935{
2936 const NamespaceDef *nd=md->getNamespaceDef();
2937 if (nd && nd->isLinkableInProject() && md->isLinkableInProject())
2938 {
2939 DString n = md->name();
2940 std::string letter = getUTF8CharAt(n.str(),getPrefixIndex(n));
2941 if (!letter.empty())
2942 {
2943 letter = convertUTF8ToLower(letter);
2944 if (!md->isEnumValue() || (md->getEnumScope() && !md->getEnumScope()->isStrong()))
2945 {
2947 }
2948 if (md->isFunction())
2949 {
2951 }
2952 else if (md->isVariable())
2953 {
2955 }
2956 else if (md->isTypedef())
2957 {
2959 }
2960 else if (md->isSequence())
2961 {
2963 }
2964 else if (md->isDictionary())
2965 {
2967 }
2968 else if (md->isEnumerate())
2969 {
2971 }
2972 else if (md->isEnumValue() && md->getEnumScope() && !md->getEnumScope()->isStrong())
2973 {
2975 }
2976 }
2977 }
2978}
2979
2980//----------------------------------------------------------------------------
2981
2983{
2984 const FileDef *fd=md->getFileDef();
2985 if (fd && fd->isLinkableInProject() && md->isLinkableInProject())
2986 {
2987 DString n = md->name();
2988 std::string letter = getUTF8CharAt(n.str(),getPrefixIndex(n));
2989 if (!letter.empty())
2990 {
2991 letter = convertUTF8ToLower(letter);
2992 if (!md->isEnumValue() || (md->getEnumScope() && !md->getEnumScope()->isStrong()))
2993 {
2995 }
2996 if (md->isFunction())
2997 {
2999 }
3000 else if (md->isVariable())
3001 {
3003 }
3004 else if (md->isTypedef())
3005 {
3007 }
3008 else if (md->isSequence())
3009 {
3011 }
3012 else if (md->isDictionary())
3013 {
3015 }
3016 else if (md->isEnumerate())
3017 {
3019 }
3020 else if (md->isEnumValue() && md->getEnumScope() && !md->getEnumScope()->isStrong())
3021 {
3023 }
3024 else if (md->isDefine())
3025 {
3027 }
3028 }
3029 }
3030}
3031
3032//----------------------------------------------------------------------------
3033
3035{
3036 const ModuleDef *mod = md->getModuleDef();
3037 if (mod && mod->isPrimaryInterface() && mod->isLinkableInProject() && md->isLinkableInProject())
3038 {
3039 DString n = md->name();
3040 std::string letter = getUTF8CharAt(n.str(),getPrefixIndex(n));
3041 if (!letter.empty())
3042 {
3043 letter = convertUTF8ToLower(letter);
3044 if (!md->isEnumValue() || (md->getEnumScope() && !md->getEnumScope()->isStrong()))
3045 {
3047 }
3048 if (md->isFunction())
3049 {
3051 }
3052 else if (md->isVariable())
3053 {
3055 }
3056 else if (md->isTypedef())
3057 {
3059 }
3060 else if (md->isEnumerate())
3061 {
3063 }
3064 else if (md->isEnumValue() && md->getEnumScope() && !md->getEnumScope()->isStrong())
3065 {
3067 }
3068 }
3069 }
3070}
3071
3072//----------------------------------------------------------------------------
3073
3075 const Index::MemberIndexMap &map,const std::string &page,
3076 DString fullName,bool multiPage)
3077{
3078 bool first=true;
3079 startQuickIndexList(ol,true);
3080 for (const auto &[letter,list] : map)
3081 {
3082 DString ci(letter);
3083 DString is = letterToLabel(ci);
3084 DString anchor;
3086 if (!multiPage)
3087 anchor="#index_";
3088 else if (first)
3089 anchor=fullName+extension+"#index_";
3090 else
3091 anchor=fullName+"_"+is+extension+"#index_";
3092 startQuickIndexItem(ol,anchor+convertToId(is),letter==page,true,first);
3093 ol.writeString(ci);
3095 first=false;
3096 }
3098 ol.writeString(R"js(
3099<script type="text/javascript">
3100function updateNavHighlight() {
3101 var currentHash = window.location.hash;
3102 var navItems = document.querySelectorAll('#navrow4 .tablist li');
3103
3104 for (var i = 0; i < navItems.length; i++) {
3105 var item = navItems[i];
3106 var link = item.querySelector('a');
3107 item.classList.remove('current');
3108 if (link && link.getAttribute('href') === currentHash) {
3109 item.classList.add('current');
3110 }
3111 }
3112
3113 if (currentHash) {
3114 var target = document.querySelector(currentHash);
3115 if (target) {
3116 target.scrollIntoView();
3117 }
3118 }
3119}
3120updateNavHighlight();
3121window.addEventListener('hashchange', updateNavHighlight);
3122</script>
3123 )js");
3124}
3125
3126static void writeMemberIndex(OutputList &ol,
3127 const Index::MemberIndexMap &map, DString fullName,bool multiPage)
3128{
3129 bool first=true;
3130 ol.writeString("<br/>\n");
3131 DString alphaLinks = "<div class=\"qindex\">";
3132 StringMap usedLetters;
3133 for (const auto &[letter,list] : map)
3134 {
3135 usedLetters.emplace(convertUTF8ToUpper(letter),letter);
3136 }
3137 for (const auto &[letterUC,letter] : usedLetters)
3138 {
3139 DString ci(letter);
3140 DString is = letterToLabel(ci);
3141 DString anchor;
3143 if (!multiPage)
3144 anchor="#index_";
3145 else if (first)
3146 anchor=fullName+extension+"#index_";
3147 else
3148 anchor=fullName+"_"+is+extension+"#index_";
3149
3150 if (!first) alphaLinks += alphaSepar;
3151 first=false;
3152 DString li = letterToLabel(letter);
3153 alphaLinks += "<a class=\"qindex\" href=\"" + anchor +
3154 li + "\">" +
3155 letterUC + "</a>";
3156 }
3157 alphaLinks += "</div>\n";
3158 ol.writeString(alphaLinks);
3159}
3160
3161//----------------------------------------------------------------------------
3162
3163/** Helper class representing a class member in the navigation menu. */
3164struct CmhlInfo
3165{
3166 CmhlInfo(const char *fn,const DString &t) : fname(fn), title(t) {}
3167 const char *fname;
3169};
3170
3171static const CmhlInfo *getCmhlInfo(size_t hl)
3172{
3173 bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
3174 bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
3175 static CmhlInfo cmhlInfo[] =
3176 {
3177 CmhlInfo("functions", theTranslator->trAll()),
3178 CmhlInfo("functions_func",
3179 fortranOpt ? theTranslator->trSubprograms() :
3180 vhdlOpt ? theTranslator->trFunctionAndProc() :
3182 CmhlInfo("functions_vars",theTranslator->trVariables()),
3183 CmhlInfo("functions_type",theTranslator->trTypedefs()),
3184 CmhlInfo("functions_enum",theTranslator->trEnumerations()),
3185 CmhlInfo("functions_eval",theTranslator->trEnumerationValues()),
3186 CmhlInfo("functions_prop",theTranslator->trProperties()),
3187 CmhlInfo("functions_evnt",theTranslator->trEvents()),
3188 CmhlInfo("functions_rela",theTranslator->trRelatedSymbols())
3189 };
3190 return &cmhlInfo[hl];
3191}
3192
3194{
3195 const auto &index = Index::instance();
3196 if (index.numDocumentedClassMembers(hl)==0) return;
3197
3198 bool disableIndex = Config_getBool(DISABLE_INDEX);
3199 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
3200 bool fullSidebar = Config_getBool(FULL_SIDEBAR);
3201 bool dynamicMenus = Config_getBool(HTML_DYNAMIC_MENUS);
3202 bool quickLinksAfterSplitbar = !disableIndex && generateTreeView && fullSidebar;
3203
3204 bool multiPageIndex=false;
3205 if (index.numDocumentedClassMembers(hl)>MAX_ITEMS_BEFORE_MULTIPAGE_INDEX)
3206 {
3207 multiPageIndex=true;
3208 }
3209
3210 ol.pushGeneratorState();
3212
3214 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassMembers);
3215 DString title = lne ? lne->title() : theTranslator->trCompoundMembers();
3216 if (hl!=ClassMemberHighlight::All) title+=DString(" - ")+getCmhlInfo(hl)->title;
3217 bool addToIndex = lne==nullptr || lne->visible();
3218
3219 if (addToIndex)
3220 {
3221 Doxygen::indexList->addContentsItem(multiPageIndex,getCmhlInfo(hl)->title,DString(),
3222 getCmhlInfo(hl)->fname,DString(),multiPageIndex,true);
3223 if (multiPageIndex) Doxygen::indexList->incContentsDepth();
3224 }
3225
3226 bool first=true;
3227 for (const auto &[letter,list] : index.isClassIndexLetterUsed(hl))
3228 {
3229 DString fileName = getCmhlInfo(hl)->fname;
3230 if (multiPageIndex)
3231 {
3232 DString cs(letter);
3233 if (!first)
3234 {
3235 fileName+="_"+letterToLabel(cs);
3236 }
3237 if (addToIndex)
3238 {
3239 Doxygen::indexList->addContentsItem(false,cs,DString(),fileName,DString(),false,true);
3240 }
3241 }
3242
3243 bool quickIndex = index.numDocumentedClassMembers(hl)>maxItemsBeforeQuickIndex;
3244
3245 auto writeQuickLinks = [&,cap_letter=letter]()
3246 {
3248 if (!dynamicMenus)
3249 {
3251
3252 // index item for global member list
3257
3258 // index items per category member lists
3259 for (int i=1;i<ClassMemberHighlight::Total;i++)
3260 {
3261 if (index.numDocumentedClassMembers(static_cast<ClassMemberHighlight::Enum>(i))>0)
3262 {
3263 startQuickIndexItem(ol,getCmhlInfo(i)->fname+Doxygen::htmlFileExtension,hl==i,true,first);
3265 //printf("multiPageIndex=%d first=%d fileName=%s file=%s title=%s\n",
3266 // multiPageIndex,first,qPrint(fileName),getCmhlInfo(i)->fname,qPrint(getCmhlInfo(i)->title));
3268 }
3269 }
3270
3272
3273 // quick alphabetical index
3274 if (quickIndex)
3275 {
3276 writeQuickMemberIndex(ol,index.isClassIndexLetterUsed(hl),cap_letter,
3277 getCmhlInfo(hl)->fname,multiPageIndex);
3278 }
3279
3280 ol.writeString("</div><!-- main-nav -->\n");
3281 }
3282 };
3283
3284 ol.startFile(fileName+extension,false,DString(),title);
3285 ol.startQuickIndices();
3286 if (!disableIndex && !quickLinksAfterSplitbar)
3287 {
3288 writeQuickLinks();
3289 }
3290 ol.endQuickIndices();
3291 ol.writeSplitBar(fileName,DString());
3292 if (quickLinksAfterSplitbar)
3293 {
3294 writeQuickLinks();
3295 if (!dynamicMenus)
3296 {
3297 ol.writeString("<div id=\"container\">\n");
3298 ol.writeString("<div id=\"doc-content\">\n");
3299 }
3300 }
3302
3303 ol.startContents();
3304
3305 ol.startTextBlock();
3307 ol.endTextBlock();
3308 if (dynamicMenus || disableIndex)
3309 {
3310 writeMemberIndex(ol,index.isClassIndexLetterUsed(hl),getCmhlInfo(hl)->fname,multiPageIndex);
3311 }
3312
3313 writeMemberList(ol,quickIndex,
3314 multiPageIndex ? letter : std::string(),
3315 index.isClassIndexLetterUsed(hl),
3317 endFile(ol);
3318 first=false;
3319 }
3320
3321 if (multiPageIndex && addToIndex) Doxygen::indexList->decContentsDepth();
3322
3323 ol.popGeneratorState();
3324}
3325
3326static void writeClassMemberIndex(OutputList &ol)
3327{
3328 const auto &index = Index::instance();
3329 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassMembers);
3330 bool addToIndex = lne==nullptr || lne->visible();
3332 if (index.numDocumentedClassMembers(ClassMemberHighlight::All)>0 && addToIndex)
3336 }
3346 if (index.numDocumentedClassMembers(ClassMemberHighlight::All)>0 && addToIndex)
3347 {
3349 }
3350
3351}
3352
3353//----------------------------------------------------------------------------
3354
3355/** Helper class representing a file member in the navigation menu. */
3356struct FmhlInfo
3357{
3358 FmhlInfo(const char *fn,const DString &t) : fname(fn), title(t) {}
3359 const char *fname;
3360 DString title;
3362
3363static const FmhlInfo *getFmhlInfo(size_t hl)
3364{
3365 bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
3366 bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
3367 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
3368 static FmhlInfo fmhlInfo[] =
3369 {
3370 FmhlInfo("globals", theTranslator->trAll()),
3371 FmhlInfo("globals_func",
3372 fortranOpt ? theTranslator->trSubprograms() :
3373 vhdlOpt ? theTranslator->trFunctionAndProc() :
3375 FmhlInfo("globals_vars",sliceOpt ? theTranslator->trConstants() : theTranslator->trVariables()),
3376 FmhlInfo("globals_type",theTranslator->trTypedefs()),
3377 FmhlInfo("globals_sequ",theTranslator->trSequences()),
3378 FmhlInfo("globals_dict",theTranslator->trDictionaries()),
3379 FmhlInfo("globals_enum",theTranslator->trEnumerations()),
3380 FmhlInfo("globals_eval",theTranslator->trEnumerationValues()),
3381 FmhlInfo("globals_defs",theTranslator->trDefines())
3382 };
3383 return &fmhlInfo[hl];
3384}
3385
3387{
3388 const auto &index = Index::instance();
3389 if (index.numDocumentedFileMembers(hl)==0) return;
3390
3391 bool disableIndex = Config_getBool(DISABLE_INDEX);
3392 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
3393 bool fullSidebar = Config_getBool(FULL_SIDEBAR);
3394 bool dynamicMenus = Config_getBool(HTML_DYNAMIC_MENUS);
3395 bool quickLinksAfterSplitbar = !disableIndex && generateTreeView && fullSidebar;
3396
3397 bool multiPageIndex=false;
3398 if (Index::instance().numDocumentedFileMembers(hl)>MAX_ITEMS_BEFORE_MULTIPAGE_INDEX)
3399 {
3400 multiPageIndex=true;
3401 }
3402
3403 ol.pushGeneratorState();
3405
3407 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::FileGlobals);
3408 DString title = lne ? lne->title() : theTranslator->trFileMembers();
3409 bool addToIndex = lne==nullptr || lne->visible();
3410
3411 if (addToIndex)
3412 {
3413 Doxygen::indexList->addContentsItem(multiPageIndex,getFmhlInfo(hl)->title,DString(),
3414 getFmhlInfo(hl)->fname,DString(),multiPageIndex,true);
3415 if (multiPageIndex) Doxygen::indexList->incContentsDepth();
3416 }
3417
3418 bool first=true;
3419 for (const auto &[letter,list] : index.isFileIndexLetterUsed(hl))
3420 {
3421 DString fileName = getFmhlInfo(hl)->fname;
3422 if (multiPageIndex)
3423 {
3424 DString cs(letter);
3425 if (!first)
3426 {
3427 fileName+="_"+letterToLabel(cs);
3428 }
3429 if (addToIndex)
3430 {
3431 Doxygen::indexList->addContentsItem(false,cs,DString(),fileName,DString(),false,true);
3432 }
3433 }
3434
3435 bool quickIndex = index.numDocumentedFileMembers(hl)>maxItemsBeforeQuickIndex;
3436
3437 auto writeQuickLinks = [&,cap_letter=letter]()
3438 {
3440 if (!dynamicMenus)
3441 {
3443
3444 // index item for all file member lists
3449
3450 // index items for per category member lists
3451 for (int i=1;i<FileMemberHighlight::Total;i++)
3452 {
3453 if (Index::instance().numDocumentedFileMembers(static_cast<FileMemberHighlight::Enum>(i))>0)
3454 {
3456 getFmhlInfo(i)->fname+Doxygen::htmlFileExtension,hl==i,true,first);
3459 }
3460 }
3461
3463
3464 if (quickIndex)
3465 {
3466 writeQuickMemberIndex(ol,index.isFileIndexLetterUsed(hl),cap_letter,
3467 getFmhlInfo(hl)->fname,multiPageIndex);
3468 }
3469
3470 ol.writeString("</div><!-- main-nav -->\n");
3471 }
3472 };
3473
3474 ol.startFile(fileName+extension,false,DString(),title);
3475 ol.startQuickIndices();
3476 if (!disableIndex && !quickLinksAfterSplitbar)
3477 {
3478 writeQuickLinks();
3479 }
3480 ol.endQuickIndices();
3481 ol.writeSplitBar(fileName,DString());
3482 if (quickLinksAfterSplitbar)
3483 {
3484 writeQuickLinks();
3485 if (!dynamicMenus)
3486 {
3487 ol.writeString("<div id=\"container\">\n");
3488 ol.writeString("<div id=\"doc-content\">\n");
3490 }
3491 ol.writeSearchInfo();
3492
3493 ol.startContents();
3494
3495 ol.startTextBlock();
3497 ol.endTextBlock();
3498 if (dynamicMenus || disableIndex)
3499 {
3500 writeMemberIndex(ol,index.isFileIndexLetterUsed(hl),getFmhlInfo(hl)->fname,multiPageIndex);
3501 }
3502
3503 writeMemberList(ol,quickIndex,
3504 multiPageIndex ? letter : std::string(),
3505 index.isFileIndexLetterUsed(hl),
3507 endFile(ol);
3508 first=false;
3509 }
3510 if (multiPageIndex && addToIndex) Doxygen::indexList->decContentsDepth();
3511 ol.popGeneratorState();
3512}
3513
3514static void writeFileMemberIndex(OutputList &ol)
3515{
3516 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::FileGlobals);
3517 bool addToIndex = lne==nullptr || lne->visible();
3518 if (Index::instance().numDocumentedFileMembers(FileMemberHighlight::All)>0 && addToIndex)
3522 }
3532 if (Index::instance().numDocumentedFileMembers(FileMemberHighlight::All)>0 && addToIndex)
3533 {
3535 }
3536
3537}
3538
3539//----------------------------------------------------------------------------
3540
3541/** Helper class representing a namespace member in the navigation menu. */
3542struct NmhlInfo
3543{
3544 NmhlInfo(const char *fn,const DString &t) : fname(fn), title(t) {}
3545 const char *fname;
3546 DString title;
3547};
3549static const NmhlInfo *getNmhlInfo(size_t hl)
3550{
3551 bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
3552 bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
3553 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
3554 static NmhlInfo nmhlInfo[] =
3555 {
3556 NmhlInfo("namespacemembers", theTranslator->trAll()),
3557 NmhlInfo("namespacemembers_func",
3558 fortranOpt ? theTranslator->trSubprograms() :
3559 vhdlOpt ? theTranslator->trFunctionAndProc() :
3561 NmhlInfo("namespacemembers_vars",sliceOpt ? theTranslator->trConstants() : theTranslator->trVariables()),
3562 NmhlInfo("namespacemembers_type",theTranslator->trTypedefs()),
3563 NmhlInfo("namespacemembers_sequ",theTranslator->trSequences()),
3564 NmhlInfo("namespacemembers_dict",theTranslator->trDictionaries()),
3565 NmhlInfo("namespacemembers_enum",theTranslator->trEnumerations()),
3566 NmhlInfo("namespacemembers_eval",theTranslator->trEnumerationValues())
3567 };
3568 return &nmhlInfo[hl];
3569}
3570
3571//----------------------------------------------------------------------------
3572
3575{
3576 const auto &index = Index::instance();
3577 if (index.numDocumentedNamespaceMembers(hl)==0) return;
3578
3579 bool disableIndex = Config_getBool(DISABLE_INDEX);
3580 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
3581 bool fullSidebar = Config_getBool(FULL_SIDEBAR);
3582 bool dynamicMenus = Config_getBool(HTML_DYNAMIC_MENUS);
3583 bool quickLinksAfterSplitbar = !disableIndex && generateTreeView && fullSidebar;
3584
3585 bool multiPageIndex=false;
3586 if (index.numDocumentedNamespaceMembers(hl)>MAX_ITEMS_BEFORE_MULTIPAGE_INDEX)
3587 {
3588 multiPageIndex=true;
3589 }
3590
3591 ol.pushGeneratorState();
3593
3595 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::NamespaceMembers);
3596 DString title = lne ? lne->title() : theTranslator->trNamespaceMembers();
3597 bool addToIndex = lne==nullptr || lne->visible();
3598
3599 if (addToIndex)
3600 {
3601 Doxygen::indexList->addContentsItem(multiPageIndex,getNmhlInfo(hl)->title,DString(),
3602 getNmhlInfo(hl)->fname,DString(),multiPageIndex,true);
3603 if (multiPageIndex) Doxygen::indexList->incContentsDepth();
3604 }
3605
3606 bool first=true;
3607 for (const auto &[letter,list] : index.isNamespaceIndexLetterUsed(hl))
3608 {
3609 DString fileName = getNmhlInfo(hl)->fname;
3610 if (multiPageIndex)
3611 {
3612 DString cs(letter);
3613 if (!first)
3614 {
3615 fileName+="_"+letterToLabel(cs);
3616 }
3617 if (addToIndex)
3618 {
3619 Doxygen::indexList->addContentsItem(false,cs,DString(),fileName,DString(),false,true);
3620 }
3621 }
3622
3623 bool quickIndex = index.numDocumentedNamespaceMembers(hl)>maxItemsBeforeQuickIndex;
3624
3625 auto writeQuickLinks = [&,cap_letter=letter]()
3626 {
3628 if (!dynamicMenus)
3629 {
3631
3632 // index item for all namespace member lists
3637
3638 // index items per category member lists
3639 for (int i=1;i<NamespaceMemberHighlight::Total;i++)
3640 {
3641 if (index.numDocumentedNamespaceMembers(static_cast<NamespaceMemberHighlight::Enum>(i))>0)
3642 {
3644 getNmhlInfo(i)->fname+Doxygen::htmlFileExtension,hl==i,true,first);
3647 }
3648 }
3649
3651
3652 if (quickIndex)
3653 {
3654 writeQuickMemberIndex(ol,index.isNamespaceIndexLetterUsed(hl),cap_letter,
3655 getNmhlInfo(hl)->fname,multiPageIndex);
3656 }
3657
3658 ol.writeString("</div><!-- main-nav -->\n");
3659 }
3660 };
3661
3662 ol.startFile(fileName+extension,false,DString(),title);
3663 ol.startQuickIndices();
3664 if (!disableIndex && !quickLinksAfterSplitbar)
3665 {
3666 writeQuickLinks();
3667 }
3668 ol.endQuickIndices();
3669 ol.writeSplitBar(fileName,DString());
3670 if (quickLinksAfterSplitbar)
3671 {
3672 writeQuickLinks();
3673 if (!dynamicMenus)
3674 {
3675 ol.writeString("<div id=\"container\">\n");
3676 ol.writeString("<div id=\"doc-content\">\n");
3677 }
3678 }
3679 ol.writeSearchInfo();
3680
3681 ol.startContents();
3682
3683 ol.startTextBlock();
3685 ol.endTextBlock();
3686
3687 writeMemberList(ol,quickIndex,
3688 multiPageIndex ? letter : std::string(),
3689 index.isNamespaceIndexLetterUsed(hl),
3691 endFile(ol);
3692 first=false;
3693 }
3694 if (multiPageIndex && addToIndex) Doxygen::indexList->decContentsDepth();
3695 ol.popGeneratorState();
3696}
3697
3699{
3700 const auto &index = Index::instance();
3701 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::NamespaceMembers);
3702 bool addToIndex = lne==nullptr || lne->visible();
3703 if (index.numDocumentedNamespaceMembers(NamespaceMemberHighlight::All)>0 && addToIndex)
3707 }
3708 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
3722}
3723
3724//----------------------------------------------------------------------------
3726/** Helper class representing a module member in the navigation menu. */
3727struct MmhlInfo
3728{
3729 MmhlInfo(const char *fn,const DString &t) : fname(fn), title(t) {}
3730 const char *fname;
3731 DString title;
3732};
3733
3734static const MmhlInfo *getMmhlInfo(size_t hl)
3735{
3736 static MmhlInfo nmhlInfo[] =
3737 {
3738 MmhlInfo("modulemembers", theTranslator->trAll()),
3739 MmhlInfo("modulemembers_func",theTranslator->trFunctions()),
3740 MmhlInfo("modulemembers_vars",theTranslator->trVariables()),
3741 MmhlInfo("modulemembers_type",theTranslator->trTypedefs()),
3742 MmhlInfo("modulemembers_enum",theTranslator->trEnumerations()),
3743 MmhlInfo("modulemembers_eval",theTranslator->trEnumerationValues())
3744 };
3745 return &nmhlInfo[hl];
3746}
3747
3748//----------------------------------------------------------------------------
3749
3752{
3753 const auto &index = Index::instance();
3754 if (index.numDocumentedModuleMembers(hl)==0) return;
3755
3756 bool disableIndex = Config_getBool(DISABLE_INDEX);
3757 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
3758 bool fullSidebar = Config_getBool(FULL_SIDEBAR);
3759 bool dynamicMenus = Config_getBool(HTML_DYNAMIC_MENUS);
3760 bool quickLinksAfterSplitbar = !disableIndex && generateTreeView && fullSidebar;
3761
3762 bool multiPageIndex=false;
3763 if (index.numDocumentedModuleMembers(hl)>MAX_ITEMS_BEFORE_MULTIPAGE_INDEX)
3764 {
3765 multiPageIndex=true;
3766 }
3767
3768 ol.pushGeneratorState();
3770
3772 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ModuleMembers);
3773 DString title = lne ? lne->title() : theTranslator->trModulesMembers();
3774 bool addToIndex = lne==nullptr || lne->visible();
3775
3776 if (addToIndex)
3777 {
3778 Doxygen::indexList->addContentsItem(multiPageIndex,getMmhlInfo(hl)->title,DString(),
3779 getMmhlInfo(hl)->fname,DString(),multiPageIndex,true);
3780 if (multiPageIndex) Doxygen::indexList->incContentsDepth();
3781 }
3782
3783 bool first=true;
3784 for (const auto &[letter,list] : index.isModuleIndexLetterUsed(hl))
3785 {
3786 DString fileName = getMmhlInfo(hl)->fname;
3787 if (multiPageIndex)
3788 {
3789 DString cs(letter);
3790 if (!first)
3791 {
3792 fileName+="_"+letterToLabel(cs);
3793 }
3794 if (addToIndex)
3795 {
3796 Doxygen::indexList->addContentsItem(false,cs,DString(),fileName,DString(),false,true);
3797 }
3798 }
3799
3800 bool quickIndex = index.numDocumentedModuleMembers(hl)>maxItemsBeforeQuickIndex;
3801
3802 auto writeQuickLinks = [&,cap_letter=letter]()
3803 {
3805 if (!dynamicMenus)
3806 {
3808
3809 // index item for all namespace member lists
3814
3815 // index items per category member lists
3816 for (int i=1;i<ModuleMemberHighlight::Total;i++)
3817 {
3818 if (index.numDocumentedModuleMembers(static_cast<ModuleMemberHighlight::Enum>(i))>0)
3819 {
3821 getMmhlInfo(i)->fname+Doxygen::htmlFileExtension,hl==i,true,first);
3824 }
3825 }
3826
3828
3829 if (quickIndex)
3830 {
3831 writeQuickMemberIndex(ol,index.isModuleIndexLetterUsed(hl),cap_letter,
3832 getMmhlInfo(hl)->fname,multiPageIndex);
3833 }
3834
3835 ol.writeString("</div><!-- main-nav -->\n");
3836 }
3837 };
3838
3839 ol.startFile(fileName+extension,false,DString(),title);
3840 ol.startQuickIndices();
3841 if (!disableIndex && !quickLinksAfterSplitbar)
3842 {
3843 writeQuickLinks();
3844 }
3845 ol.endQuickIndices();
3846 ol.writeSplitBar(fileName,DString());
3847 if (quickLinksAfterSplitbar)
3848 {
3849 writeQuickLinks();
3850 if (!dynamicMenus)
3851 {
3852 ol.writeString("<div id=\"container\">\n");
3853 ol.writeString("<div id=\"doc-content\">\n");
3854 }
3855 }
3856 ol.writeSearchInfo();
3858 ol.startContents();
3859
3860 ol.startTextBlock();
3862 ol.endTextBlock();
3863 if (dynamicMenus || disableIndex)
3864 {
3865 writeMemberIndex(ol,index.isModuleIndexLetterUsed(hl),getMmhlInfo(hl)->fname,multiPageIndex);
3866 }
3867
3868 writeMemberList(ol,quickIndex,
3869 multiPageIndex ? letter : std::string(),
3870 index.isModuleIndexLetterUsed(hl),
3872 endFile(ol);
3873 first=false;
3874 }
3875 if (multiPageIndex && addToIndex) Doxygen::indexList->decContentsDepth();
3876 ol.popGeneratorState();
3877}
3878
3879
3880//----------------------------------------------------------------------------
3881
3883{
3884 const auto &index = Index::instance();
3885 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ModuleMembers);
3886 bool addToIndex = lne==nullptr || lne->visible();
3887 if (index.numDocumentedModuleMembers(ModuleMemberHighlight::All)>0 && addToIndex)
3888 {
3889 Doxygen::indexList->addContentsItem(true,lne ? lne->title() : theTranslator->trModulesMembers(),DString(),"modulemembers",DString());
3891 }
3892 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
3899 if (index.numDocumentedModuleMembers(ModuleMemberHighlight::All)>0 && addToIndex)
3900 {
3902 }
3903}
3904
3905//----------------------------------------------------------------------------
3906
3907static void writeExampleIndex(OutputList &ol)
3908{
3909 if (Doxygen::exampleLinkedMap->empty()) return;
3910 ol.pushGeneratorState();
3913 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Examples);
3914 DString title = lne ? lne->title() : theTranslator->trExamples();
3915 bool addToIndex = lne==nullptr || lne->visible();
3916
3917 startFile(ol,"examples",false,DString(),title,HighlightedItem::Examples);
3918
3919 startTitle(ol,DString());
3920 ol.parseText(title);
3921 endTitle(ol,DString(),DString());
3922
3923 ol.startContents();
3924
3925 if (addToIndex)
3926 {
3927 Doxygen::indexList->addContentsItem(true,title,DString(),"examples",DString(),true,true);
3929 }
3930
3931 ol.startTextBlock();
3932 ol.parseText(lne ? lne->intro() : theTranslator->trExamplesDescription());
3933 ol.endTextBlock();
3934
3935 ol.startItemList();
3936 for (const auto &pd : *Doxygen::exampleLinkedMap)
3937 {
3938 ol.startItemListItem();
3939 DString n=pd->getOutputFileBase();
3940 if (!pd->title().empty())
3941 {
3942 ol.writeObjectLink(DString(),n,DString(),pd->title());
3943 if (addToIndex)
3944 {
3945 Doxygen::indexList->addContentsItem(false,filterTitle(pd->title()),pd->getReference(),n,DString(),false,true);
3946 }
3948 else
3949 {
3950 ol.writeObjectLink(DString(),n,DString(),pd->name());
3951 if (addToIndex)
3952 {
3953 Doxygen::indexList->addContentsItem(false,pd->name(),pd->getReference(),n,DString(),false,true);
3954 }
3955 }
3956 ol.endItemListItem();
3957 //ol.writeString("\n");
3958 }
3959 ol.endItemList();
3960
3961 if (addToIndex)
3962 {
3964 }
3966 ol.popGeneratorState();
3967}
3968
3969
3970//----------------------------------------------------------------------------
3971
3972static void countRelatedPages(int &docPages,int &indexPages)
3973{
3974 docPages=indexPages=0;
3975 for (const auto &pd : *Doxygen::pageLinkedMap)
3976 {
3977 if (pd->visibleInIndex() && !pd->hasParentPage())
3978 {
3979 indexPages++;
3980 }
3981 if (pd->documentedPage())
3982 {
3983 docPages++;
3984 }
3985 }
3986}
3987
3988//----------------------------------------------------------------------------
3989
3990static void writePages(PageDef *pd,FTVHelp *ftv,bool reuseRoot = false)
3991{
3992 //printf("writePages()=%s pd=%p mainpage=%p\n",qPrint(pd->name()),(void*)pd,(void*)Doxygen::mainPage.get());
3993 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Pages);
3994 bool addToIndex = lne==nullptr || lne->visible();
3995 if (!addToIndex) return;
3996
3997 bool hasSubPages = pd->hasSubPages();
3998 bool hasSections = pd->hasSections();
3999
4000 if (pd->visibleInIndex())
4001 {
4002 DString pageTitle, pageTitleAsHtml;
4003
4004 if (pd->title().empty())
4005 pageTitle=pd->name();
4006 else
4007 pageTitle = parseCommentAsText(pd,nullptr,pd->title(),pd->getDefFileName(),pd->getDefLine());
4008 pageTitleAsHtml = parseCommentAsHtml(pd,nullptr,pd->title(),pd->getDefFileName(),pd->getDefLine());
4009
4010 if (ftv)
4011 {
4012 //printf("*** adding %s hasSubPages=%d hasSections=%d\n",qPrint(pageTitle),hasSubPages,hasSections);
4013 ftv->addContentsItem(
4014 hasSubPages,pageTitle,
4015 pd->getReference(),pd->getOutputFileBase(),
4016 DString(),hasSubPages,true,pd,pageTitleAsHtml);
4017 }
4018 if (addToIndex && pd!=Doxygen::mainPage.get())
4019 {
4021 hasSubPages || hasSections,pageTitle,
4022 pd->getReference(),pd->getOutputFileBase(),
4023 DString(),hasSubPages,true,pd,pageTitleAsHtml);
4024 }
4026 if (hasSubPages && ftv) ftv->incContentsDepth();
4027 bool doIndent = (hasSections || hasSubPages) && !reuseRoot;
4028 if (doIndent)
4029 {
4031 }
4032 if (hasSections)
4033 {
4034 pd->addSectionsToIndex();
4035 }
4036 for (const auto &subPage : pd->getSubPages())
4037 {
4038 writePages(subPage,ftv);
4039 }
4040 if (hasSubPages && ftv) ftv->decContentsDepth();
4041 if (doIndent)
4042 {
4044 }
4045 //printf("end writePages()=%s\n",qPrint(pd->title()));
4046}
4047
4048//----------------------------------------------------------------------------
4049
4050static void writePageIndex(OutputList &ol)
4051{
4052 if (Index::instance().numIndexedPages()==0) return;
4053 ol.pushGeneratorState();
4055 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Pages);
4056 DString title = lne ? lne->title() : theTranslator->trRelatedPages();
4057 startFile(ol,"pages",false,DString(),title,HighlightedItem::Pages);
4058 startTitle(ol,DString());
4059 ol.parseText(title);
4060 endTitle(ol,DString(),DString());
4061 ol.startContents();
4062 ol.startTextBlock();
4064 ol.endTextBlock();
4065
4066 {
4067 FTVHelp ftv(false);
4068 for (const auto &pd : *Doxygen::pageLinkedMap)
4069 {
4070 if ((pd->getOuterScope()==nullptr ||
4071 pd->getOuterScope()->definitionType()!=Definition::TypePage) && // not a sub page
4072 pd->visibleInIndex()
4073 )
4074 {
4075 writePages(pd.get(),&ftv);
4076 }
4077 }
4078 TextStream t;
4080 ol.writeString(t.str());
4081 }
4082
4083// ol.popGeneratorState();
4084 // ------
4085
4086 endFile(ol);
4087 ol.popGeneratorState();
4088}
4089
4090//----------------------------------------------------------------------------
4091
4092static int countGroups()
4093{
4094 int count=0;
4095 for (const auto &gd : *Doxygen::groupLinkedMap)
4096 {
4097 if (!gd->isReference())
4098 {
4099 //gd->visited=false;
4100 count++;
4101 }
4102 }
4103 return count;
4104}
4105
4106//----------------------------------------------------------------------------
4107
4108static int countDirs()
4109{
4110 int count=0;
4111 for (const auto &dd : *Doxygen::dirLinkedMap)
4112 {
4113 if (dd->isLinkableInProject())
4114 {
4115 count++;
4116 }
4117 }
4118 return count;
4119}
4120
4121
4122//----------------------------------------------------------------------------
4123
4124void writeGraphInfo(OutputList &ol)
4125{
4126 if (!Config_getBool(HAVE_DOT) || !Config_getBool(GENERATE_HTML)) return;
4127 ol.pushGeneratorState();
4129
4130 DotLegendGraph gd;
4131 gd.writeGraph(Config_getString(HTML_OUTPUT));
4132
4133 bool oldStripCommentsState = Config_getBool(STRIP_CODE_COMMENTS);
4134 bool oldCreateSubdirs = Config_getBool(CREATE_SUBDIRS);
4135 // temporarily disable the stripping of comments for our own code example!
4136 Config_updateBool(STRIP_CODE_COMMENTS,false);
4137 // temporarily disable create subdirs for linking to our example
4138 Config_updateBool(CREATE_SUBDIRS,false);
4139
4140 startFile(ol,"graph_legend",false,DString(),theTranslator->trLegendTitle());
4141 startTitle(ol,DString());
4143 endTitle(ol,DString(),DString());
4144 ol.startContents();
4145 DString legendDocs = theTranslator->trLegendDocs();
4146 size_t s = legendDocs.find("<center>");
4147 size_t e = legendDocs.find("</center>");
4148 DString imgExt = getDotImageExtension();
4149 if (imgExt=="svg" && s!=DString::npos && e!=DString::npos)
4150 {
4151 legendDocs = legendDocs.left(s+8) + "[!-- SVG 0 --]" + legendDocs.mid(e);
4152 //printf("legendDocs=%s\n",qPrint(legendDocs));
4153 }
4154
4155 {
4156 auto fd = createFileDef("","graph_legend.dox");
4157 ol.generateDoc("graph_legend",1,fd.get(),nullptr,legendDocs,DocOptions());
4158 }
4159
4160 // restore config settings
4161 Config_updateBool(STRIP_CODE_COMMENTS,oldStripCommentsState);
4162 Config_updateBool(CREATE_SUBDIRS,oldCreateSubdirs);
4163
4164 endFile(ol);
4165 ol.popGeneratorState();
4166}
4167
4168
4169
4170//----------------------------------------------------------------------------
4171/*!
4172 * write groups as hierarchical trees
4173 */
4174static void writeGroupTreeNode(OutputList &ol, const GroupDef *gd, int level, FTVHelp* ftv, bool addToIndex)
4175{
4176 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
4177 //bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
4178 if (level>20)
4179 {
4180 warn(gd->getDefFileName(),gd->getDefLine(),
4181 "maximum nesting level exceeded for group {}: check for possible recursive group relation!",gd->name());
4182 return;
4183 }
4184
4185 /* Some groups should appear twice under different parent-groups.
4186 * That is why we should not check if it was visited
4187 */
4188 if ((!gd->isASubGroup() || level>0) && gd->isVisible() && gd->isVisibleInHierarchy())
4189 {
4190 //printf("gd->name()=%s #members=%d\n",qPrint(gd->name()),gd->countMembers());
4191 // write group info
4192 bool hasSubGroups = !gd->getSubGroups().empty();
4193 bool hasSubPages = !gd->getPages().empty();
4194 size_t numSubItems = 0;
4195 for (const auto &ml : gd->getMemberLists())
4196 {
4197 if (ml->listType().isDocumentation())
4198 {
4199 numSubItems += ml->size();
4200 }
4201 }
4202 numSubItems += gd->getNamespaces().size();
4203 numSubItems += gd->getClasses().size();
4204 numSubItems += gd->getFiles().size();
4205 numSubItems += gd->getConcepts().size();
4206 numSubItems += gd->getDirs().size();
4207 numSubItems += gd->getPages().size();
4208
4209 bool isDir = hasSubGroups || hasSubPages || numSubItems>0;
4210 DString title = parseCommentAsText(gd,nullptr,gd->groupTitle(),gd->getDefFileName(),gd->getDefLine());
4211 DString titleAsHtml = parseCommentAsHtml(gd,nullptr,gd->groupTitle(),gd->getDefFileName(),gd->getDefLine());
4212
4213 //printf("gd='%s': pageDict=%d\n",qPrint(gd->name()),gd->pageDict->count());
4214 if (addToIndex)
4215 {
4218 isDir,true,nullptr,titleAsHtml);
4220 }
4221 if (ftv)
4222 {
4223 ftv->addContentsItem(hasSubGroups,title,
4225 false,false,gd,titleAsHtml);
4226 ftv->incContentsDepth();
4227 }
4228
4229 ol.startIndexListItem();
4231 ol.generateDoc(gd->getDefFileName(),
4232 gd->getDefLine(),
4233 gd,
4234 nullptr,
4235 gd->groupTitle(),
4236 DocOptions()
4237 .setSingleLine(true)
4238 .setAutolinkSupport(false));
4240
4241 if (gd->isReference())
4242 {
4243 ol.startTypewriter();
4244 ol.docify(" [external]");
4245 ol.endTypewriter();
4246 }
4247
4248 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Group))
4249 {
4250 if (lde->kind()==LayoutDocEntry::MemberDef && addToIndex)
4251 {
4252 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
4253 if (lmd)
4254 {
4255 MemberList *ml = gd->getMemberList(lmd->type);
4256 if (ml)
4257 {
4258 for (const auto &md : *ml)
4259 {
4260 const MemberVector &enumList = md->enumFieldList();
4261 isDir = !enumList.empty() && md->isEnumerate();
4262 if (md->isVisible() && !md->isAnonymous())
4263 {
4265 md->qualifiedName(),md->getReference(),
4266 md->getOutputFileBase(),md->anchor(),false,addToIndex);
4267 }
4268 if (isDir)
4269 {
4271 for (const auto &emd : enumList)
4272 {
4273 if (emd->isVisible())
4274 {
4276 emd->qualifiedName(),emd->getReference(),emd->getOutputFileBase(),
4277 emd->anchor(),false,addToIndex);
4278 }
4279 }
4281 }
4282 }
4283 }
4284 }
4285 }
4286 else if (lde->kind()==LayoutDocEntry::GroupClasses && addToIndex)
4287 {
4288 for (const auto &cd : gd->getClasses())
4289 {
4290 //bool nestedClassInSameGroup =
4291 // cd->getOuterScope() && cd->getOuterScope()->definitionType()==Definition::TypeClass &&
4292 // cd->getOuterScope()->partOfGroups().empty() && cd->getOuterScope()->partOfGroups()->contains(gd);
4293 //printf("===== GroupClasses: %s visible=%d nestedClassInSameGroup=%d\n",qPrint(cd->name()),cd->isVisible(),nestedClassInSameGroup);
4294 if (cd->isVisible() /*&& !nestedClassInSameGroup*/)
4295 {
4297 LayoutDocManager::Class,
4298 cd->displayName(),
4299 cd->anchor(),
4300 addToIndex,
4301 true);
4302 }
4303 }
4304 }
4305 else if (lde->kind()==LayoutDocEntry::GroupNamespaces && addToIndex && Config_getBool(SHOW_NAMESPACES))
4306 {
4307 for (const auto &nd : gd->getNamespaces())
4308 {
4309 if (nd->isVisible())
4310 {
4312 nd->displayName(),nd->getReference(),
4313 nd->getOutputFileBase(),DString(),false,Config_getBool(SHOW_NAMESPACES));
4314 }
4315 }
4316 }
4317 else if (lde->kind()==LayoutDocEntry::GroupConcepts && addToIndex)
4318 {
4319 for (const auto &cd : gd->getConcepts())
4320 {
4321 if (cd->isVisible())
4322 {
4324 cd->displayName(),cd->getReference(),
4325 cd->getOutputFileBase(),DString(),false,addToIndex);
4326 }
4327 }
4328 }
4329 else if (lde->kind()==LayoutDocEntry::GroupFiles && addToIndex)
4330 {
4331 for (const auto &fd : gd->getFiles())
4332 {
4333 if (fd->isVisible())
4334 {
4336 fd->displayName(),fd->getReference(),
4337 fd->getOutputFileBase(),DString(),false,fd->isLinkableViaGroup());
4338 }
4339 }
4340 }
4341 else if (lde->kind()==LayoutDocEntry::GroupDirs && addToIndex)
4342 {
4343 for (const auto &dd : gd->getDirs())
4344 {
4345 if (dd->isVisible())
4346 {
4348 dd->shortName(),dd->getReference(),
4349 dd->getOutputFileBase(),DString(),false,false);
4350 }
4351 }
4352 }
4353 else if (lde->kind()==LayoutDocEntry::GroupPageDocs && addToIndex)
4354 {
4355 for (const auto &pd : gd->getPages())
4356 {
4357 const SectionInfo *si=nullptr;
4358 if (!pd->name().empty()) si=SectionManager::instance().find(pd->name());
4359 hasSubPages = pd->hasSubPages();
4360 bool hasSections = pd->hasSections();
4361 DString pageTitle;
4362 if (pd->title().empty())
4363 pageTitle=pd->name();
4364 else
4365 pageTitle = parseCommentAsText(pd,nullptr,pd->title(),pd->getDefFileName(),pd->getDefLine());
4366 DString pageTitleAsHtml = parseCommentAsHtml(pd,nullptr,pd->title(),pd->getDefFileName(),pd->getDefLine());
4368 hasSubPages || hasSections,
4369 pageTitle,
4370 gd->getReference(),
4371 gd->getOutputFileBase(),
4372 si ? si->label() : DString(),
4373 hasSubPages || hasSections,
4374 true,
4375 nullptr,
4376 pageTitleAsHtml); // addToNavIndex
4377 if (hasSections || hasSubPages)
4378 {
4380 }
4381 if (hasSections)
4382 {
4383 pd->addSectionsToIndex();
4384 }
4385 writePages(pd,nullptr);
4386 if (hasSections || hasSubPages)
4387 {
4389 }
4390 }
4391 }
4392 else if (lde->kind()==LayoutDocEntry::GroupNestedGroups)
4393 {
4394 if (!gd->getSubGroups().empty())
4396 startIndexHierarchy(ol,level+1);
4397 for (const auto &subgd : gd->getSubGroups())
4398 {
4399 writeGroupTreeNode(ol,subgd,level+1,ftv,addToIndex);
4400 }
4401 endIndexHierarchy(ol,level+1);
4402 }
4403 }
4404 }
4405
4406 ol.endIndexListItem();
4407
4408 if (addToIndex)
4409 {
4411 }
4412 if (ftv)
4413 {
4414 ftv->decContentsDepth();
4415 }
4416 //gd->visited=true;
4417 }
4418}
4420static void writeGroupHierarchy(OutputList &ol, FTVHelp* ftv,bool addToIndex)
4421{
4422 if (ftv)
4423 {
4424 ol.pushGeneratorState();
4426 }
4427 startIndexHierarchy(ol,0);
4428 for (const auto &gd : *Doxygen::groupLinkedMap)
4429 {
4430 if (gd->isVisibleInHierarchy())
4431 {
4432 writeGroupTreeNode(ol,gd.get(),0,ftv,addToIndex);
4433 }
4434 }
4435 endIndexHierarchy(ol,0);
4436 if (ftv)
4437 {
4438 ol.popGeneratorState();
4439 }
4440}
4441
4442//----------------------------------------------------------------------------
4443
4444static void writeTopicIndex(OutputList &ol)
4445{
4446 if (Index::instance().numDocumentedGroups()==0) return;
4447 ol.pushGeneratorState();
4448 // 1.{
4451 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Topics);
4452 DString title = lne ? lne->title() : theTranslator->trTopics();
4453 bool addToIndex = lne==nullptr || lne->visible();
4454
4455 startFile(ol,"topics",false,DString(),title,HighlightedItem::Topics);
4456 startTitle(ol,DString());
4457 ol.parseText(title);
4458 endTitle(ol,DString(),DString());
4459 ol.startContents();
4460 ol.startTextBlock();
4462 ol.endTextBlock();
4463
4464 // ---------------
4465 // Normal group index for Latex/RTF
4466 // ---------------
4467 // 2.{
4468 ol.pushGeneratorState();
4471
4472 writeGroupHierarchy(ol,nullptr,false);
4473
4475 ol.popGeneratorState();
4476 // 2.}
4477
4478 // ---------------
4479 // interactive group index for HTML
4480 // ---------------
4481 // 2.{
4482 ol.pushGeneratorState();
4484
4485 {
4486 if (addToIndex)
4487 {
4488 Doxygen::indexList->addContentsItem(true,title,DString(),"topics",DString(),true,true);
4490 }
4491 FTVHelp ftv(false);
4492 writeGroupHierarchy(ol,&ftv,addToIndex);
4493 TextStream t;
4496 ol.writeString(t.str());
4497 if (addToIndex)
4498 {
4500 }
4501 }
4502 ol.popGeneratorState();
4503 // 2.}
4504
4505 endFile(ol);
4506 ol.popGeneratorState();
4507 // 1.}
4508}
4509
4510
4511//----------------------------------------------------------------------------
4512
4513static void writeModuleTreeNode(OutputList &ol, const ModuleDef *mod,
4514 FTVHelp* ftv, bool addToIndex)
4515{
4516 int visibleMembers = mod->countVisibleMembers();
4517 bool isDir=visibleMembers>0;
4518 if (addToIndex)
4519 {
4521 mod->getReference(),mod->getOutputFileBase(),DString(),isDir,true);
4522 }
4523 if (ftv)
4524 {
4525 ftv->addContentsItem(false,mod->name(),
4526 mod->getReference(),mod->getOutputFileBase(),DString(),
4527 false,false,mod);
4528 }
4529 ol.startIndexListItem();
4531 ol.generateDoc(mod->getDefFileName(),
4532 mod->getDefLine(),
4533 mod,
4534 nullptr,
4535 mod->qualifiedName(),
4536 DocOptions()
4537 .setSingleLine(true)
4538 .setAutolinkSupport(false));
4540 if (mod->isReference())
4541 {
4543 ol.docify(" [external]");
4544 ol.endTypewriter();
4545 }
4546 if (addToIndex && isDir)
4547 {
4549 }
4550 if (isDir)
4551 {
4552 //ftv->incContentsDepth();
4553 writeClassTree(mod->getClasses(),nullptr,addToIndex,false,ClassDef::Class);
4554 writeConceptList(mod->getConcepts(),nullptr,addToIndex);
4555 writeModuleMembers(mod,addToIndex);
4556 //ftv->decContentsDepth();
4557 }
4558 if (addToIndex && isDir)
4559 {
4561 }
4562 ol.endIndexListItem();
4563}
4564
4565//----------------------------------------------------------------------------
4567static void writeModuleList(OutputList &ol, FTVHelp *ftv,bool addToIndex)
4568{
4569 if (ftv)
4570 {
4571 ol.pushGeneratorState();
4573 }
4574 startIndexHierarchy(ol,0);
4575 for (const auto &mod : ModuleManager::instance().modules())
4576 {
4577 if (mod->isPrimaryInterface())
4578 {
4579 writeModuleTreeNode(ol,mod.get(),ftv,addToIndex);
4580 }
4581 }
4582 endIndexHierarchy(ol,0);
4583 if (ftv)
4584 {
4585 ol.popGeneratorState();
4586 }
4587}
4588
4589//----------------------------------------------------------------------------
4590
4591static void writeModuleIndex(OutputList &ol)
4592{
4593 if (ModuleManager::instance().numDocumentedModules()==0) return;
4594 ol.pushGeneratorState();
4595 // 1.{
4596
4599 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ModuleList);
4600 if (lne==nullptr) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Modules); // fall back
4601 DString title = lne ? lne->title() : theTranslator->trModules();
4602 bool addToIndex = lne==nullptr || lne->visible();
4603
4604 startFile(ol,"modules",false,DString(),title,HighlightedItem::Modules);
4605 startTitle(ol,DString());
4606 ol.parseText(title);
4607 endTitle(ol,DString(),DString());
4608 ol.startContents();
4609 ol.startTextBlock();
4610 ol.parseText(lne ? lne->intro() : theTranslator->trModulesListDescription(Config_getBool(EXTRACT_ALL)));
4611 ol.endTextBlock();
4612
4613 // ---------------
4614 // Normal group index for Latex/RTF
4615 // ---------------
4616 // 2.{
4617 ol.pushGeneratorState();
4620
4621 writeModuleList(ol,nullptr,false);
4622
4624 ol.popGeneratorState();
4625 // 2.}
4626
4627 // ---------------
4628 // interactive group index for HTML
4629 // ---------------
4630 // 2.{
4631 ol.pushGeneratorState();
4633
4635 if (addToIndex)
4636 {
4637 Doxygen::indexList->addContentsItem(true,title,DString(),"modules",DString(),true,true);
4639 }
4640 FTVHelp ftv(false);
4641 writeModuleList(ol,&ftv,addToIndex);
4642 TextStream t;
4644 ol.writeString(t.str());
4645 if (addToIndex)
4646 {
4648 }
4649 }
4650 ol.popGeneratorState();
4651 // 2.}
4652 endFile(ol);
4653 ol.popGeneratorState();
4654 // 1.}
4655}
4656
4657//----------------------------------------------------------------------------
4658
4659static void writeConceptList(const ConceptLinkedRefMap &concepts, FTVHelp *ftv,bool addToIndex)
4660{
4661 for (const auto &cd : concepts)
4662 {
4663 if (cd->isLinkableInProject())
4664 {
4665 if (ftv)
4666 {
4667 ftv->addContentsItem(false,cd->displayName(false),cd->getReference(),
4668 cd->getOutputFileBase(),DString(),false,cd->partOfGroups().empty(),cd);
4669 }
4670 if (addToIndex)
4671 {
4672 Doxygen::indexList->addContentsItem(false,cd->displayName(false),cd->getReference(),
4673 cd->getOutputFileBase(),DString(),false,cd->partOfGroups().empty());
4674 }
4675 }
4676 }
4677}
4678
4680 bool rootOnly, bool addToIndex);
4681
4682static void writeConceptTreeInsideNamespace(const NamespaceLinkedRefMap &nsLinkedMap,FTVHelp *ftv,
4683 bool rootOnly, bool addToIndex)
4684{
4685 for (const auto &nd : nsLinkedMap)
4686 {
4687 writeConceptTreeInsideNamespaceElement(nd,ftv,rootOnly,addToIndex);
4688 }
4689}
4690
4691
4693 bool rootOnly, bool addToIndex)
4694{
4695 if (!nd->isAnonymous() &&
4696 (!rootOnly || nd->getOuterScope()==Doxygen::globalScope))
4697 {
4698 bool isDir = namespaceHasNestedConcept(nd);
4699 bool isLinkable = nd->isLinkableInProject();
4700
4701 //printf("writeConceptTreeInsideNamespaceElement namespace %s isLinkable=%d isDir=%d\n",qPrint(nd->name()),isLinkable,isDir);
4702
4703 DString ref;
4704 DString file;
4705 if (isLinkable)
4706 {
4707 ref = nd->getReference();
4708 file = nd->getOutputFileBase();
4709 }
4710
4711 if (isDir)
4712 {
4713 ftv->addContentsItem(isDir,nd->localName(),ref,file,DString(),false,true,nd);
4714
4715 if (addToIndex)
4716 {
4717 // the namespace entry is already shown under the namespace list so don't
4718 // add it to the nav index and don't create a separate index file for it otherwise
4719 // it will overwrite the one written for the namespace list.
4720 Doxygen::indexList->addContentsItem(isDir,nd->localName(),ref,file,DString(),
4721 false, // separateIndex
4722 false // addToNavIndex
4723 );
4724 }
4725 if (addToIndex)
4726 {
4728 }
4729
4730 ftv->incContentsDepth();
4731 writeConceptTreeInsideNamespace(nd->getNamespaces(),ftv,false,addToIndex);
4732 writeConceptList(nd->getConcepts(),ftv,addToIndex);
4733 ftv->decContentsDepth();
4734
4735 if (addToIndex)
4736 {
4738 }
4739 }
4741}
4742
4743static void writeConceptRootList(FTVHelp *ftv,bool addToIndex)
4744{
4745 for (const auto &cd : *Doxygen::conceptLinkedMap)
4746 {
4747 if ((cd->getOuterScope()==nullptr ||
4748 cd->getOuterScope()==Doxygen::globalScope) && cd->isLinkableInProject()
4749 )
4750 {
4751 //printf("*** adding %s hasSubPages=%d hasSections=%d\n",qPrint(pageTitle),hasSubPages,hasSections);
4752 ftv->addContentsItem(
4753 false,cd->localName(),cd->getReference(),cd->getOutputFileBase(),
4754 DString(),false,cd->partOfGroups().empty(),cd.get());
4755 if (addToIndex)
4756 {
4758 false,cd->localName(),cd->getReference(),cd->getOutputFileBase(),
4759 DString(),false,cd->partOfGroups().empty(),cd.get());
4760 }
4761 }
4762 }
4763}
4764
4765static void writeConceptIndex(OutputList &ol)
4766{
4767 if (Index::instance().numDocumentedConcepts()==0) return;
4768 ol.pushGeneratorState();
4769 // 1.{
4772 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Concepts);
4773 DString title = lne ? lne->title() : theTranslator->trConceptList();
4774 bool addToIndex = lne==nullptr || lne->visible();
4775
4776 startFile(ol,"concepts",false,DString(),title,HighlightedItem::Concepts);
4777 startTitle(ol,DString());
4778 ol.parseText(title);
4779 endTitle(ol,DString(),DString());
4780 ol.startContents();
4781 ol.startTextBlock();
4782 ol.parseText(lne ? lne->intro() : theTranslator->trConceptListDescription(Config_getBool(EXTRACT_ALL)));
4783 ol.endTextBlock();
4784
4785 // ---------------
4786 // Normal group index for Latex/RTF
4787 // ---------------
4788 // 2.{
4789 ol.pushGeneratorState();
4791
4792 bool first=true;
4793 for (const auto &cd : *Doxygen::conceptLinkedMap)
4794 {
4795 if (cd->isLinkableInProject())
4796 {
4797 if (first)
4798 {
4799 ol.startIndexList();
4800 first=false;
4801 }
4802 //ol.writeStartAnnoItem("namespace",nd->getOutputFileBase(),0,nd->name());
4803 ol.startIndexKey();
4804 ol.writeObjectLink(DString(),cd->getOutputFileBase(),DString(),cd->displayName());
4805 ol.endIndexKey();
4806
4807 bool hasBrief = !cd->briefDescription().empty();
4808 ol.startIndexValue(hasBrief);
4809 if (hasBrief)
4810 {
4811 ol.generateDoc(cd->briefFile(),
4812 cd->briefLine(),
4813 cd.get(),
4814 nullptr,
4815 cd->briefDescription(true),
4816 DocOptions()
4817 .setSingleLine(true)
4818 .setLinkFromIndex(true));
4819 }
4820 ol.endIndexValue(cd->getOutputFileBase(),hasBrief);
4821
4822 }
4823 }
4824 if (!first) ol.endIndexList();
4825
4826 ol.popGeneratorState();
4827 // 2.}
4828
4829 // ---------------
4830 // interactive group index for HTML
4831 // ---------------
4832 // 2.{
4833 ol.pushGeneratorState();
4835
4836 {
4837 if (addToIndex)
4838 {
4839 Doxygen::indexList->addContentsItem(true,title,DString(),"concepts",DString(),true,true);
4842 FTVHelp ftv(false);
4843 for (const auto &nd : *Doxygen::namespaceLinkedMap)
4844 {
4845 writeConceptTreeInsideNamespaceElement(nd.get(),&ftv,true,addToIndex);
4846 }
4847 writeConceptRootList(&ftv,addToIndex);
4848 TextStream t;
4850 ol.writeString(t.str());
4851 if (addToIndex)
4852 {
4854 }
4855 }
4856 ol.popGeneratorState();
4857 // 2.}
4858
4859 endFile(ol);
4860 ol.popGeneratorState();
4861 // 1.}
4862}
4863
4864//----------------------------------------------------------------------------
4865
4867{
4868 if (lne->baseFile().startsWith("usergroup"))
4869 {
4870 ol.pushGeneratorState();
4872 startFile(ol,lne->baseFile(),false,DString(),lne->title(),HighlightedItem::UserGroup);
4873 startTitle(ol,DString());
4874 ol.parseText(lne->title());
4875 endTitle(ol,DString(),DString());
4876 ol.startContents();
4877 int count=0;
4878 for (const auto &entry: lne->children())
4879 {
4880 if (entry->visible()) count++;
4881 }
4882 if (count>0)
4883 {
4884 ol.writeString("<ul>\n");
4885 for (const auto &entry: lne->children())
4886 {
4887 if (entry->visible())
4888 {
4889 ol.writeString("<li><a href=\""+entry->url()+"\"><span>"+
4890 HtmlGenerator::fixSpaces(entry->title())+"</span></a></li>\n");
4891 }
4892 }
4893 ol.writeString("</ul>\n");
4894 }
4895 endFile(ol);
4896 ol.popGeneratorState();
4897 }
4898}
4899
4900//----------------------------------------------------------------------------
4901
4902
4903static void writeIndex(OutputList &ol)
4904{
4905 bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
4906 bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
4907 bool disableIndex = Config_getBool(DISABLE_INDEX);
4908 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
4909 bool pageOutlinePanel = Config_getBool(PAGE_OUTLINE_PANEL);
4910 bool fullSidebar = Config_getBool(FULL_SIDEBAR);
4911 DString projectName = Config_getString(PROJECT_NAME);
4912 // save old generator state
4913 ol.pushGeneratorState();
4914
4915 DString projPrefix;
4916 if (!projectName.empty())
4917 {
4918 projPrefix=projectName+" ";
4919 }
4920
4921 //--------------------------------------------------------------------
4922 // write HTML index
4923 //--------------------------------------------------------------------
4925
4926 DString defFileName =
4927 Doxygen::mainPage ? Doxygen::mainPage->docFile() : DString("[generated]");
4928 int defLine =
4929 Doxygen::mainPage ? Doxygen::mainPage->docLine() : -1;
4930
4931 DString title, titleAsHtml;
4932 if (!mainPageHasTitle())
4933 {
4934 title = theTranslator->trMainPage();
4935 }
4936 else if (Doxygen::mainPage)
4937 {
4938 title = parseCommentAsText(Doxygen::mainPage.get(),nullptr,Doxygen::mainPage->title(),
4939 Doxygen::mainPage->getDefFileName(),Doxygen::mainPage->getDefLine());
4940 titleAsHtml = parseCommentAsHtml(Doxygen::mainPage.get(),nullptr,Doxygen::mainPage->title(),
4941 Doxygen::mainPage->getDefFileName(),Doxygen::mainPage->getDefLine());
4942 }
4943
4944 DString indexName="index";
4945 ol.startFile(indexName,false,DString(),title);
4946
4948 {
4949 bool hasSubs = Doxygen::mainPage->hasSubPages() || Doxygen::mainPage->hasSections();
4950 bool hasTitle = !projectName.empty() && mainPageHasTitle() && dstricmp(title,projectName)!=0;
4951 //printf("** mainPage title=%s hasTitle=%d hasSubs=%d\n",qPrint(title),hasTitle,hasSubs);
4952 if (hasTitle) // to avoid duplicate entries in the treeview
4953 {
4955 title,
4956 DString(),
4957 indexName,
4958 DString(),
4959 hasSubs,
4960 true,
4961 nullptr,
4962 titleAsHtml);
4963 }
4964 if (hasSubs)
4965 {
4966 writePages(Doxygen::mainPage.get(),nullptr,!hasTitle);
4967 }
4968 }
4969
4970 bool quickLinksAfterSplitbar = !disableIndex && generateTreeView && fullSidebar;
4971 ol.startQuickIndices();
4972 if (!disableIndex && !quickLinksAfterSplitbar)
4973 {
4975 }
4976 ol.endQuickIndices();
4977 ol.writeSplitBar(indexName,DString());
4978 if (quickLinksAfterSplitbar)
4979 {
4981 }
4982 ol.writeSearchInfo();
4983 bool headerWritten=false;
4985 {
4986 if (!Doxygen::mainPage->title().empty())
4987 {
4988 if (Doxygen::mainPage->title().lower() != "notitle")
4989 ol.startPageDoc(Doxygen::mainPage->title());
4990 else
4991 ol.startPageDoc("");
4992 }
4993 else
4994 ol.startPageDoc(projectName);
4995 }
4996 if (Doxygen::mainPage && !Doxygen::mainPage->title().empty())
4997 {
4998 if (Doxygen::mainPage->title().lower()!="notitle")
4999 {
5000 ol.startHeaderSection();
5001 ol.startTitleHead(DString());
5002 ol.generateDoc(Doxygen::mainPage->docFile(),
5003 Doxygen::mainPage->getStartBodyLine(),
5004 Doxygen::mainPage.get(),
5005 nullptr,
5006 Doxygen::mainPage->title(),
5007 DocOptions()
5008 .setSingleLine(true));
5009 headerWritten = true;
5010 }
5011 }
5012 else
5013 {
5014 if (!projectName.empty())
5015 {
5016 ol.startHeaderSection();
5017 ol.startTitleHead(DString());
5018 ol.parseText(theTranslator->trDocumentation(projectName));
5019 headerWritten = true;
5020 }
5021 }
5022 if (headerWritten)
5023 {
5025 ol.endHeaderSection();
5026 }
5027
5028 ol.startContents();
5029 if (Config_getBool(DISABLE_INDEX) && Doxygen::mainPage==nullptr)
5030 {
5032 }
5033
5035 {
5036 if (Doxygen::mainPage->localToc().isHtmlEnabled() && Doxygen::mainPage->hasSections() && !(generateTreeView && pageOutlinePanel))
5037 {
5038 Doxygen::mainPage->writeToc(ol,Doxygen::mainPage->localToc());
5039 }
5040
5041 ol.startTextBlock();
5042 ol.generateDoc(defFileName,
5043 defLine,
5044 Doxygen::mainPage.get(),
5045 nullptr,
5046 Doxygen::mainPage->documentation(),
5047 DocOptions()
5048 .setIndexWords(true));
5049 ol.endTextBlock();
5050 ol.endPageDoc();
5051 }
5052
5055 ol.writeString("<a href=\"" + fn + "\"></a>\n");
5057
5058 if (Doxygen::mainPage &&
5059 generateTreeView &&
5060 pageOutlinePanel &&
5061 Doxygen::mainPage->localToc().isHtmlEnabled() &&
5062 Doxygen::mainPage->hasSections()
5063 )
5064 {
5065 ol.writeString("</div><!-- doc-content -->\n");
5066 ol.endContents();
5067 Doxygen::mainPage->writePageNavigation(ol);
5068 ol.writeString("</div><!-- container -->\n");
5069 endFile(ol,true,true);
5070 }
5071 else
5072 {
5073 endFile(ol);
5074 }
5075
5077
5078 //--------------------------------------------------------------------
5079 // write LaTeX/RTF index
5080 //--------------------------------------------------------------------
5084
5086 {
5087 msg("Generating main page...\n");
5088 Doxygen::mainPage->writeDocumentation(ol);
5089 }
5090
5091 ol.startFile("refman",false,DString(),DString());
5095
5096 if (projPrefix.empty())
5097 {
5099 }
5100 else
5101 {
5102 ol.parseText(projPrefix);
5103 }
5104
5105 if (!Config_getString(PROJECT_NUMBER).empty())
5106 {
5107 ol.startProjectNumber();
5108 ol.generateDoc(defFileName,
5109 defLine,
5110 Doxygen::mainPage.get(),
5111 nullptr,
5112 Config_getString(PROJECT_NUMBER),
5113 DocOptions());
5114 ol.endProjectNumber();
5115 }
5122
5123 ol.lastIndexPage();
5125 {
5128 }
5129 const auto &index = Index::instance();
5130 if (index.numDocumentedPages()>0)
5131 {
5134 }
5135
5137 if (!Config_getBool(LATEX_HIDE_INDICES))
5138 {
5139 //if (indexedPages>0)
5140 //{
5141 // ol.startIndexSection(isPageIndex);
5142 // ol.parseText(/*projPrefix+*/ theTranslator->trPageIndex());
5143 // ol.endIndexSection(isPageIndex);
5144 //}
5145 if (index.numDocumentedModules()>0)
5146 {
5148 ol.parseText(/*projPrefix+*/ theTranslator->trModuleIndex());
5150 }
5151 if (index.numDocumentedGroups()>0)
5152 {
5154 ol.parseText(/*projPrefix+*/ theTranslator->trTopicIndex());
5156 }
5157 if (index.numDocumentedDirs()>0)
5158 {
5162 }
5163 if (Config_getBool(SHOW_NAMESPACES) && (index.numDocumentedNamespaces()>0))
5164 {
5165 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Namespaces);
5166 if (lne)
5167 {
5169 ol.parseText(/*projPrefix+*/(fortranOpt?theTranslator->trModulesIndex():theTranslator->trNamespaceIndex()));
5171 }
5172 }
5173 if (index.numDocumentedConcepts()>0)
5174 {
5176 ol.parseText(/*projPrefix+*/theTranslator->trConceptIndex());
5178 }
5179 if (index.numHierarchyInterfaces()>0)
5180 {
5182 ol.parseText(/*projPrefix+*/theTranslator->trHierarchicalIndex());
5184 }
5185 if (index.numHierarchyClasses()>0)
5186 {
5187 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassHierarchy);
5188 if (lne)
5189 {
5191 ol.parseText(/*projPrefix+*/
5192 (fortranOpt ? theTranslator->trCompoundIndexFortran() :
5193 vhdlOpt ? theTranslator->trHierarchicalIndex() :
5195 ));
5197 }
5198 }
5199 if (index.numHierarchyExceptions()>0)
5200 {
5202 ol.parseText(/*projPrefix+*/theTranslator->trHierarchicalIndex());
5204 }
5205 if (index.numAnnotatedInterfacesPrinted()>0)
5206 {
5208 ol.parseText(/*projPrefix+*/theTranslator->trInterfaceIndex());
5210 }
5211 if (index.numAnnotatedClassesPrinted()>0)
5212 {
5214 ol.parseText(/*projPrefix+*/
5215 (fortranOpt ? theTranslator->trCompoundIndexFortran() :
5216 vhdlOpt ? theTranslator->trDesignUnitIndex() :
5218 ));
5220 }
5221 if (index.numAnnotatedStructsPrinted()>0)
5222 {
5224 ol.parseText(/*projPrefix+*/theTranslator->trStructIndex());
5226 }
5227 if (index.numAnnotatedExceptionsPrinted()>0)
5228 {
5230 ol.parseText(/*projPrefix+*/theTranslator->trExceptionIndex());
5232 }
5233 if (Config_getBool(SHOW_FILES) && index.numDocumentedFiles()>0)
5234 {
5236 ol.parseText(/*projPrefix+*/theTranslator->trFileIndex());
5238 }
5239 }
5241
5242 if (index.numDocumentedModules()>0)
5243 {
5245 ol.parseText(/*projPrefix+*/theTranslator->trModuleDocumentation());
5247 }
5248 if (index.numDocumentedGroups()>0)
5249 {
5251 ol.parseText(/*projPrefix+*/theTranslator->trTopicDocumentation());
5253 }
5254 if (index.numDocumentedDirs()>0)
5255 {
5257 ol.parseText(/*projPrefix+*/theTranslator->trDirDocumentation());
5259 }
5260 if (index.numDocumentedNamespaces()>0)
5261 {
5265 }
5266 if (index.numDocumentedConcepts()>0)
5267 {
5269 ol.parseText(/*projPrefix+*/theTranslator->trConceptDocumentation());
5271 }
5272 if (index.numAnnotatedInterfacesPrinted()>0)
5273 {
5275 ol.parseText(/*projPrefix+*/theTranslator->trInterfaceDocumentation());
5277 }
5278 if (index.numAnnotatedClassesPrinted()>0)
5279 {
5283 }
5284 if (index.numAnnotatedStructsPrinted()>0)
5285 {
5287 ol.parseText(/*projPrefix+*/theTranslator->trStructDocumentation());
5290 if (index.numAnnotatedExceptionsPrinted()>0)
5293 ol.parseText(/*projPrefix+*/theTranslator->trExceptionDocumentation());
5295 }
5296 if (Config_getBool(SHOW_FILES) && index.numDocumentedFiles()>0)
5297 {
5299 ol.parseText(/*projPrefix+*/theTranslator->trFileDocumentation());
5301 }
5302 if (!Doxygen::exampleLinkedMap->empty())
5303 {
5305 ol.parseText(/*projPrefix+*/theTranslator->trExamples());
5307 }
5309 endFile(ol);
5310
5311 ol.popGeneratorState();
5312}
5313
5314static std::vector<bool> indexWritten;
5315
5316static void writeIndexHierarchyEntries(OutputList &ol,const LayoutNavEntryList &entries)
5317{
5318 auto isRef = [](const DString &s)
5319 {
5320 return s.startsWith("@ref") || s.startsWith("\\ref");
5321 };
5322 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
5323 const auto &index = Index::instance();
5324 for (const auto &lne : entries)
5325 {
5326 LayoutNavEntry::Kind kind = lne->kind();
5327 size_t idx = static_cast<size_t>(kind);
5328 if (idx>=indexWritten.size())
5329 {
5330 size_t oldSize = indexWritten.size();
5331 size_t newSize = idx+1;
5332 indexWritten.resize(newSize);
5333 for (size_t i=oldSize; i<newSize; i++) indexWritten.at(i)=false;
5334 }
5335 //printf("starting %s kind=%d\n",qPrint(lne->title()),lne->kind());
5336 bool addToIndex=lne->visible();
5337 bool needsClosing=false;
5338 if (!indexWritten.at(idx))
5339 {
5340 switch(kind)
5341 {
5342 case LayoutNavEntry::MainPage:
5343 msg("Generating index page...\n");
5344 writeIndex(ol);
5345 break;
5346 case LayoutNavEntry::Pages:
5347 msg("Generating page index...\n");
5348 writePageIndex(ol);
5349 break;
5350 case LayoutNavEntry::Topics:
5351 msg("Generating topic index...\n");
5352 writeTopicIndex(ol);
5353 break;
5354 case LayoutNavEntry::Modules:
5355 {
5356 if (index.numDocumentedModules()>0 && addToIndex)
5357 {
5360 needsClosing=true;
5361 }
5362 }
5363 break;
5364 case LayoutNavEntry::ModuleList:
5365 msg("Generating module index...\n");
5366 writeModuleIndex(ol);
5367 break;
5368 case LayoutNavEntry::ModuleMembers:
5369 msg("Generating module member index...\n");
5371 break;
5372 case LayoutNavEntry::Namespaces:
5373 {
5374 bool showNamespaces = Config_getBool(SHOW_NAMESPACES);
5375 if (showNamespaces)
5376 {
5377 if (index.numDocumentedNamespaces()>0 && addToIndex)
5378 {
5381 needsClosing=true;
5382 }
5383 if (LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Namespaces)!=lne.get()) // for backward compatibility with old layout file
5384 {
5385 msg("Generating namespace index...\n");
5387 }
5388 }
5389 }
5390 break;
5391 case LayoutNavEntry::NamespaceList:
5392 {
5393 bool showNamespaces = Config_getBool(SHOW_NAMESPACES);
5394 if (showNamespaces)
5395 {
5396 msg("Generating namespace index...\n");
5398 }
5399 }
5400 break;
5401 case LayoutNavEntry::NamespaceMembers:
5402 msg("Generating namespace member index...\n");
5404 break;
5405 case LayoutNavEntry::Classes:
5406 if (index.numAnnotatedClasses()>0 && addToIndex)
5407 {
5410 needsClosing=true;
5411 }
5412 if (LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Classes)!=lne.get()) // for backward compatibility with old layout file
5413 {
5414 msg("Generating annotated compound index...\n");
5416 }
5417 break;
5418 case LayoutNavEntry::Concepts:
5419 msg("Generating concept index...\n");
5421 break;
5422 case LayoutNavEntry::ClassList:
5423 msg("Generating annotated compound index...\n");
5425 break;
5426 case LayoutNavEntry::ClassIndex:
5427 msg("Generating alphabetical compound index...\n");
5429 break;
5430 case LayoutNavEntry::ClassHierarchy:
5431 msg("Generating hierarchical class index...\n");
5433 if (Config_getBool(HAVE_DOT) && Config_getBool(GRAPHICAL_HIERARCHY))
5434 {
5435 msg("Generating graphical class hierarchy...\n");
5437 }
5438 break;
5439 case LayoutNavEntry::ClassMembers:
5440 if (!sliceOpt)
5441 {
5442 msg("Generating member index...\n");
5444 }
5445 break;
5446 case LayoutNavEntry::Interfaces:
5447 if (sliceOpt && index.numAnnotatedInterfaces()>0 && addToIndex)
5448 {
5451 needsClosing=true;
5452 }
5453 break;
5454 case LayoutNavEntry::InterfaceList:
5455 if (sliceOpt)
5456 {
5457 msg("Generating annotated interface index...\n");
5459 }
5460 break;
5461 case LayoutNavEntry::InterfaceIndex:
5462 if (sliceOpt)
5463 {
5464 msg("Generating alphabetical interface index...\n");
5466 }
5467 break;
5468 case LayoutNavEntry::InterfaceHierarchy:
5469 if (sliceOpt)
5470 {
5471 msg("Generating hierarchical interface index...\n");
5473 if (Config_getBool(HAVE_DOT) && Config_getBool(GRAPHICAL_HIERARCHY))
5474 {
5475 msg("Generating graphical interface hierarchy...\n");
5477 }
5478 }
5479 break;
5480 case LayoutNavEntry::Structs:
5481 if (sliceOpt && index.numAnnotatedStructs()>0 && addToIndex)
5482 {
5485 needsClosing=true;
5486 }
5487 break;
5488 case LayoutNavEntry::StructList:
5489 if (sliceOpt)
5490 {
5491 msg("Generating annotated struct index...\n");
5493 }
5494 break;
5495 case LayoutNavEntry::StructIndex:
5496 if (sliceOpt)
5497 {
5498 msg("Generating alphabetical struct index...\n");
5500 }
5501 break;
5502 case LayoutNavEntry::Exceptions:
5503 if (sliceOpt && index.numAnnotatedExceptions()>0 && addToIndex)
5504 {
5507 needsClosing=true;
5508 }
5509 break;
5510 case LayoutNavEntry::ExceptionList:
5511 if (sliceOpt)
5512 {
5513 msg("Generating annotated exception index...\n");
5515 }
5516 break;
5517 case LayoutNavEntry::ExceptionIndex:
5518 if (sliceOpt)
5519 {
5520 msg("Generating alphabetical exception index...\n");
5522 }
5523 break;
5524 case LayoutNavEntry::ExceptionHierarchy:
5525 if (sliceOpt)
5526 {
5527 msg("Generating hierarchical exception index...\n");
5529 if (Config_getBool(HAVE_DOT) && Config_getBool(GRAPHICAL_HIERARCHY))
5530 {
5531 msg("Generating graphical exception hierarchy...\n");
5533 }
5534 }
5535 break;
5536 case LayoutNavEntry::Files:
5537 {
5538 if (Config_getBool(SHOW_FILES) && index.numDocumentedFiles()>0 && addToIndex)
5539 {
5542 needsClosing=true;
5543 }
5544 if (LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Files)!=lne.get()) // for backward compatibility with old layout file
5545 {
5546 msg("Generating file index...\n");
5547 writeFileIndex(ol);
5548 }
5549 }
5550 break;
5551 case LayoutNavEntry::FileList:
5552 msg("Generating file index...\n");
5553 writeFileIndex(ol);
5554 break;
5555 case LayoutNavEntry::FileGlobals:
5556 msg("Generating file member index...\n");
5558 break;
5559 case LayoutNavEntry::Examples:
5560 msg("Generating example index...\n");
5562 break;
5563 case LayoutNavEntry::User:
5564 if (addToIndex)
5565 {
5566 // prepend a ! or ^ marker to the URL to avoid tampering with it
5567 DString url = correctURL(lne->url(),"!"); // add ! to relative URL
5568 bool isRelative=url.at(0)=='!';
5569 if (!url.empty() && !isRelative) // absolute URL
5570 {
5571 url.prepend("^"); // prepend ^ to absolute URL
5572 }
5574 url,DString(),false,isRef(lne->baseFile()) || isRelative);
5575 }
5576 break;
5577 case LayoutNavEntry::UserGroup:
5578 if (addToIndex)
5579 {
5580 DString url = correctURL(lne->url(),"!"); // add ! to relative URL
5581 if (!url.empty())
5582 {
5583 if (url=="!") // result of a "[none]" url
5584 {
5585 Doxygen::indexList->addContentsItem(true,lne->title(),DString(),DString(),DString(),false,false);
5586 }
5587 else
5588 {
5589 bool isRelative=url.at(0)=='!';
5590 if (!isRelative) // absolute URL
5591 {
5592 url.prepend("^"); // prepend ^ to absolute URL
5593 }
5595 url,DString(),false,isRef(lne->baseFile()) || isRelative);
5596 }
5597 }
5598 else
5599 {
5600 Doxygen::indexList->addContentsItem(true,lne->title(),DString(),lne->baseFile(),DString(),true,true);
5601 }
5603 needsClosing=true;
5604 }
5605 writeUserGroupStubPage(ol,lne.get());
5606 break;
5607 case LayoutNavEntry::None:
5608 assert(kind != LayoutNavEntry::None); // should never happen, means not properly initialized
5609 break;
5610 }
5611 if (kind!=LayoutNavEntry::User && kind!=LayoutNavEntry::UserGroup) // User entry may appear multiple times
5612 {
5613 indexWritten.at(idx)=true;
5615 }
5617 if (needsClosing)
5618 {
5619 switch(kind)
5620 {
5621 case LayoutNavEntry::Modules:
5622 case LayoutNavEntry::Namespaces:
5623 case LayoutNavEntry::Classes:
5624 case LayoutNavEntry::Files:
5625 case LayoutNavEntry::UserGroup:
5627 break;
5628 default:
5629 break;
5630 }
5631 }
5632 //printf("ending %s kind=%d\n",qPrint(lne->title()),lne->kind());
5633 }
5634
5635 // always write the directory index as it is used for non-HTML output only
5636 writeDirIndex(ol);
5637}
5638
5639static bool quickLinkVisible(LayoutNavEntry::Kind kind)
5640{
5641 const auto &index = Index::instance();
5642 bool showNamespaces = Config_getBool(SHOW_NAMESPACES);
5643 bool showFiles = Config_getBool(SHOW_FILES);
5644 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
5645 switch (kind)
5646 {
5647 case LayoutNavEntry::MainPage: return true;
5648 case LayoutNavEntry::User: return true;
5649 case LayoutNavEntry::UserGroup: return true;
5650 case LayoutNavEntry::Pages: return index.numIndexedPages()>0;
5651 case LayoutNavEntry::Topics: return index.numDocumentedGroups()>0;
5652 case LayoutNavEntry::Modules: return index.numDocumentedModules()>0;
5653 case LayoutNavEntry::ModuleList: return index.numDocumentedModules()>0;
5654 case LayoutNavEntry::ModuleMembers: return index.numDocumentedModuleMembers(ModuleMemberHighlight::All)>0;
5655 case LayoutNavEntry::Namespaces: return index.numDocumentedNamespaces()>0 && showNamespaces;
5656 case LayoutNavEntry::NamespaceList: return index.numDocumentedNamespaces()>0 && showNamespaces;
5657 case LayoutNavEntry::NamespaceMembers: return index.numDocumentedNamespaceMembers(NamespaceMemberHighlight::All)>0;
5658 case LayoutNavEntry::Concepts: return index.numDocumentedConcepts()>0;
5659 case LayoutNavEntry::Classes: return index.numAnnotatedClasses()>0;
5660 case LayoutNavEntry::ClassList: return index.numAnnotatedClasses()>0;
5661 case LayoutNavEntry::ClassIndex: return index.numAnnotatedClasses()>0;
5662 case LayoutNavEntry::ClassHierarchy: return index.numHierarchyClasses()>0;
5663 case LayoutNavEntry::ClassMembers: return index.numDocumentedClassMembers(ClassMemberHighlight::All)>0 && !sliceOpt;
5664 case LayoutNavEntry::Interfaces: return index.numAnnotatedInterfaces()>0;
5665 case LayoutNavEntry::InterfaceList: return index.numAnnotatedInterfaces()>0;
5666 case LayoutNavEntry::InterfaceIndex: return index.numAnnotatedInterfaces()>0;
5667 case LayoutNavEntry::InterfaceHierarchy: return index.numHierarchyInterfaces()>0;
5668 case LayoutNavEntry::Structs: return index.numAnnotatedStructs()>0;
5669 case LayoutNavEntry::StructList: return index.numAnnotatedStructs()>0;
5670 case LayoutNavEntry::StructIndex: return index.numAnnotatedStructs()>0;
5671 case LayoutNavEntry::Exceptions: return index.numAnnotatedExceptions()>0;
5672 case LayoutNavEntry::ExceptionList: return index.numAnnotatedExceptions()>0;
5673 case LayoutNavEntry::ExceptionIndex: return index.numAnnotatedExceptions()>0;
5674 case LayoutNavEntry::ExceptionHierarchy: return index.numHierarchyExceptions()>0;
5675 case LayoutNavEntry::Files: return index.numDocumentedFiles()>0 && showFiles;
5676 case LayoutNavEntry::FileList: return index.numDocumentedFiles()>0 && showFiles;
5677 case LayoutNavEntry::FileGlobals: return index.numDocumentedFileMembers(FileMemberHighlight::All)>0;
5678 case LayoutNavEntry::Examples: return !Doxygen::exampleLinkedMap->empty();
5679 case LayoutNavEntry::None: // should never happen, means not properly initialized
5680 assert(kind != LayoutNavEntry::None);
5681 return false;
5682 }
5683 return false;
5684}
5685
5686template<class T>
5687void renderMemberIndicesAsJs(std::ostream &t,
5688 std::function<std::size_t(std::size_t)> numDocumented,
5689 std::function<Index::MemberIndexMap(std::size_t)> getMemberList,
5690 const T *(*getInfo)(size_t hl),
5691 std::size_t total)
5692{
5693 // index items per category member lists
5694 bool firstMember=true;
5695 for (std::size_t i=0;i<total;i++)
5696 {
5697 if (numDocumented(i)>0)
5698 {
5699 t << ",";
5700 if (firstMember)
5701 {
5702 t << "children:[";
5703 firstMember=false;
5704 }
5705 t << "\n{text:\"" << convertToJSString(getInfo(i)->title) << "\",url:\""
5706 << convertToJSString(getInfo(i)->fname+Doxygen::htmlFileExtension) << "\"";
5707
5708 // Check if we have many members, then add sub entries per letter...
5709 // quick alphabetical index
5710 bool quickIndex = numDocumented(i)>maxItemsBeforeQuickIndex;
5711 if (quickIndex)
5712 {
5713 bool multiPageIndex=false;
5714 if (numDocumented(i)>MAX_ITEMS_BEFORE_MULTIPAGE_INDEX)
5715 {
5716 multiPageIndex=true;
5717 }
5718 t << ",children:[\n";
5719 bool firstLetter=true;
5720 for (const auto &[letter,list] : getMemberList(i))
5721 {
5722 if (!firstLetter) t << ",\n";
5723 DString ci(letter);
5724 DString is(letterToLabel(ci));
5725 DString anchor;
5727 DString fullName = getInfo(i)->fname;
5728 if (!multiPageIndex || firstLetter)
5729 anchor=fullName+extension+"#index_";
5730 else // other pages of multi page index
5731 anchor=fullName+"_"+is+extension+"#index_";
5732 t << "{text:\"" << convertToJSString(ci) << "\",url:\""
5733 << convertToJSString(anchor+convertToId(is)) << "\"}";
5734 firstLetter=false;
5735 }
5736 t << "]";
5737 }
5738 t << "}";
5739 }
5740 }
5741 if (!firstMember)
5742 {
5743 t << "]";
5744 }
5745}
5746
5747static bool renderQuickLinksAsJs(std::ostream &t,LayoutNavEntry *root,bool first)
5748{
5749 int count=0;
5750 for (const auto &entry : root->children())
5751 {
5752 if (entry->visible() && quickLinkVisible(entry->kind())) count++;
5753 }
5754 if (count>0) // at least one item is visible
5755 {
5756 bool firstChild = true;
5757 if (!first) t << ",";
5758 t << "children:[\n";
5759 for (const auto &entry : root->children())
5760 {
5761 if (entry->visible() && quickLinkVisible(entry->kind()))
5762 {
5763 if (!firstChild) t << ",\n";
5764 firstChild=false;
5765 DString url = entry->url();
5766 if (isURL(url)) url = "^" + url;
5767 t << "{text:\"" << convertToJSString(entry->title()) << "\",url:\""
5768 << convertToJSString(url) << "\"";
5769 bool hasChildren=false;
5770 if (entry->kind()==LayoutNavEntry::ModuleMembers)
5771 {
5772 auto numDoc = [](std::size_t i) {
5774 };
5775 auto memList = [](std::size_t i) {
5777 };
5778 renderMemberIndicesAsJs(t,numDoc,memList,getMmhlInfo,static_cast<std::size_t>(ModuleMemberHighlight::Total));
5779 }
5780 if (entry->kind()==LayoutNavEntry::NamespaceMembers)
5781 {
5782 auto numDoc = [](std::size_t i) {
5784 };
5785 auto memList = [](std::size_t i) {
5787 };
5788 renderMemberIndicesAsJs(t,numDoc,memList,getNmhlInfo,static_cast<std::size_t>(NamespaceMemberHighlight::Total));
5789 }
5790 else if (entry->kind()==LayoutNavEntry::ClassMembers)
5791 {
5792 auto numDoc = [](std::size_t i) {
5794 };
5795 auto memList = [](std::size_t i) {
5798 renderMemberIndicesAsJs(t,numDoc,memList,getCmhlInfo,static_cast<std::size_t>(ClassMemberHighlight::Total));
5799 }
5800 else if (entry->kind()==LayoutNavEntry::FileGlobals)
5801 {
5802 auto numDoc = [](std::size_t i) {
5804 };
5805 auto memList = [](std::size_t i) {
5807 };
5808 renderMemberIndicesAsJs(t,numDoc,memList,getFmhlInfo,static_cast<std::size_t>(FileMemberHighlight::Total));
5809 }
5810 else // recursive into child list
5811 {
5812 hasChildren = renderQuickLinksAsJs(t,entry.get(),false);
5814 if (hasChildren) t << "]";
5815 t << "}";
5816 }
5817 }
5818 }
5819 return count>0;
5820}
5821
5822static void writeMenuData()
5823{
5824 if (!Config_getBool(GENERATE_HTML) || Config_getBool(DISABLE_INDEX)) return;
5825 DString outputDir = Config_getBool(HTML_OUTPUT);
5827 std::ofstream t = Portable::openOutputStream(outputDir+"/menudata.js");
5828 if (t.is_open())
5829 {
5831 t << "var menudata={";
5832 bool hasChildren = renderQuickLinksAsJs(t,root,true);
5833 if (hasChildren) t << "]";
5834 t << "}\n";
5835 }
5836}
5837
5839{
5840 writeMenuData();
5842 if (lne)
5843 {
5845 }
5846}
A abstract class representing of a compound symbol.
Definition classdef.h:104
virtual bool isVisibleInHierarchy() const =0
the class is visible in a class diagram, or class hierarchy
virtual const BaseClassList & baseClasses() const =0
Returns the list of base classes from which this class directly inherits.
virtual bool isSimple() const =0
virtual Protection protection() const =0
Return the protection level (Public,Protected,Private) in which this compound was found.
virtual bool isImplicitTemplateInstance() const =0
CompoundType
The various compound types.
Definition classdef.h:109
@ 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/...
virtual ClassLinkedRefMap getClasses() const =0
returns the classes nested into this class
virtual const BaseClassList & subClasses() const =0
Returns the list of sub classes that directly derive from this class.
static const DString crawlFileName
Definition sitemap.h:75
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
Definition dstring.h:89
DString()=default
DString mid(size_t index, size_t len=npos) const
Definition dstring.h:323
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
Definition dstring.h:153
DString & replace(size_t index, size_t len, const char *s)
Definition dstring.cpp:150
static constexpr size_t npos
value used to indicate 'not found' or 'to the end of the string', matching std::string::npos
Definition dstring.h:183
char & at(size_t i)
Returns a reference to the character at index i.
Definition dstring.h:691
DString & prepend(const char *s)
Definition dstring.h:520
size_t find(char c, size_t pos=0) const
Definition dstring.h:244
DString left(size_t len) const
Definition dstring.h:311
const std::string & str() const
Definition dstring.h:650
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition dstring.h:162
bool startsWith(const char *s) const
Definition dstring.h:605
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition dstring.h:156
The common base class of all entity definitions found in the sources.
Definition definition.h:77
virtual DString briefDescription(bool abbreviate=false) const =0
virtual bool isVisible() const =0
virtual DString briefFile() const =0
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
virtual bool hasSections() const =0
virtual DString getDefFileName() const =0
virtual bool isLinkable() const =0
virtual int getDefLine() const =0
virtual DefType definitionType() const =0
virtual const DString & name() const =0
virtual const DString & localName() const =0
virtual int briefLine() const =0
virtual bool hasDocumentation() const =0
virtual bool isLinkableInProject() const =0
virtual bool isAnonymous() const =0
virtual DString navigationPathAsString() const =0
virtual DString displayName(bool includeScope=true) const =0
virtual DString qualifiedName() const =0
virtual DString anchor() const =0
virtual DString getReference() const =0
virtual const GroupList & partOfGroups() const =0
virtual Definition * getOuterScope() const =0
virtual DString getSourceFileBase() const =0
virtual bool isReference() const =0
virtual DString getOutputFileBase() const =0
virtual void writePageNavigation(OutputList &) const =0
virtual void writeSummaryLinks(OutputList &) const =0
A model of a directory symbol.
Definition dirdef.h:110
virtual const DString shortName() const =0
virtual const DirList & subDirs() const =0
virtual const FileList & getFiles() const =0
Represents a graphical class hierarchy.
Representation of a legend explaining the meaning of boxes, arrows, and colors.
void writeGraph(const DString &path)
static NamespaceLinkedMap * namespaceLinkedMap
Definition doxygen.h:115
static ConceptLinkedMap * conceptLinkedMap
Definition doxygen.h:97
static std::unique_ptr< PageDef > mainPage
Definition doxygen.h:100
static FileNameLinkedMap * inputNameLinkedMap
Definition doxygen.h:104
static ClassLinkedMap * classLinkedMap
Definition doxygen.h:95
static PageLinkedMap * exampleLinkedMap
Definition doxygen.h:98
static NamespaceDefMutable * globalScope
Definition doxygen.h:121
static IndexList * indexList
Definition doxygen.h:132
static ClassLinkedMap * hiddenClassLinkedMap
Definition doxygen.h:96
static PageLinkedMap * pageLinkedMap
Definition doxygen.h:99
static DString htmlFileExtension
Definition doxygen.h:122
static DirLinkedMap * dirLinkedMap
Definition doxygen.h:127
static GroupLinkedMap * groupLinkedMap
Definition doxygen.h:114
A class that generates a dynamic tree view side panel.
Definition ftvhelp.h:41
void decContentsDepth()
Definition ftvhelp.cpp:154
void incContentsDepth()
Definition ftvhelp.cpp:143
void addContentsItem(bool isDir, const DString &name, const DString &ref, const DString &file, const DString &anchor, bool separateIndex, bool addToNavIndex, const Definition *def, const DString &nameAsHtml=DString())
Definition ftvhelp.cpp:186
void generateTreeViewInline(TextStream &t)
Definition ftvhelp.cpp:881
A model of a file symbol.
Definition filedef.h:99
virtual DString getPath() const =0
virtual DString includeName() const =0
virtual bool generateSourceFile() const =0
virtual bool isDocumentationFile() const =0
A model of a group of symbols.
Definition groupdef.h:52
virtual DString groupTitle() const =0
virtual const DirList & getDirs() const =0
virtual const GroupList & getSubGroups() const =0
virtual const FileList & getFiles() const =0
virtual const MemberLists & getMemberLists() const =0
virtual const ConceptLinkedRefMap & getConcepts() const =0
virtual const PageLinkedRefMap & getPages() const =0
virtual const NamespaceLinkedRefMap & getNamespaces() const =0
virtual bool isASubGroup() const =0
virtual bool isVisibleInHierarchy() const =0
virtual const ClassLinkedRefMap & getClasses() const =0
virtual MemberList * getMemberList(MemberListType lt) const =0
static DString fixSpaces(const DString &s)
Definition htmlgen.cpp:3779
void incrementDocumentedNamespaceMembers(int i, const std::string &letter, const MemberDef *md)
Definition index.cpp:208
int numAnnotatedInterfacesPrinted() const
Definition index.cpp:119
void addClassMemberNameToIndex(const MemberDef *md)
Definition index.cpp:2870
std::vector< const MemberDef * > MemberIndexList
Definition index.h:167
void resetDocumentedNamespaceMembers(int i)
Definition index.cpp:171
int numDocumentedFiles() const
Definition index.cpp:131
int numDocumentedNamespaces() const
Definition index.cpp:127
int numIndexedPages() const
Definition index.cpp:130
int numAnnotatedClassesPrinted() const
Definition index.cpp:116
int numDocumentedGroups() const
Definition index.cpp:126
void resetDocumentedModuleMembers(int i)
Definition index.cpp:177
int numDocumentedModules() const
Definition index.cpp:129
void incrementDocumentedFileMembers(int i, const std::string &letter, const MemberDef *md)
Definition index.cpp:202
int numAnnotatedStructs() const
Definition index.cpp:121
int numDocumentedConcepts() const
Definition index.cpp:128
void addNamespaceMemberNameToIndex(const MemberDef *md)
Definition index.cpp:2934
void resetDocumentedClassMembers(int i)
Definition index.cpp:159
int numAnnotatedStructsPrinted() const
Definition index.cpp:122
void incrementDocumentedClassMembers(int i, const std::string &letter, const MemberDef *md)
Definition index.cpp:196
MemberIndexMap isClassIndexLetterUsed(ClassMemberHighlight::Enum e) const
Definition index.cpp:139
void addFileMemberNameToIndex(const MemberDef *md)
Definition index.cpp:2982
void incrementDocumentedModuleMembers(int i, const std::string &letter, const MemberDef *md)
Definition index.cpp:214
int numHierarchyInterfaces() const
Definition index.cpp:120
int numDocumentedClassMembers(ClassMemberHighlight::Enum e) const
Definition index.cpp:134
int numDocumentedModuleMembers(ModuleMemberHighlight::Enum e) const
Definition index.cpp:137
void addModuleMemberNameToIndex(const MemberDef *md)
Definition index.cpp:3034
int numDocumentedNamespaceMembers(NamespaceMemberHighlight::Enum e) const
Definition index.cpp:136
int numDocumentedPages() const
Definition index.cpp:132
int numHierarchyExceptions() const
Definition index.cpp:125
int numAnnotatedExceptionsPrinted() const
Definition index.cpp:124
int numDocumentedFileMembers(FileMemberHighlight::Enum e) const
Definition index.cpp:135
int numAnnotatedExceptions() const
Definition index.cpp:123
MemberIndexMap isFileIndexLetterUsed(FileMemberHighlight::Enum e) const
Definition index.cpp:144
void sortMemberIndexLists()
Definition index.cpp:221
std::map< std::string, MemberIndexList > MemberIndexMap
Definition index.h:168
static Index & instance()
Definition index.cpp:109
void countDataStructures()
Definition index.cpp:265
int numHierarchyClasses() const
Definition index.cpp:117
MemberIndexMap isModuleIndexLetterUsed(ModuleMemberHighlight::Enum e) const
Definition index.cpp:154
void resetDocumentedFileMembers(int i)
Definition index.cpp:165
int numDocumentedDirs() const
Definition index.cpp:133
int numAnnotatedInterfaces() const
Definition index.cpp:118
Index()
Definition index.cpp:103
std::unique_ptr< Private > p
Definition index.h:221
int numAnnotatedClasses() const
Definition index.cpp:115
MemberIndexMap isNamespaceIndexLetterUsed(NamespaceMemberHighlight::Enum e) const
Definition index.cpp:149
void addIndexFile(const DString &name)
Definition indexlist.h:120
void decContentsDepth()
Definition indexlist.h:109
void addContentsItem(bool isDir, const DString &name, const DString &ref, const DString &file, const DString &anchor, bool separateIndex=false, bool addToNavIndex=false, const Definition *def=nullptr, const DString &nameAsHtml=DString())
Definition indexlist.h:112
void enable()
enable the indices
Definition indexlist.h:92
void incContentsDepth()
Definition indexlist.h:106
void disable()
disable the indices
Definition indexlist.h:88
static LayoutDocManager & instance()
Returns a reference to this singleton.
Definition layout.cpp:1436
LayoutNavEntry * rootNavEntry() const
returns the (invisible) root of the navigation tree.
Definition layout.cpp:1447
std::unique_ptr< ClassDef > Ptr
Definition linkedmap.h:38
bool empty() const
Definition linkedmap.h:209
const T * find(const std::string &key) const
Definition linkedmap.h:47
size_t size() const
Definition linkedmap.h:375
bool empty() const
Definition linkedmap.h:374
A model of a class/file/namespace member symbol.
Definition memberdef.h:48
virtual bool isSignal() const =0
virtual bool isFriend() const =0
virtual bool isForeign() const =0
virtual bool isRelated() const =0
virtual bool isSequence() const =0
virtual const ClassDef * getClassDef() const =0
virtual GroupDef * getGroupDef()=0
virtual bool isTypedef() const =0
virtual bool isSlot() const =0
virtual const MemberVector & enumFieldList() const =0
virtual const FileDef * getFileDef() const =0
virtual bool isEvent() const =0
virtual bool isFunction() const =0
virtual bool isDictionary() const =0
virtual const ModuleDef * getModuleDef() const =0
virtual bool isDefine() const =0
virtual const NamespaceDef * getNamespaceDef() const =0
virtual bool isEnumerate() const =0
virtual bool isVariable() const =0
virtual bool isStrong() const =0
virtual DString typeString() const =0
virtual const MemberDef * getEnumScope() const =0
virtual bool isEnumValue() const =0
virtual bool isProperty() const =0
A list of MemberDef objects as shown in documentation sections.
Definition memberlist.h:125
A vector of MemberDef object.
Definition memberlist.h:35
bool empty() const noexcept
Definition memberlist.h:60
iterator end() noexcept
Definition memberlist.h:56
iterator begin() noexcept
Definition memberlist.h:54
virtual MemberList * getMemberList(MemberListType lt) const =0
virtual int countVisibleMembers() const =0
virtual bool isPrimaryInterface() const =0
virtual const ConceptLinkedRefMap & getConcepts() const =0
virtual const ClassLinkedRefMap & getClasses() const =0
int numDocumentedModules() const
static ModuleManager & instance()
An abstract interface of a namespace symbol.
virtual MemberList * getMemberList(MemberListType lt) const =0
virtual ConceptLinkedRefMap getConcepts() const =0
virtual ClassLinkedRefMap getStructs() const =0
virtual ClassLinkedRefMap getExceptions() const =0
virtual NamespaceLinkedRefMap getNamespaces() const =0
virtual int countVisibleMembers() const =0
virtual ClassLinkedRefMap getClasses() const =0
virtual ClassLinkedRefMap getInterfaces() const =0
Class representing a list of output generators that are written to in parallel.
Definition outputlist.h:315
void writeFooter(const DString &navPath)
Definition outputlist.h:399
void startTitleHead(const DString &fileName)
Definition outputlist.h:403
void parseText(const DString &textStr)
void writeSearchInfo()
Definition outputlist.h:397
void endTitleHead(const DString &fileName, const DString &name)
Definition outputlist.h:405
void startItemList()
Definition outputlist.h:429
void disable(OutputType o)
void startIndexKey()
Definition outputlist.h:421
void startParagraph(const DString &classDef=DString())
Definition outputlist.h:407
void writeObjectLink(const DString &ref, const DString &file, const DString &anchor, const DString &name)
Definition outputlist.h:439
void enable(OutputType o)
void endIndexItem(const DString &ref, const DString &file)
Definition outputlist.h:435
void endContents()
Definition outputlist.h:620
void endHeaderSection()
Definition outputlist.h:467
void endTextBlock(bool paraBreak=false)
Definition outputlist.h:672
void docify(const DString &s)
Definition outputlist.h:437
void writeGraphicalHierarchy(DotGfxHierarchyTable &g)
Definition outputlist.h:668
void startHeaderSection()
Definition outputlist.h:465
void endIndexList()
Definition outputlist.h:419
void endPageDoc()
Definition outputlist.h:624
void endIndexSection(IndexSection is)
Definition outputlist.h:387
void writeString(const DString &text)
Definition outputlist.h:411
void endFile()
Definition outputlist.h:401
void endIndexValue(const DString &name, bool b)
Definition outputlist.h:427
void startProjectNumber()
Definition outputlist.h:391
void endSection(const DString &lab, SectionType t)
Definition outputlist.h:588
void endParagraph()
Definition outputlist.h:409
void endIndexKey()
Definition outputlist.h:423
void startIndexItem(const DString &ref, const DString &file)
Definition outputlist.h:433
void startQuickIndices()
Definition outputlist.h:602
void endTextLink()
Definition outputlist.h:444
void startItemListItem()
Definition outputlist.h:457
void endItemListItem()
Definition outputlist.h:459
void startTypewriter()
Definition outputlist.h:449
void pushGeneratorState()
void startFile(const DString &name, bool isSource, const DString &manName, const DString &title, int hierarchyLevel=0)
void disableAllBut(OutputType o)
void startTextBlock(bool dense=false)
Definition outputlist.h:670
void popGeneratorState()
void startPageDoc(const DString &pageTitle)
Definition outputlist.h:622
void lastIndexPage()
Definition outputlist.h:674
void startIndexValue(bool b)
Definition outputlist.h:425
void startTextLink(const DString &file, const DString &anchor)
Definition outputlist.h:442
void endIndexListItem()
Definition outputlist.h:415
void endQuickIndices()
Definition outputlist.h:604
void writeSplitBar(const DString &name, const DString &allMembersFile)
Definition outputlist.h:606
void generateDoc(const DString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const DString &docStr, const DocOptions &options)
void endItemList()
Definition outputlist.h:431
void startContents()
Definition outputlist.h:618
void startSection(const DString &lab, const DString &title, SectionType t)
Definition outputlist.h:586
void startIndexList()
Definition outputlist.h:417
void enableAll()
void endProjectNumber()
Definition outputlist.h:393
void endTypewriter()
Definition outputlist.h:451
void startIndexListItem()
Definition outputlist.h:413
void writeQuickLinks(HighlightedItem hli, const DString &file, bool extraTabs=false)
Definition outputlist.h:612
void startIndexSection(IndexSection is)
Definition outputlist.h:385
A model of a page symbol.
Definition pagedef.h:27
virtual void addSectionsToIndex()=0
virtual bool visibleInIndex() const =0
virtual const PageLinkedRefMap & getSubPages() const =0
virtual bool hasSubPages() const =0
virtual DString title() const =0
class that provide information about a section.
Definition section.h:58
DString label() const
Definition section.h:69
static SectionManager & instance()
returns a reference to the singleton
Definition section.h:179
static constexpr int Subsection
Definition section.h:34
Text streaming class that buffers data.
Definition textstream.h:36
std::string str() const
Return the contents of the buffer as a std::string object.
Definition textstream.h:232
virtual DString trCompoundMembers()=0
virtual DString trFileDocumentation()=0
virtual DString trFunctionAndProc()=0
virtual DString trTypedefs()=0
virtual DString trConceptList()=0
virtual DString trTopics()=0
virtual DString trModulesMembers()=0
virtual DString trEnumerations()=0
virtual DString trFileMembersDescriptionTotal(FileMemberHighlight::Enum hl)=0
virtual DString trExceptionDocumentation()=0
virtual DString trInterfaceIndex()=0
virtual DString trNamespaceMembers()=0
virtual DString trNamespaceList()=0
virtual DString trExceptionList()=0
virtual DString trCode()=0
virtual DString trClassDocumentation()=0
virtual DString trHierarchicalIndex()=0
virtual DString trExceptionHierarchyDescription()=0
virtual DString trInterfaceList()=0
virtual DString trSequences()=0
virtual DString trFunctions()=0
virtual DString trReferenceManual()=0
virtual DString trInterfaceListDescription()=0
virtual DString trConceptIndex()=0
virtual DString trTopicIndex()=0
virtual DString trGotoTextualHierarchy()=0
virtual DString trExceptionHierarchy()=0
virtual DString trCompoundList()=0
virtual DString trModuleIndex()=0
virtual DString trInterfaceHierarchy()=0
virtual DString trTypeDocumentation()=0
virtual DString trInterfaceDocumentation()=0
virtual DString trStructListDescription()=0
virtual DString trDocumentation(const DString &projName)=0
virtual DString trExamplesDescription()=0
virtual DString trNamespaceDocumentation()=0
virtual DString trFileList()=0
virtual DString trModules()=0
virtual DString trLegendDocs()=0
virtual DString trDefines()=0
virtual DString trRelatedPages()=0
virtual DString trLegendTitle()=0
virtual DString trRelatedSymbols()=0
virtual DString trFileMembers()=0
virtual DString trDirectories()=0
virtual DString trInterfaceHierarchyDescription()=0
virtual DString trStructIndex()=0
virtual DString trExceptionIndex()=0
virtual DString trModuleDocumentation()=0
virtual DString trExceptionListDescription()=0
virtual DString trProperties()=0
virtual DString trRelatedPagesDescription()=0
virtual DString trCompoundIndexFortran()=0
virtual DString trCompoundListDescription()=0
virtual DString trTopicListDescription()=0
virtual DString trModulesIndex()=0
virtual DString trModuleMembersDescriptionTotal(ModuleMemberHighlight::Enum hl)=0
virtual DString trFileListDescription(bool extractAll)=0
virtual DString trClassHierarchyDescription()=0
virtual DString trConceptListDescription(bool extractAll)=0
virtual DString trSubprograms()=0
virtual DString trAll()=0
virtual DString trTopicDocumentation()=0
virtual DString trGeneratedBy()=0
virtual DString trVariables()=0
virtual DString trConceptDocumentation()=0
virtual DString trEnumerationValues()=0
virtual DString trDirDocumentation()=0
virtual DString trModulesListDescription(bool extractAll)=0
virtual DString trStructList()=0
virtual DString trNamespaceListDescription(bool extractAll)=0
virtual DString trCompoundMembersDescriptionTotal(ClassMemberHighlight::Enum hl)=0
virtual DString trClassHierarchy()=0
virtual DString trDirIndex()=0
virtual DString trCompoundIndex()=0
virtual DString trDesignUnitIndex()=0
virtual DString trConstants()=0
virtual DString trStructDocumentation()=0
virtual DString trMainPage()=0
virtual DString trEvents()=0
virtual DString trDictionaries()=0
virtual DString trFileIndex()=0
virtual DString trExamples()=0
virtual DString trNamespaceMembersDescriptionTotal(NamespaceMemberHighlight::Enum hl)=0
virtual DString trGotoGraphicalHierarchy()=0
virtual DString trNamespaceIndex()=0
static DString getProtectionName(int prot)
static VhdlClasses convert(Protection prot)
Definition vhdldocgen.h:80
bool classHasVisibleRoot(const BaseClassList &bcl)
bool classVisibleInIndex(const ClassDef *cd)
bool classHasVisibleChildren(const ClassDef *cd)
std::vector< BaseClassDef > BaseClassList
Definition classdef.h:81
std::unordered_set< const ClassDef * > ClassDefSet
Definition classdef.h:95
#define Config_updateBool(name, value)
Definition config.h:40
#define Config_getBool(name)
Definition config.h:33
#define Config_getString(name)
Definition config.h:32
std::map< std::string, std::string > StringMap
Definition containers.h:30
Definition * toDefinition(DefinitionMutable *dm)
DString parseCommentAsText(const Definition *scope, const MemberDef *md, const DString &doc, const DString &fileName, int lineNr)
DString parseCommentAsHtml(const Definition *scope, const MemberDef *member, const DString &doc, const DString &fileName, int lineNr)
static void addMembersToIndex()
Definition doxygen.cpp:8257
DString substitute(const DString &s, const DString &src, const DString &dst)
substitute all occurrences of src in s by dst
Definition dstring.cpp:481
int dstricmp(const char *s1, const char *s2)
Definition dstring.cpp:440
uint32_t dstrlen(const char *str)
Returns the length of string str, or 0 if a null pointer is passed.
Definition dstring.h:44
#define ASSERT(x)
Definition dstring.h:29
bool compareFileDefs(const FileDef *fd1, const FileDef *fd2)
Definition filedef.cpp:1969
std::unique_ptr< FileDef > createFileDef(const DString &p, const DString &n, const DString &ref, const DString &dn)
Definition filedef.cpp:270
constexpr auto JAVASCRIPT_LICENSE_TEXT
Definition ftvhelp.h:72
static void writePages(PageDef *pd, FTVHelp *ftv, bool reuseRoot=false)
Definition index.cpp:3965
static void writeConceptTreeInsideNamespace(const NamespaceLinkedRefMap &nsLinkedMap, FTVHelp *ftv, bool rootOnly, bool addToIndex)
Definition index.cpp:4657
static DString letterToLabel(const DString &startLetter)
Definition index.cpp:2252
static void writeClassTreeInsideNamespaceElement(const NamespaceDef *nd, FTVHelp *ftv, bool rootOnly, bool addToIndex, ClassDef::CompoundType ct)
Definition index.cpp:1960
static void writeIndexHierarchyEntries(OutputList &ol, const LayoutNavEntryList &entries)
Definition index.cpp:5291
static void writeClassTreeToOutput(OutputList &ol, const BaseClassList &bcl, int level, FTVHelp *ftv, bool addToIndex, ClassDefSet &visitedClasses)
Definition index.cpp:623
#define MAX_ITEMS_BEFORE_QUICK_INDEX
Definition index.cpp:57
static void startQuickIndexList(OutputList &ol, bool letterTabs=false)
Definition index.cpp:348
static void writeFileLinkForMember(OutputList &ol, const MemberDef *md, const DString &separator, DString &prevFileName)
Definition index.cpp:2720
static void writeFileMemberIndexFiltered(OutputList &ol, FileMemberHighlight::Enum hl)
Definition index.cpp:3361
#define MAX_ITEMS_BEFORE_MULTIPAGE_INDEX
Definition index.cpp:56
static void writeNamespaceTree(const NamespaceLinkedRefMap &nsLinkedMap, FTVHelp *ftv, bool rootOnly, bool addToIndex)
Definition index.cpp:1933
static bool renderQuickLinksAsJs(std::ostream &t, LayoutNavEntry *root, bool first)
Definition index.cpp:5722
static void writeGraphicalClassHierarchy(OutputList &ol)
Definition index.cpp:1235
static void writeAnnotatedStructIndex(OutputList &ol)
Definition index.cpp:2680
static void startQuickIndexItem(OutputList &ol, const DString &l, bool hl, bool, bool &first)
Definition index.cpp:367
static void writeAlphabeticalExceptionIndex(OutputList &ol)
Definition index.cpp:2524
static void writeDirIndex(OutputList &ol)
Definition index.cpp:1567
static void writeClassMemberIndex(OutputList &ol)
Definition index.cpp:3301
void writeGraphInfo(OutputList &ol)
Definition index.cpp:4099
static std::vector< bool > indexWritten
Definition index.cpp:5289
static int countConcepts()
Definition index.cpp:1735
static void writeAnnotatedIndex(OutputList &ol)
Definition index.cpp:2652
static void writeClassMemberIndexFiltered(OutputList &ol, ClassMemberHighlight::Enum hl)
Definition index.cpp:3168
static void writeAnnotatedClassList(OutputList &ol, ClassDef::CompoundType ct)
Definition index.cpp:2176
static void writeFileIndex(OutputList &ol)
Definition index.cpp:1596
static void writeGraphicalInterfaceHierarchy(OutputList &ol)
Definition index.cpp:1340
static void endQuickIndexList(OutputList &ol)
Definition index.cpp:361
static void writeAlphabeticalIndex(OutputList &ol)
Definition index.cpp:2437
static int countClassHierarchy(ClassDef::CompoundType ct)
Definition index.cpp:1144
static void writeAnnotatedInterfaceIndex(OutputList &ol)
Definition index.cpp:2666
static void writePageIndex(OutputList &ol)
Definition index.cpp:4025
void endTitle(OutputList &ol, const DString &fileName, const DString &name)
Definition index.cpp:397
static void writeNamespaceIndex(OutputList &ol)
Definition index.cpp:2050
static void writeClassTreeInsideNamespace(const NamespaceLinkedRefMap &nsLinkedMap, FTVHelp *ftv, bool rootOnly, bool addToIndex, ClassDef::CompoundType ct)
Definition index.cpp:2032
void renderMemberIndicesAsJs(std::ostream &t, std::function< std::size_t(std::size_t)> numDocumented, std::function< Index::MemberIndexMap(std::size_t)> getMemberList, const T *(*getInfo)(size_t hl), std::size_t total)
Definition index.cpp:5662
static void writeAnnotatedExceptionIndex(OutputList &ol)
Definition index.cpp:2694
static void writeHierarchicalInterfaceIndex(OutputList &ol)
Definition index.cpp:1261
static void writeNamespaceMembers(const NamespaceDef *nd, bool addToIndex)
Definition index.cpp:1816
static void countRelatedPages(int &docPages, int &indexPages)
Definition index.cpp:3947
static void writeUserGroupStubPage(OutputList &ol, LayoutNavEntry *lne)
Definition index.cpp:4841
static int countGroups()
Definition index.cpp:4067
static void writeNamespaceMemberIndexFiltered(OutputList &ol, NamespaceMemberHighlight::Enum hl)
Definition index.cpp:3548
static void writeNamespaceTreeElement(const NamespaceDef *nd, FTVHelp *ftv, bool rootOnly, bool addToIndex)
Definition index.cpp:1873
static void writeTopicIndex(OutputList &ol)
Definition index.cpp:4419
static void writeClassTree(const ListType &cl, FTVHelp *ftv, bool addToIndex, bool globalOnly, ClassDef::CompoundType ct)
Definition index.cpp:1752
static void writeModuleMemberIndex(OutputList &ol)
Definition index.cpp:3857
static void writeConceptRootList(FTVHelp *ftv, bool addToIndex)
Definition index.cpp:4718
static int countDirs()
Definition index.cpp:4083
static const FmhlInfo * getFmhlInfo(size_t hl)
Definition index.cpp:3338
constexpr auto alphaSepar
Definition index.cpp:59
static void writeGraphicalExceptionHierarchy(OutputList &ol)
Definition index.cpp:1445
bool isId1(int c)
Definition index.cpp:2247
static const MmhlInfo * getMmhlInfo(size_t hl)
Definition index.cpp:3709
static void writeClassLinkForMember(OutputList &ol, const MemberDef *md, const DString &separator, DString &prevClassName)
Definition index.cpp:2707
static void countFiles(int &htmlFiles, int &files)
Definition index.cpp:1471
static void writeClassHierarchy(OutputList &ol, FTVHelp *ftv, bool addToIndex, ClassDef::CompoundType ct)
Definition index.cpp:1093
static void writeSingleFileIndex(OutputList &ol, const FileDef *fd)
Definition index.cpp:1493
static void writeExampleIndex(OutputList &ol)
Definition index.cpp:3882
static int countClassesInTreeList(const ClassLinkedMap &cl, ClassDef::CompoundType ct)
Definition index.cpp:1120
static void writeAlphabeticalInterfaceIndex(OutputList &ol)
Definition index.cpp:2466
static void endQuickIndexItem(OutputList &ol)
Definition index.cpp:380
static void writeAnnotatedIndexGeneric(OutputList &ol, const AnnotatedIndexContext ctx)
Definition index.cpp:2578
static const NmhlInfo * getNmhlInfo(size_t hl)
Definition index.cpp:3524
const ClassDef * get_pointer(const Ptr &p)
static int countAnnotatedClasses(int *cp, ClassDef::CompoundType ct)
Definition index.cpp:2151
static void writeModuleLinkForMember(OutputList &ol, const MemberDef *md, const DString &separator, DString &prevModuleName)
Definition index.cpp:2746
static void writeAlphabeticalStructIndex(OutputList &ol)
Definition index.cpp:2495
static void writeGroupHierarchy(OutputList &ol, FTVHelp *ftv, bool addToIndex)
Definition index.cpp:4395
static void writeModuleMembers(const ModuleDef *mod, bool addToIndex)
Definition index.cpp:1842
static void writeConceptTreeInsideNamespaceElement(const NamespaceDef *nd, FTVHelp *ftv, bool rootOnly, bool addToIndex)
Definition index.cpp:4667
static const CmhlInfo * getCmhlInfo(size_t hl)
Definition index.cpp:3146
static void writeDirHierarchy(OutputList &ol, FTVHelp *ftv, bool addToIndex)
Definition index.cpp:925
std::set< std::string > UsedIndexLetters
Definition index.cpp:2278
static void writeConceptList(const ConceptLinkedRefMap &concepts, FTVHelp *ftv, bool addToIndex)
Definition index.cpp:4634
static void writeNamespaceLinkForMember(OutputList &ol, const MemberDef *md, const DString &separator, DString &prevNamespaceName)
Definition index.cpp:2733
void writeIndexHierarchy(OutputList &ol)
Definition index.cpp:5813
static void writeMemberIndex(OutputList &ol, const Index::MemberIndexMap &map, DString fullName, bool multiPage)
Definition index.cpp:3101
static void writeModuleList(OutputList &ol, FTVHelp *ftv, bool addToIndex)
Definition index.cpp:4542
static bool dirHasVisibleChildren(const DirDef *dd)
Definition index.cpp:739
static int countNamespaces()
Definition index.cpp:1724
static void endIndexHierarchy(OutputList &ol, int level)
Definition index.cpp:326
const int maxItemsBeforeQuickIndex
Definition index.cpp:344
void endFileWithNavPath(OutputList &ol, const DefinitionMutable *d, bool showPageNavigation)
Definition index.cpp:451
static void writeConceptIndex(OutputList &ol)
Definition index.cpp:4740
void endFile(OutputList &ol, bool skipNavIndex, bool skipEndContents, const DString &navPath)
Definition index.cpp:430
static void writeModuleIndex(OutputList &ol)
Definition index.cpp:4566
static void MemberIndexMap_add(Index::MemberIndexMap &map, const std::string &letter, const MemberDef *md)
Definition index.cpp:183
static void writeIndex(OutputList &ol)
Definition index.cpp:4878
static void writeDirTreeNode(OutputList &ol, const DirDef *dd, int level, FTVHelp *ftv, bool addToIndex)
Definition index.cpp:767
static void startIndexHierarchy(OutputList &ol, int level)
Definition index.cpp:310
static bool quickLinkVisible(LayoutNavEntry::Kind kind)
Definition index.cpp:5614
void startTitle(OutputList &ol, const DString &fileName, const DefinitionMutable *def)
Definition index.cpp:387
static void writeModuleTreeNode(OutputList &ol, const ModuleDef *mod, FTVHelp *ftv, bool addToIndex)
Definition index.cpp:4488
static void writeHierarchicalExceptionIndex(OutputList &ol)
Definition index.cpp:1366
static void writeNamespaceMemberIndex(OutputList &ol)
Definition index.cpp:3673
static void writeHierarchicalIndex(OutputList &ol)
Definition index.cpp:1154
static void writeMenuData()
Definition index.cpp:5797
static void writeGroupTreeNode(OutputList &ol, const GroupDef *gd, int level, FTVHelp *ftv, bool addToIndex)
Definition index.cpp:4149
static void writeMemberToIndex(const Definition *def, const MemberDef *md, bool addToIndex)
Definition index.cpp:471
static void writeMemberList(OutputList &ol, bool useSections, const std::string &page, const Index::MemberIndexMap &memberIndexMap, Definition::DefType type)
Definition index.cpp:2761
static void writeQuickMemberIndex(OutputList &ol, const Index::MemberIndexMap &map, const std::string &page, DString fullName, bool multiPage)
Definition index.cpp:3074
static void writeFileMemberIndex(OutputList &ol)
Definition index.cpp:3489
static void writeClassTreeForList(OutputList &ol, const ClassLinkedMap &cl, bool &started, FTVHelp *ftv, bool addToIndex, ClassDef::CompoundType ct, ClassDefSet &visitedClasses)
Definition index.cpp:989
static void writeModuleMemberIndexFiltered(OutputList &ol, ModuleMemberHighlight::Enum hl)
Definition index.cpp:3725
static void writeAlphabeticalClassList(OutputList &ol, ClassDef::CompoundType ct, int)
Definition index.cpp:2281
void startFile(OutputList &ol, const DString &name, bool isSource, const DString &manName, const DString &title, HighlightedItem hli, bool additionalIndices, const DString &altSidebarName, int hierarchyLevel, const DString &allMembersFile)
Definition index.cpp:404
HighlightedItem
Definition index.h:59
@ AnnotatedExceptions
Definition index.h:76
@ InterfaceHierarchy
Definition index.h:66
@ AnnotatedInterfaces
Definition index.h:74
@ NamespaceMembers
Definition index.h:78
@ AnnotatedClasses
Definition index.h:73
@ AnnotatedStructs
Definition index.h:75
@ ExceptionHierarchy
Definition index.h:67
@ isMainPage
Definition index.h:35
@ isTitlePageAuthor
Definition index.h:34
@ isFileIndex
Definition index.h:43
@ isFileDocumentation
Definition index.h:51
@ isPageDocumentation
Definition index.h:53
@ isDirDocumentation
Definition index.h:47
@ isModuleDocumentation
Definition index.h:45
@ isClassHierarchyIndex
Definition index.h:41
@ isModuleIndex
Definition index.h:36
@ isTopicIndex
Definition index.h:37
@ isConceptIndex
Definition index.h:40
@ isExampleDocumentation
Definition index.h:52
@ isClassDocumentation
Definition index.h:49
@ isCompoundIndex
Definition index.h:42
@ isEndIndex
Definition index.h:55
@ isConceptDocumentation
Definition index.h:50
@ isDirIndex
Definition index.h:38
@ isNamespaceIndex
Definition index.h:39
@ isNamespaceDocumentation
Definition index.h:48
@ isTitlePageStart
Definition index.h:33
@ isTopicDocumentation
Definition index.h:46
Translator * theTranslator
Definition language.cpp:71
std::vector< std::unique_ptr< LayoutNavEntry > > LayoutNavEntryList
Definition layout.h:152
#define warn(file, line, fmt,...)
Definition message.h:97
#define msg(fmt,...)
Definition message.h:94
std::ofstream openOutputStream(const DString &name, bool append=false)
Definition portable.cpp:665
bool namespaceHasNestedNamespace(const NamespaceDef *nd)
bool namespaceHasNestedClass(const NamespaceDef *nd, bool filterClasses, ClassDef::CompoundType ct)
NamespaceDef * getResolvedNamespace(const DString &name)
bool namespaceHasNestedConcept(const NamespaceDef *nd)
Definition dstring.h:918
Portable versions of functions that are platform dependent.
const LayoutNavEntry::Kind fallbackKind
Definition index.cpp:2570
AnnotatedIndexContext(int numAnno, int numPrint, LayoutNavEntry::Kind lk, LayoutNavEntry::Kind fk, const DString &title, const DString &intro, ClassDef::CompoundType ct, const DString &fn, HighlightedItem hi)
Definition index.cpp:2555
const DString listDefaultTitleText
Definition index.cpp:2571
const DString fileBaseName
Definition index.cpp:2574
const ClassDef::CompoundType compoundType
Definition index.cpp:2573
const HighlightedItem hiItem
Definition index.cpp:2575
const LayoutNavEntry::Kind listKind
Definition index.cpp:2569
const DString listDefaultIntroText
Definition index.cpp:2572
const int numAnnotated
Definition index.cpp:2567
Helper class representing a class member in the navigation menu.
Definition index.cpp:3140
const char * fname
Definition index.cpp:3142
CmhlInfo(const char *fn, const DString &t)
Definition index.cpp:3141
DString title
Definition index.cpp:3143
Helper class to pass options when calling OutputList::generateDoc().
Definition docoptions.h:24
Helper class representing a file member in the navigation menu.
Definition index.cpp:3332
DString title
Definition index.cpp:3335
FmhlInfo(const char *fn, const DString &t)
Definition index.cpp:3333
const char * fname
Definition index.cpp:3334
std::array< MemberIndexMap, ModuleMemberHighlight::Total > moduleIndexLetterUsed
Definition index.cpp:100
int annotatedExceptions
Definition index.cpp:82
std::array< MemberIndexMap, ClassMemberHighlight::Total > classIndexLetterUsed
Definition index.cpp:97
int documentedModules
Definition index.cpp:88
int annotatedExceptionsPrinted
Definition index.cpp:83
int documentedPages
Definition index.cpp:91
int documentedConcepts
Definition index.cpp:87
int annotatedStructs
Definition index.cpp:80
int annotatedInterfaces
Definition index.cpp:77
int hierarchyInterfaces
Definition index.cpp:79
int annotatedStructsPrinted
Definition index.cpp:81
std::array< int, FileMemberHighlight::Total > documentedFileMembers
Definition index.cpp:94
int documentedDirs
Definition index.cpp:92
std::array< MemberIndexMap, FileMemberHighlight::Total > fileIndexLetterUsed
Definition index.cpp:98
int indexedPages
Definition index.cpp:89
std::array< int, ModuleMemberHighlight::Total > documentedModuleMembers
Definition index.cpp:96
int annotatedClasses
Definition index.cpp:74
int annotatedInterfacesPrinted
Definition index.cpp:78
int hierarchyExceptions
Definition index.cpp:84
int documentedFiles
Definition index.cpp:90
int documentedNamespaces
Definition index.cpp:86
std::array< int, NamespaceMemberHighlight::Total > documentedNamespaceMembers
Definition index.cpp:95
int documentedGroups
Definition index.cpp:85
std::array< int, ClassMemberHighlight::Total > documentedClassMembers
Definition index.cpp:93
std::array< MemberIndexMap, NamespaceMemberHighlight::Total > namespaceIndexLetterUsed
Definition index.cpp:99
int annotatedClassesPrinted
Definition index.cpp:75
int hierarchyClasses
Definition index.cpp:76
Represents of a member declaration list with configurable title and subtitle.
Definition layout.h:112
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
Base class for the layout of a navigation item at the top of the HTML pages.
Definition layout.h:156
const LayoutNavEntryList & children() const
Definition layout.h:219
LayoutNavEntry * find(LayoutNavEntry::Kind k, const DString &file=DString()) const
Definition layout.cpp:134
DString intro() const
Definition layout.h:217
DString title() const
Definition layout.h:216
DString url() const
Definition layout.cpp:152
DString baseFile() const
Definition layout.h:214
Kind kind() const
Definition layout.h:213
bool visible() const
Definition layout.h:222
Kind
Definition layout.h:193
Helper class representing a module member in the navigation menu.
Definition index.cpp:3703
MmhlInfo(const char *fn, const DString &t)
Definition index.cpp:3704
DString title
Definition index.cpp:3706
const char * fname
Definition index.cpp:3705
Helper class representing a namespace member in the navigation menu.
Definition index.cpp:3518
const char * fname
Definition index.cpp:3520
DString title
Definition index.cpp:3521
NmhlInfo(const char *fn, const DString &t)
Definition index.cpp:3519
SrcLangExt
Definition types.h:207
std::string convertUTF8ToUpper(const std::string &input)
Converts the input string into a upper case version, also taking into account non-ASCII characters th...
Definition utf8.cpp:193
std::string convertUTF8ToLower(const std::string &input)
Converts the input string into a lower case version, also taking into account non-ASCII characters th...
Definition utf8.cpp:188
std::string getUTF8CharAt(const std::string &input, size_t pos)
Returns the UTF8 character found at byte position pos in the input string.
Definition utf8.cpp:128
Various UTF8 related helper functions.
bool isURL(const DString &url)
Checks whether the given url starts with a supported protocol.
Definition util.cpp:4648
bool mainPageHasTitle()
Definition util.cpp:4961
DString filterTitle(const DString &title)
Definition util.cpp:4456
DString correctURL(const DString &url, const DString &relPath)
Corrects URL url according to the relative path relPath.
Definition util.cpp:4661
DString convertToJSString(const DString &s, bool keepEntities, bool singleQuotes)
Definition util.cpp:3353
DString convertToId(const DString &s)
Definition util.cpp:3204
DString convertToHtml(const DString &s, bool keepEntities)
Definition util.cpp:3293
void addHtmlExtensionIfMissing(DString &fName)
Definition util.cpp:3933
void extractNamespaceName(const DString &scopeName, DString &className, DString &namespaceName, bool allowEmptyClass)
Definition util.cpp:3028
int getPrefixIndex(const DString &name)
Definition util.cpp:2653
DString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Definition util.cpp:4631
DString getDotImageExtension()
Definition util.cpp:4966
DString stripFromPath(const DString &path)
Definition util.cpp:221
A bunch of utility functions.