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