Doxygen
Loading...
Searching...
No Matches
namespacedef.cpp
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Copyright (C) 1997-2015 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// own header
17#include "namespacedef.h"
18
19// other includes
20#include "classdef.h"
21#include "classlist.h"
22#include "conceptdef.h"
23#include "config.h"
24#include "definitionimpl.h"
25#include "docparser.h"
26#include "doxygen.h"
27#include "language.h"
28#include "layout.h"
29#include "membergroup.h"
30#include "memberlist.h"
31#include "membername.h"
32#include "message.h"
33#include "outputlist.h"
34#include "util.h"
35
36//------------------------------------------------------------------
37static DString makeDisplayName(const NamespaceDef *nd,bool includeScope)
38{
39 DString result=includeScope ? nd->name() : nd->localName();
40 SrcLangExt lang = nd->getLanguage();
42 if (sep!="::")
43 {
44 result = substitute(result,"::",sep);
45 }
46 if (nd->isAnonymous())
47 {
48 result = removeAnonymousScopes(result);
49 }
50 //printf("makeDisplayName() %s->%s lang=%d\n",qPrint(name()),qPrint(result),lang);
51 return result;
52}
53//------------------------------------------------------------------
54
55class NamespaceDefImpl final : public DefinitionMixin<NamespaceDefMutable>
56{
57 public:
58 NamespaceDefImpl(const DString &defFileName,int defLine,size_t defColumn,
59 const DString &name,const DString &ref=DString(),
60 const DString &refFile=DString(),const DString &type=DString(),
61 bool isPublished=false);
62 ~NamespaceDefImpl() override;
64
65 DefType definitionType() const override { return TypeNamespace; }
67 { return getLanguage()==SrcLangExt::Java ? CodeSymbolType::Package : CodeSymbolType::Namespace; }
68 DString getOutputFileBase() const override;
69 DString anchor() const override { return DString(); }
70 void insertUsedFile(FileDef *fd) override;
71 void writeDocumentation(OutputList &ol) override;
72 void writeMemberPages(OutputList &ol) override;
73 void writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const override;
74 void writeTagFile(TextStream &) override;
75 void insertClass(ClassDef *cd) override;
76 void insertConcept(ConceptDef *cd) override;
77 void insertNamespace(NamespaceDef *nd) override;
78 void insertMember(MemberDef *md) override;
79 void computeAnchors() override;
80 void countMembers() override;
81 int numDocMembers() const override;
82 void addUsingDirective(NamespaceDef *nd) override;
84 void addUsingDeclaration(const Definition *cd) override;
86 void combineUsingRelations(NamespaceDefSet &visitedNamespace) override;
87 DString displayName(bool=true) const override;
88 void setInline(bool isInline) override { m_inline = isInline; }
89 bool isConstantGroup() const override { return CONSTANT_GROUP == m_type; }
90 bool isModule() const override { return NAMESPACE == m_type || MODULE == m_type; }
91 bool isLibrary() const override { return LIBRARY == m_type; }
92 bool isInline() const override { return m_inline; }
93 bool isLinkableInProject() const override;
94 bool isLinkable() const override;
95 bool isVisibleInHierarchy() const override;
96 bool hasDetailedDescription() const override;
97 void addMembersToMemberGroup() override;
99 void findSectionsInDocumentation() override;
100 void sortMemberLists() override;
101 const Definition *findInnerCompound(const DString &name) const override;
102 void addInnerCompound(Definition *d) override;
103 void addListReferences() override;
104 void addRequirementReferences() override;
105 void setFileName(const DString &fn) override;
106 bool subGrouping() const override { return m_subGrouping; }
107 MemberList *getMemberList(MemberListType lt) const override;
108 const MemberLists &getMemberLists() const override { return m_memberLists; }
109 const MemberDef *getMemberByName(const DString &) const override;
110 const MemberGroupList &getMemberGroups() const override { return m_memberGroups; }
111 ClassLinkedRefMap getClasses() const override { return m_classes; }
112 ClassLinkedRefMap getInterfaces() const override { return m_interfaces; }
113 ClassLinkedRefMap getStructs() const override { return m_structs; }
114 ClassLinkedRefMap getExceptions() const override { return m_exceptions; }
116 ConceptLinkedRefMap getConcepts() const override { return m_concepts; }
117 void setName(const DString &name) override;
118
119 DString title() const override;
120 DString compoundTypeString() const override;
121
122 void setMetaData(const DString &m) override;
123 int countVisibleMembers() const override;
124 void writeSummaryLinks(OutputList &ol) const override;
125 void writePageNavigation(OutputList &ol) const override;
126
127 private:
136 void writeConcepts(OutputList &ol,const DString &title);
145 void setFileNameLocal(const DString &fn);
146
148 bool isConstantGroup=false);
149 void updateLocalName();
150
153
157
167 bool m_subGrouping = false;
169 bool m_isPublished = false;
171 bool m_inline = false;
172};
173
174std::unique_ptr<NamespaceDef> createNamespaceDef(const DString &defFileName,int defLine,size_t defColumn,
175 const DString &name,const DString &ref,
176 const DString &refFile,const DString &type,
177 bool isPublished)
178{
179 //printf("createNamespaceDef(%s)\n",qPrint(name));
180 return std::make_unique<NamespaceDefImpl>(defFileName,defLine,defColumn,name,ref,refFile,type,isPublished);
181}
182
183//------------------------------------------------------------------
184
185class NamespaceDefAliasImpl final : public DefinitionAliasMixin<NamespaceDef>
186{
187 public:
189 : DefinitionAliasMixin(newScope,nd) { init(); }
192
193 DefType definitionType() const override { return TypeNamespace; }
194
195 const NamespaceDef *getNSAlias() const { return toNamespaceDef(getAlias()); }
196
197 // ---- getters
199 { return getNSAlias()->codeSymbolType(); }
200 DString getOutputFileBase() const override
201 { return getNSAlias()->getOutputFileBase(); }
202 DString anchor() const override
203 { return getNSAlias()->anchor(); }
204 int numDocMembers() const override
205 { return getNSAlias()->numDocMembers(); }
207 { return getNSAlias()->getUsedNamespaces(); }
210 DString displayName(bool b=true) const override
211 { return makeDisplayName(this,b); }
212 const DString &localName() const override
213 { return getNSAlias()->localName(); }
214 bool isConstantGroup() const override
215 { return getNSAlias()->isConstantGroup(); }
216 bool isModule() const override
217 { return getNSAlias()->isModule(); }
218 bool isLibrary() const override
219 { return getNSAlias()->isLibrary(); }
220 bool isInline() const override
221 { return getNSAlias()->isInline(); }
222 bool isLinkableInProject() const override
223 { return getNSAlias()->isLinkableInProject(); }
224 bool isLinkable() const override
225 { return getNSAlias()->isLinkable(); }
226 bool isVisibleInHierarchy() const override
227 { return getNSAlias()->isVisibleInHierarchy(); }
228 bool hasDetailedDescription() const override
229 { return getNSAlias()->hasDetailedDescription(); }
230 const Definition *findInnerCompound(const DString &name) const override
231 { return getNSAlias()->findInnerCompound(name); }
232 bool subGrouping() const override
233 { return getNSAlias()->subGrouping(); }
235 { return getNSAlias()->getMemberList(lt); }
236 const MemberLists &getMemberLists() const override
237 { return getNSAlias()->getMemberLists(); }
238 const MemberDef *getMemberByName(const DString &name) const override
239 { return getNSAlias()->getMemberByName(name); }
240 const MemberGroupList &getMemberGroups() const override
241 { return getNSAlias()->getMemberGroups(); }
243 { return getNSAlias()->getClasses(); }
245 { return getNSAlias()->getInterfaces(); }
247 { return getNSAlias()->getStructs(); }
249 { return getNSAlias()->getExceptions(); }
251 { return getNSAlias()->getNamespaces(); }
253 { return getNSAlias()->getConcepts(); }
254 DString title() const override
255 { return getNSAlias()->title(); }
257 { return getNSAlias()->compoundTypeString(); }
258 int countVisibleMembers() const override
259 { return getNSAlias()->countVisibleMembers(); }
260};
261
262std::unique_ptr<NamespaceDef> createNamespaceDefAlias(const Definition *newScope,const NamespaceDef *nd)
263{
264 auto alnd = std::make_unique<NamespaceDefAliasImpl>(newScope,nd);
265 //printf("alnd name=%s localName=%s qualifiedName=%s displayName()=%s\n",
266 // qPrint(alnd->name()),qPrint(alnd->localName()),qPrint(alnd->qualifiedName()),
267 // qPrint(alnd->displayName()));
268 return alnd;
269}
270
271//------------------------------------------------------------------
272
274 const DString &name,const DString &lref,
275 const DString &fName, const DString &type,
276 bool isPublished) :
277 DefinitionMixin(df,dl,dc,name)
278 ,m_isPublished(isPublished)
279{
280 if (!fName.empty())
281 {
282 if (!lref.empty())
283 {
284 fileName = stripExtension(fName);
285 }
286 else
287 {
288 fileName = convertNameToFile(stripExtension(fName));
289 }
290 }
291 else
292 {
293 setFileNameLocal(name);
294 }
295 setReference(lref);
296 m_inline=false;
297 m_subGrouping=Config_getBool(SUBGROUPING);
298 if (type=="module")
299 {
300 m_type = MODULE;
301 }
302 else if (type=="constants")
303 {
304 m_type = CONSTANT_GROUP;
305 }
306 else if (type=="library")
307 {
308 m_type = LIBRARY;
309 }
310 else
311 {
312 m_type = NAMESPACE;
313 }
314
315 updateLocalName();
316}
317
319{
320 DString locName=name();
321 if (size_t i=locName.rfind("::"); i!=DString::npos) locName=locName.mid(i+2);
322 setLocalName(locName);
323}
324
330
334
336{
337 if (isReference())
338 {
339 fileName = "namespace"+fn;
340 }
341 else
342 {
343 fileName = convertNameToFile("namespace"+fn);
344 }
345}
346
348{
350}
351
353{
354 for (const auto &mg : m_memberGroups)
355 {
356 mg->distributeMemberGroupDocumentation();
357 }
358}
359
361{
365 for (const auto &mg : m_memberGroups)
366 {
367 mg->findSectionsInDocumentation(this);
368 }
369 for (auto &ml : m_memberLists)
370 {
371 if (ml->listType().isDeclaration())
372 {
373 ml->findSectionsInDocumentation(this);
374 }
375 }
376}
377
379{
380 if (fd==nullptr) return;
381 auto it = std::find(files.begin(),files.end(),fd);
382 if (it==files.end())
383 {
384 files.push_back(fd);
385 }
386}
387
389{
390 //printf("%s:NamespaceDefImpl::addInnerCompound(%s)\n",qPrint(name()),qPrint(d->name()));
393 {
395 }
397 {
399 }
401 {
403 }
404}
405
407{
409
410 if (Config_getBool(OPTIMIZE_OUTPUT_SLICE))
411 {
413 {
414 d = &m_interfaces;
415 }
416 else if (cd->compoundType()==ClassDef::Struct)
417 {
418 d = &m_structs;
419 }
420 else if (cd->compoundType()==ClassDef::Exception)
421 {
422 d = &m_exceptions;
423 }
424 }
425
426 d->add(cd->name(),cd);
427}
428
433
438
439
441{
442 for (auto &ml : m_memberLists)
443 {
444 if (ml->listType().isDeclaration())
445 {
447 }
448 }
449
450 // add members inside sections to their groups
451 for (const auto &mg : m_memberGroups)
452 {
453 if (mg->allMembersInSameSection() && m_subGrouping)
454 {
455 //printf("----> addToDeclarationSection(%s)\n",qPrint(mg->header()));
456 mg->addToDeclarationSection();
457 }
458 }
459}
460
462{
463 //printf("%s::insertMember(%s) isInline=%d hasDocs=%d\n",qPrint(name()),qPrint(md->name()),
464 // isInline(),hasDocumentation());
465 if (md->isHidden()) return;
467
468 // if this is an inline namespace that is not documented, then insert the
469 // member in the parent scope instead
470 if (isInline() && !hasDocumentation())
471 {
472 Definition *outerScope = getOuterScope();
473 if (outerScope)
474 {
475 if (outerScope->definitionType()==Definition::TypeNamespace)
476 {
478 if (nd && nd!=Doxygen::globalScope)
479 {
480 nd->insertMember(md);
481 if (mdm)
482 {
483 mdm->setNamespace(nd);
484 }
485 }
486 }
487 else if (outerScope->definitionType()==Definition::TypeFile)
488 {
489 FileDef *fd = toFileDef(outerScope);
490 fd->insertMember(md);
491 if (mdm)
492 {
493 mdm->setFileDef(fd);
494 mdm->setOuterScope(fd);
495 }
496 }
497 }
498 }
499 else // member is a non-inline namespace or a documented inline namespace
500 {
501 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
502 if (allMemberList==nullptr)
503 {
504 m_memberLists.emplace_back(std::make_unique<MemberList>(MemberListType::AllMembersList(),MemberListContainer::Namespace));
505 allMemberList = m_memberLists.back().get();
506 }
507 allMemberList->push_back(md);
508 //printf("%s::m_allMembersDict->append(%s)\n",qPrint(name()),qPrint(md->localName()));
509 m_allMembers.add(md->localName(),md);
510 switch(md->memberType())
511 {
512 case MemberType::Variable:
513 addMemberToList(MemberListType::DecVarMembers(),md);
514 addMemberToList(MemberListType::DocVarMembers(),md);
515 break;
516 case MemberType::Function:
517 addMemberToList(MemberListType::DecFuncMembers(),md);
518 addMemberToList(MemberListType::DocFuncMembers(),md);
519 break;
520 case MemberType::Typedef:
521 addMemberToList(MemberListType::DecTypedefMembers(),md);
522 addMemberToList(MemberListType::DocTypedefMembers(),md);
523 break;
524 case MemberType::Sequence:
525 addMemberToList(MemberListType::DecSequenceMembers(),md);
526 addMemberToList(MemberListType::DocSequenceMembers(),md);
527 break;
528 case MemberType::Dictionary:
529 addMemberToList(MemberListType::DecDictionaryMembers(),md);
530 addMemberToList(MemberListType::DocDictionaryMembers(),md);
531 break;
532 case MemberType::Enumeration:
533 addMemberToList(MemberListType::DecEnumMembers(),md);
534 addMemberToList(MemberListType::DocEnumMembers(),md);
535 break;
536 case MemberType::EnumValue:
537 break;
538 case MemberType::Define:
539 addMemberToList(MemberListType::DecDefineMembers(),md);
540 addMemberToList(MemberListType::DocDefineMembers(),md);
541 break;
542 case MemberType::Property:
543 if (md->getLanguage() == SrcLangExt::Python)
544 {
545 addMemberToList(MemberListType::PropertyMembers(),md);
546 addMemberToList(MemberListType::Properties(),md);
547 break;
548 }
549 // fallthrough, explicitly no break here
550 default:
551 err("NamespaceDefImpl::insertMembers(): "
552 "member '{}' with unexpected type '{}' and class scope '{}' inserted in namespace scope '{}'!\n",
553 md->name(), md->memberTypeName(), md->getClassDef() ? md->getClassDef()->name() : "", name());
554 }
555 // if this is an inline namespace, then insert an alias of this member in the outer scope.
556 if (isInline())
557 {
558 Definition *outerScope = getOuterScope();
559 if (outerScope)
560 {
561 std::unique_ptr<MemberDef> aliasMd = createMemberDefAlias(outerScope,md);
562 if (outerScope->definitionType()==Definition::TypeNamespace)
563 {
565 if (ndm)
566 {
567 ndm->insertMember(aliasMd.get());
568 }
569 }
570 else if (outerScope->definitionType()==Definition::TypeFile)
571 {
572 toFileDef(outerScope)->insertMember(aliasMd.get());
573 }
574 if (aliasMd)
575 {
577 mn->push_back(std::move(aliasMd));
578 }
579 }
580 }
581 }
582}
583
585{
586 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
587 if (allMemberList) allMemberList->setAnchors();
588}
589
591{
592 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
593 return ((!briefDescription().empty() && repeatBrief) ||
594 !documentation().empty());
595}
596
598{
601 tagFile << " <compound kind=\"namespace\">\n";
602 tagFile << " <name>" << convertToXML(name()) << "</name>\n";
603 tagFile << " <filename>" << fn << "</filename>\n";
604 DString idStr = id();
605 if (!idStr.empty())
606 {
607 tagFile << " <clangid>" << convertToXML(idStr) << "</clangid>\n";
608 }
609 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
610 {
611 switch (lde->kind())
612 {
613 case LayoutDocEntry::NamespaceNestedNamespaces:
614 {
615 for (const auto &nd : m_namespaces)
616 {
617 if (nd->isLinkableInProject())
618 {
619 tagFile << " <namespace>" << convertToXML(nd->name()) << "</namespace>\n";
620 }
621 }
622 }
623 break;
624 case LayoutDocEntry::NamespaceClasses:
625 {
627 }
628 break;
629 case LayoutDocEntry::NamespaceInterfaces:
630 {
632 }
633 break;
634 case LayoutDocEntry::NamespaceStructs:
635 {
637 }
638 break;
639 case LayoutDocEntry::NamespaceExceptions:
640 {
642 }
643 break;
644 case LayoutDocEntry::NamespaceConcepts:
645 {
646 writeConceptsToTagFile(tagFile);
647 }
648 break;
649 case LayoutDocEntry::MemberDecl:
650 {
651 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
652 if (lmd)
653 {
654 MemberList * ml = getMemberList(lmd->type);
655 if (ml)
656 {
657 ml->writeTagFile(tagFile);
658 }
659 }
660 }
661 break;
662 case LayoutDocEntry::MemberGroups:
663 {
664 for (const auto &mg : m_memberGroups)
665 {
666 mg->writeTagFile(tagFile);
667 }
668 }
669 break;
670 default:
671 break;
672 }
673 }
675 tagFile << " </compound>\n";
676}
677
679{
681 {
684 ol.writeRuler();
688 ol.writeAnchor(DString(),"details");
690 ol.startGroupHeader("details");
691 ol.parseText(title);
692 ol.endGroupHeader();
693
694 ol.startTextBlock();
695 if (!briefDescription().empty() && Config_getBool(REPEAT_BRIEF))
696 {
698 briefLine(),
699 this,
700 nullptr,
702 DocOptions());
703 }
704 if (!briefDescription().empty() && Config_getBool(REPEAT_BRIEF) &&
705 !documentation().empty())
706 {
710 ol.enableAll();
713 ol.writeString("\n\n");
715 }
716 if (!documentation().empty())
717 {
718 ol.generateDoc(docFile(),
719 docLine(),
720 this,
721 nullptr,
722 documentation()+"\n",
723 DocOptions()
724 .setIndexWords(true));
725 }
727 ol.endTextBlock();
728 }
729}
730
732{
734 {
735 auto parser { createDocParser() };
736 auto ast { validatingParseDoc(*parser.get(),
737 briefFile(),
738 briefLine(),
739 this,
740 nullptr,
742 DocOptions()
743 .setIndexWords(true)
744 .setSingleLine(true))
745 };
746 if (!ast->empty())
747 {
748 ol.startParagraph();
751 ol.writeString(" - ");
753 ol.writeDoc(ast.get(),this,nullptr);
756 ol.writeString(" \n");
758
760 {
762 ol.startTextLink(getOutputFileBase(),"details");
764 ol.endTextLink();
765 }
767 ol.endParagraph();
768 }
769 }
770
771 // Write a summary of the Slice definition including metadata.
772 if (getLanguage() == SrcLangExt::Slice)
773 {
774 ol.startParagraph();
775 ol.startTypewriter();
776 if (!metaData.empty())
777 {
778 ol.docify(metaData);
779 ol.lineBreak();
780 }
781 ol.docify("module ");
782 ol.docify(stripScope(name()));
783 ol.docify(" { ... }");
784 ol.endTypewriter();
785 ol.endParagraph();
786 }
787
788 ol.writeSynopsis();
789}
790
795
800
802{
803 if (Config_getBool(SEPARATE_MEMBER_PAGES))
804 {
807 }
808}
809
811{
812 if (Config_getBool(SEPARATE_MEMBER_PAGES))
813 {
816 }
817}
818
823
828
833
839
841{
842 /* write user defined member groups */
843 for (const auto &mg : m_memberGroups)
844 {
845 if (!mg->allMembersInSameSection() || !m_subGrouping)
846 {
847 mg->writeDeclarations(ol,nullptr,this,nullptr,nullptr,nullptr);
848 }
849 }
850}
851
853{
854 // write Author section (Man only)
857 ol.startGroupHeader();
858 ol.parseText(theTranslator->trAuthor(true,true));
859 ol.endGroupHeader();
862}
863
865{
868 bool first=true;
869 SrcLangExt lang = getLanguage();
870 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
871 {
872 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
873 if (lde->kind()==LayoutDocEntry::NamespaceClasses && m_classes.declVisible() && ls)
874 {
875 DString label = "nested-classes";
876 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
877 first=false;
878 }
879 else if (lde->kind()==LayoutDocEntry::NamespaceInterfaces && m_interfaces.declVisible() && ls)
880 {
881 DString label = "interfaces";
882 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
883 first=false;
884 }
885 else if (lde->kind()==LayoutDocEntry::NamespaceStructs && m_structs.declVisible() && ls)
886 {
887 DString label = "structs";
888 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
889 first=false;
890 }
891 else if (lde->kind()==LayoutDocEntry::NamespaceExceptions && m_exceptions.declVisible() && ls)
892 {
893 DString label = "exceptions";
894 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
895 first=false;
896 }
897 else if (lde->kind()==LayoutDocEntry::NamespaceNestedNamespaces && m_namespaces.declVisible(false) && ls)
898 {
899 DString label = "namespaces";
900 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
901 first=false;
902 }
903 else if (lde->kind()==LayoutDocEntry::NamespaceNestedConstantGroups && m_namespaces.declVisible(true) && ls)
904 {
905 DString label = "constantgroups";
906 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
907 first=false;
908 }
909 else if (lde->kind()==LayoutDocEntry::NamespaceConcepts && m_concepts.declVisible() && ls)
910 {
911 DString label = "concepts";
912 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
913 first=false;
914 }
915 else if (lde->kind()== LayoutDocEntry::MemberDecl)
916 {
917 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
918 if (lmd)
919 {
920 MemberList * ml = getMemberList(lmd->type);
921 if (ml && ml->declVisible())
922 {
923 ol.writeSummaryLink(DString(),ml->listType().toLabel(),lmd->title(lang),first);
924 first=false;
925 }
926 }
927 }
928 }
929 if (!first)
930 {
931 ol.writeString(" </div>\n");
932 }
934}
935
940
942{
943 // UNO IDL constant groups may be published
944 if (getLanguage()==SrcLangExt::IDL && isConstantGroup() && m_isPublished)
945 {
948 ol.startLabels();
949 ol.writeLabel("published",false);
950 ol.endLabels();
952 }
953 else if (isExported())
954 {
957 ol.startLabels();
958 ol.writeLabel("export",false);
959 ol.endLabels();
961 }
962}
963
965{
966 for (const auto &cd : list)
967 {
968 if (cd->isLinkableInProject())
969 {
970 tagFile << " <class kind=\"" << cd->compoundTypeString()
971 << "\">" << convertToXML(cd->name()) << "</class>\n";
972 }
973 }
974}
975
977{
978 for (const auto &cd : m_concepts)
979 {
980 if (cd->isLinkableInProject())
981 {
982 tagFile << " <concept>" << convertToXML(cd->name()) << "</concept>\n";
983 }
984 }
985}
986
988{
989 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
990 //bool outputJava = Config_getBool(OPTIMIZE_OUTPUT_JAVA);
991 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
992
993 DString pageTitle = title();
994 startFile(ol,getOutputFileBase(),false,name(),pageTitle,HighlightedItem::NamespaceVisible,!generateTreeView);
995
996 if (!generateTreeView)
997 {
999 {
1001 }
1002 ol.endQuickIndices();
1003 }
1004
1005 startTitle(ol,getOutputFileBase(),this);
1006 ol.parseText(pageTitle);
1007 addGroupListToTitle(ol,this);
1010 ol.startContents();
1011
1012 //---------------------------------------- start flexible part -------------------------------
1013
1014 SrcLangExt lang = getLanguage();
1015 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
1016 {
1017 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
1018 switch (lde->kind())
1019 {
1020 case LayoutDocEntry::BriefDesc:
1022 break;
1023 case LayoutDocEntry::MemberDeclStart:
1025 break;
1026 case LayoutDocEntry::NamespaceClasses:
1027 {
1028 if (ls) writeClassDeclarations(ol,ls->title(lang),m_classes);
1029 }
1030 break;
1031 case LayoutDocEntry::NamespaceInterfaces:
1032 {
1033 if (ls) writeClassDeclarations(ol,ls->title(lang),m_interfaces);
1034 }
1035 break;
1036 case LayoutDocEntry::NamespaceStructs:
1037 {
1038 if (ls) writeClassDeclarations(ol,ls->title(lang),m_structs);
1039 }
1040 break;
1041 case LayoutDocEntry::NamespaceExceptions:
1042 {
1043 if (ls) writeClassDeclarations(ol,ls->title(lang),m_exceptions);
1044 }
1045 break;
1046 case LayoutDocEntry::NamespaceConcepts:
1047 {
1048 if (ls) writeConcepts(ol,ls->title(lang));
1049 }
1050 break;
1051 case LayoutDocEntry::NamespaceNestedNamespaces:
1052 {
1053 if (ls) writeNamespaceDeclarations(ol,ls->title(lang),false);
1054 }
1055 break;
1056 case LayoutDocEntry::NamespaceNestedConstantGroups:
1057 {
1058 if (ls) writeNamespaceDeclarations(ol,ls->title(lang),true);
1059 }
1060 break;
1061 case LayoutDocEntry::MemberGroups:
1063 break;
1064 case LayoutDocEntry::MemberDecl:
1065 {
1066 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
1067 if (lmd) writeMemberDeclarations(ol,lmd->type,lmd->title(lang));
1068 }
1069 break;
1070 case LayoutDocEntry::MemberDeclEnd:
1072 break;
1073 case LayoutDocEntry::DetailedDesc:
1074 {
1075 if (ls) writeDetailedDescription(ol,ls->title(lang));
1076 }
1077 break;
1078 case LayoutDocEntry::MemberDefStart:
1080 break;
1081 case LayoutDocEntry::NamespaceInlineClasses:
1083 break;
1084 case LayoutDocEntry::MemberDef:
1085 {
1086 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
1087 if (lmd) writeMemberDocumentation(ol,lmd->type,lmd->title(lang));
1088 }
1089 break;
1090 case LayoutDocEntry::MemberDefEnd:
1092 break;
1093 case LayoutDocEntry::AuthorSection:
1095 break;
1096 case LayoutDocEntry::ClassIncludes:
1097 case LayoutDocEntry::ClassInheritanceGraph:
1098 case LayoutDocEntry::ClassNestedClasses:
1099 case LayoutDocEntry::ClassCollaborationGraph:
1100 case LayoutDocEntry::ClassAllMembersLink:
1101 case LayoutDocEntry::ClassUsedFiles:
1102 case LayoutDocEntry::ClassInlineClasses:
1103 case LayoutDocEntry::ConceptDefinition:
1104 case LayoutDocEntry::FileClasses:
1105 case LayoutDocEntry::FileConcepts:
1106 case LayoutDocEntry::FileInterfaces:
1107 case LayoutDocEntry::FileStructs:
1108 case LayoutDocEntry::FileExceptions:
1109 case LayoutDocEntry::FileNamespaces:
1110 case LayoutDocEntry::FileConstantGroups:
1111 case LayoutDocEntry::FileIncludes:
1112 case LayoutDocEntry::FileIncludeGraph:
1113 case LayoutDocEntry::FileIncludedByGraph:
1114 case LayoutDocEntry::FileSourceLink:
1115 case LayoutDocEntry::FileInlineClasses:
1116 case LayoutDocEntry::GroupClasses:
1117 case LayoutDocEntry::GroupConcepts:
1118 case LayoutDocEntry::GroupModules:
1119 case LayoutDocEntry::GroupInlineClasses:
1120 case LayoutDocEntry::GroupNamespaces:
1121 case LayoutDocEntry::GroupDirs:
1122 case LayoutDocEntry::GroupNestedGroups:
1123 case LayoutDocEntry::GroupFiles:
1124 case LayoutDocEntry::GroupGraph:
1125 case LayoutDocEntry::GroupPageDocs:
1126 case LayoutDocEntry::ModuleExports:
1127 case LayoutDocEntry::ModuleClasses:
1128 case LayoutDocEntry::ModuleConcepts:
1129 case LayoutDocEntry::ModuleUsedFiles:
1130 case LayoutDocEntry::DirSubDirs:
1131 case LayoutDocEntry::DirFiles:
1132 case LayoutDocEntry::DirGraph:
1133 err("Internal inconsistency: member '{}' should not be part of "
1134 "LayoutDocManager::Namespace entry list\n",lde->entryToString());
1135 break;
1136 }
1137 }
1138
1139 //---------------------------------------- end flexible part -------------------------------
1140
1141 ol.endContents();
1142
1143 endFileWithNavPath(ol,this);
1144
1145 if (Config_getBool(SEPARATE_MEMBER_PAGES))
1146 {
1147 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
1148 if (allMemberList) allMemberList->sort();
1149 writeMemberPages(ol);
1150 }
1151}
1152
1154{
1155 ol.pushGeneratorState();
1157
1158 for (const auto &ml : m_memberLists)
1159 {
1160 if (ml->listType().isDocumentation())
1161 {
1162 ml->writeDocumentationPage(ol,displayName(),this);
1163 }
1164 }
1165 ol.popGeneratorState();
1166}
1167
1169{
1170 bool createSubDirs=Config_getBool(CREATE_SUBDIRS);
1171
1172 ol.writeString(" <div class=\"navtab\">\n");
1173 ol.writeString(" <table>\n");
1174
1175 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
1176 if (allMemberList)
1177 {
1178 for (const auto &md : *allMemberList)
1179 {
1180 if (md->getNamespaceDef()==this && md->isLinkable() && !md->isEnumValue())
1181 {
1182 if (md->isLinkableInProject())
1183 {
1184 DString fn = md->getOutputFileBase();
1186 if (md==currentMd) // selected item => highlight
1187 {
1188 ol.writeString(" <tr><td class=\"navtabHL\">");
1189 }
1190 else
1191 {
1192 ol.writeString(" <tr><td class=\"navtab\">");
1193 }
1194 ol.writeString("<span class=\"label\"><a ");
1195 ol.writeString("href=\"");
1196 if (createSubDirs) ol.writeString("../../");
1197 ol.writeString(fn+"#"+md->anchor());
1198 ol.writeString("\">");
1199 ol.writeString(convertToHtml(md->localName()));
1200 ol.writeString("</a></span>");
1201 ol.writeString("</td></tr>\n");
1202 }
1203 }
1204 }
1205 }
1206
1207 ol.writeString(" </table>\n");
1208 ol.writeString(" </div>\n");
1209}
1210
1212{
1213 for (auto &ml : m_memberLists)
1214 {
1215 ml->countDecMembers();
1216 ml->countDocMembers();
1217 }
1218 for (const auto &mg : m_memberGroups)
1219 {
1220 mg->countDecMembers();
1221 mg->countDocMembers();
1222 }
1223}
1224
1226{
1227 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
1228 return (allMemberList ? allMemberList->numDocMembers() : 0) + static_cast<int>(m_innerCompounds.size());
1229}
1230
1232{
1234 //printf("%s: NamespaceDefImpl::addUsingDirective: %s:%zu\n",qPrint(name()),qPrint(nd->qualifiedName()),m_usingDirList.size());
1235}
1236
1241
1246
1248{
1249 if (n==nullptr) return nullptr;
1250 const Definition *d = m_innerCompounds.find(n);
1251 if (d==nullptr)
1252 {
1253 if (!m_usingDirList.empty())
1254 {
1255 d = m_usingDirList.find(n);
1256 }
1257 if (d==nullptr && !m_usingDeclList.empty())
1258 {
1259 d = m_usingDeclList.find(n);
1260 }
1261 }
1262 return d;
1263}
1264
1266{
1268 qualifiedName(),
1269 getLanguage()==SrcLangExt::Fortran ?
1270 theTranslator->trModule(true,true) :
1271 theTranslator->trNamespace(true,true),
1273 DString(),
1274 this
1275 );
1276 for (const auto &mg : m_memberGroups)
1277 {
1278 mg->addListReferences(this);
1279 }
1280 for (auto &ml : m_memberLists)
1281 {
1282 if (ml->listType().isDocumentation())
1283 {
1284 ml->addListReferences(this);
1285 }
1286 }
1287}
1288
1290{
1292 for (const auto &mg : m_memberGroups)
1293 {
1294 mg->addRequirementReferences(this);
1295 }
1296 for (auto &ml : m_memberLists)
1297 {
1298 if (ml->listType().isDocumentation())
1299 {
1300 ml->addRequirementReferences(this);
1301 }
1302 }
1303}
1304
1306{
1307 return makeDisplayName(this,includeScope);
1308}
1309
1311{
1312 if (visitedNamespaces.find(this)!=visitedNamespaces.end()) return; // already processed
1313 visitedNamespaces.insert(this);
1314
1316 for (auto &nd : usingDirList)
1317 {
1319 if (ndm)
1320 {
1321 ndm->combineUsingRelations(visitedNamespaces);
1322 }
1323 }
1324
1325 for (auto &nd : usingDirList)
1326 {
1327 // add used namespaces of namespace nd to this namespace
1328 for (const auto &und : nd->getUsedNamespaces())
1329 {
1330 addUsingDirective(und);
1331 }
1332 // add used classes of namespace nd to this namespace
1333 for (const auto &ud : nd->getUsedDefinitions())
1334 {
1336 }
1337 }
1338}
1339
1341{
1342 int count=0;
1343 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
1344 {
1345 if (lde->kind()==LayoutDocEntry::MemberDef)
1346 {
1347 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
1348 if (lmd)
1349 {
1350 MemberList *ml = getMemberList(lmd->type);
1351 if (ml)
1352 {
1353 for (const auto &md : *ml)
1354 {
1355 if (md->visibleInIndex())
1356 {
1357 count++;
1358 }
1359 }
1360 }
1361 }
1362 }
1363 }
1364 return count;
1365}
1366
1367
1368
1369//-------------------------------------------------------------------------------
1370
1371bool NamespaceLinkedRefMap::declVisible(bool isConstantGroup) const
1372{
1373 bool found=false;
1374 for (const auto &nd : *this)
1375 {
1376 if (nd->isLinkable() && nd->hasDocumentation())
1377 {
1378 SrcLangExt lang = nd->getLanguage();
1379 if (SrcLangExt::IDL==lang)
1380 {
1381 if (isConstantGroup == nd->isConstantGroup())
1382 {
1383 found=true;
1384 break;
1385 }
1386 }
1387 else if (!isConstantGroup) // ensure we only get extra section in IDL
1388 {
1389 if (nd->isConstantGroup())
1390 {
1391 err("Internal inconsistency: constant group but not IDL?\n");
1392 }
1393 found=true;
1394 break;
1395 }
1396 }
1397 }
1398 return found;
1399}
1400
1402 bool const isConstantGroup,bool localName)
1403{
1404
1405
1406 if (empty()) return; // no namespaces in the list
1407
1408 if (Config_getBool(OPTIMIZE_OUTPUT_VHDL)) return;
1409
1410 if (!declVisible(isConstantGroup)) return;
1411
1412 // write list of namespaces
1413 ol.startMemberHeader(isConstantGroup ? "constantgroups" : "namespaces");
1414 //bool javaOpt = Config_getBool(OPTIMIZE_OUTPUT_JAVA);
1415 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
1416 ol.parseText(title);
1417 ol.endMemberHeader();
1418 ol.startMemberList();
1419 for (const auto &nd : *this)
1420 {
1421 if (nd->isLinkable() && nd->hasDocumentation())
1422 {
1423 SrcLangExt lang = nd->getLanguage();
1424 if (lang==SrcLangExt::IDL && (isConstantGroup != nd->isConstantGroup()))
1425 continue; // will be output in another pass, see layout_default.xml
1427 DString name = localName ? nd->localName() : nd->displayName();
1428 DString anc = nd->anchor();
1429 if (anc.empty()) anc=name; else anc.prepend(name+"_");
1431 DString ct = nd->compoundTypeString();
1432 ol.docify(ct);
1433 ol.docify(" ");
1434 ol.insertMemberAlign();
1435 ol.writeObjectLink(nd->getReference(),nd->getOutputFileBase(),DString(),name);
1437 if (!nd->briefDescription().empty() && Config_getBool(BRIEF_MEMBER_DESC))
1438 {
1439 ol.startMemberDescription(nd->getOutputFileBase());
1440 ol.generateDoc(nd->briefFile(),
1441 nd->briefLine(),
1442 nd,
1443 nullptr,
1444 nd->briefDescription(),
1445 DocOptions()
1446 .setSingleLine(true));
1448 }
1450 }
1451 }
1452 ol.endMemberList();
1453}
1454
1455//-------------------------------------------------------------------------------
1456
1458{
1459 bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS);
1460 bool sortMemberDocs = Config_getBool(SORT_MEMBER_DOCS);
1462 ml->setNeedsSorting(
1463 (ml->listType().isDeclaration() && sortBriefDocs) ||
1464 (ml->listType().isDocumentation() && sortMemberDocs));
1465 ml->push_back(md);
1466
1467 if (ml->listType().isDeclaration())
1468 {
1470 if (mdm)
1471 {
1472 mdm->setSectionList(this,ml.get());
1473 }
1474 }
1475}
1476
1477template<class Container>
1478bool needsSorting(const Container &container)
1479{
1480 DString prev;
1481 bool allSame = true;
1482 for (const auto &c : container)
1483 {
1484 DString name = c->getDefFileName();
1485 if (!prev.empty() && prev!=name)
1486 {
1487 allSame = false;
1488 break;
1489 }
1490 prev = name;
1491 }
1492 return !allSame || Config_getBool(SORT_BRIEF_DOCS);
1493}
1494
1496{
1497 for (auto &ml : m_memberLists)
1498 {
1499 if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(false); }
1500 }
1501
1502 auto classComp = [](const ClassLinkedRefMap::Ptr &c1,const ClassLinkedRefMap::Ptr &c2)
1503 {
1504 return Config_getBool(SORT_BY_SCOPE_NAME) ?
1505 dstricmp_sort(c1->name(), c2->name())<0 :
1506 dstricmp_sort(c1->className(), c2->className())<0;
1507 };
1508
1509 if (needsSorting(m_classes)) std::stable_sort(m_classes.begin(), m_classes.end(), classComp);
1510 if (needsSorting(m_interfaces)) std::stable_sort(m_interfaces.begin(),m_interfaces.end(),classComp);
1511 if (needsSorting(m_structs)) std::stable_sort(m_structs.begin(), m_structs.end(), classComp);
1512 if (needsSorting(m_exceptions)) std::stable_sort(m_exceptions.begin(),m_exceptions.end(),classComp);
1513
1514 auto conceptComp = [](const ConceptLinkedRefMap::Ptr &c1,const ConceptLinkedRefMap::Ptr &c2)
1515 {
1516 return dstricmp_sort(c1->name(),c2->name())<0;
1517 };
1518
1519 if (needsSorting(m_concepts)) std::stable_sort(m_concepts.begin(), m_concepts.end(), conceptComp);
1520
1521 auto namespaceComp = [](const NamespaceLinkedRefMap::Ptr &n1,const NamespaceLinkedRefMap::Ptr &n2)
1522 {
1523 return dstricmp_sort(n1->name(),n2->name())<0;
1524 };
1525
1526 if (needsSorting(m_namespaces)) std::stable_sort(m_namespaces.begin(),m_namespaces.end(),namespaceComp);
1527
1528}
1529
1531{
1532 for (auto &ml : m_memberLists)
1533 {
1534 if (ml->listType()==lt)
1535 {
1536 return ml.get();
1537 }
1538 }
1539 return nullptr;
1540}
1541
1543{
1544 MemberList * ml = getMemberList(lt);
1545 if (ml) ml->writeDeclarations(ol,nullptr,this,nullptr,nullptr,nullptr,title,DString());
1546}
1547
1553
1554static bool hasNonReferenceNestedNamespaceRec(const NamespaceDef *nd,int level)
1555{
1556 if (level>30)
1557 {
1558 err("Possible recursive namespace relation while inside {}\n",nd->name());
1559 return false;
1560 }
1561 bool found=nd->isLinkableInProject();
1562 if (found)
1563 {
1564 return true;
1565 }
1566 else
1567 {
1568 for (const auto &ind : nd->getNamespaces())
1569 {
1570 found = found || hasNonReferenceNestedNamespaceRec(ind,level+1);
1571 if (found) break;
1572 }
1573 }
1574 return found;
1575}
1576
1578{
1579 bool allExternals = Config_getBool(ALLEXTERNALS);
1580 return allExternals || hasNonReferenceNestedNamespaceRec(this,0) || isLinkable();
1581}
1582
1584{
1585 size_t i = name().rfind("::");
1586 if (i==DString::npos) i=0; else i+=2;
1587 bool extractAnonNs = Config_getBool(EXTRACT_ANON_NSPACES);
1588 bool hideUndoc = Config_getBool(HIDE_UNDOC_NAMESPACES);
1589 if (extractAnonNs && // extract anonymous ns
1590 name().mid(i,20)=="anonymous_namespace{" // correct prefix
1591 ) // not disabled by config
1592 {
1593 return true;
1594 }
1595 return !name().empty() && name().at(i)!='@' && // not anonymous
1596 (hasDocumentation() || !hideUndoc || getLanguage()==SrcLangExt::CSharp) && // documented
1597 !isReference() && // not an external reference
1598 !isHidden() && // not hidden
1599 !isArtificial(); // or artificial
1600}
1601
1603{
1604 return isLinkableInProject() || isReference();
1605}
1606
1608{
1609 return m_allMembers.find(n);
1610}
1611
1613{
1614 DString pageTitle;
1615 SrcLangExt lang = getLanguage();
1616
1617 auto getReferenceTitle = [this](std::function<DString()> translateFunc) -> DString
1618 {
1619 return Config_getBool(HIDE_COMPOUND_REFERENCE) ? displayName() : translateFunc();
1620 };
1621
1622 if (lang==SrcLangExt::Java)
1623 {
1624 pageTitle = theTranslator->trPackage(displayName());
1625 }
1626 else if (lang==SrcLangExt::Fortran || lang==SrcLangExt::Slice)
1627 {
1628 pageTitle = getReferenceTitle([this](){
1630 });
1631 }
1632 else if (lang==SrcLangExt::IDL)
1633 {
1634 pageTitle = getReferenceTitle([this](){
1635 return isConstantGroup()
1638 });
1639 }
1640 else
1641 {
1642 pageTitle = getReferenceTitle([this](){
1644 });
1645 }
1646 return pageTitle;
1647}
1648
1650{
1651 SrcLangExt lang = getLanguage();
1652 if (lang==SrcLangExt::Java)
1653 {
1654 return "package";
1655 }
1656 else if(lang==SrcLangExt::CSharp)
1657 {
1658 return "namespace";
1659 }
1660 else if (lang==SrcLangExt::Fortran)
1661 {
1662 return "module";
1663 }
1664 else if (lang==SrcLangExt::IDL)
1665 {
1666 if (isModule())
1667 {
1668 return "module";
1669 }
1670 else if (isConstantGroup())
1671 {
1672 return "constants";
1673 }
1674 else if (isLibrary())
1675 {
1676 return "library";
1677 }
1678 else
1679 {
1680 err_full(getDefFileName(),getDefLine(),"Internal inconsistency: namespace in IDL not module, library or constant group");
1681 }
1682 }
1683 return "namespace";
1684}
1685
1687{
1688 metaData = m;
1689}
1690
1691// --- Cast functions
1692//
1694{
1695 if (d && (typeid(*d)==typeid(NamespaceDefImpl) || typeid(*d)==typeid(NamespaceDefAliasImpl)))
1696 {
1697 return static_cast<NamespaceDef*>(d);
1698 }
1699 else
1700 {
1701 return nullptr;
1702 }
1703}
1704
1706{
1707 Definition *d = toDefinition(md);
1708 if (d && typeid(*d)==typeid(NamespaceDefImpl))
1709 {
1710 return static_cast<NamespaceDef*>(d);
1711 }
1712 else
1713 {
1714 return nullptr;
1715 }
1716}
1717
1718
1720{
1721 if (d && (typeid(*d)==typeid(NamespaceDefImpl) || typeid(*d)==typeid(NamespaceDefAliasImpl)))
1722 {
1723 return static_cast<const NamespaceDef*>(d);
1724 }
1725 else
1726 {
1727 return nullptr;
1728 }
1729}
1730
1732{
1733 if (d && typeid(*d)==typeid(NamespaceDefImpl))
1734 {
1735 return static_cast<NamespaceDefMutable*>(d);
1736 }
1737 else
1738 {
1739 return nullptr;
1740 }
1741}
1742
1743// --- Helpers
1744
1745static NamespaceDef *getResolvedNamespaceRec(StringSet &namespacesTried,const NamespaceAliasInfo &aliasInfo);
1746
1747static DString replaceNamespaceAliasesRec(StringSet &namespacesTried,const DString &name)
1748{
1749 DString result = name;
1750 //printf("> replaceNamespaceAliasesRec(%s)\n",qPrint(name));
1751 if (namespacesTried.find(name.str())==namespacesTried.end())
1752 {
1753 namespacesTried.insert(name.str());
1754 size_t p = 0;
1755 for (;;)
1756 {
1757 size_t i = name.str().find("::",p);
1758 if (i==std::string::npos)
1759 {
1760 auto it = Doxygen::namespaceAliasMap.find(name.str());
1761 if (it != Doxygen::namespaceAliasMap.end())
1762 {
1763 //printf("found map %s->%s\n",qPrint(name),qPrint(it->second.alias));
1764 auto ns = getResolvedNamespaceRec(namespacesTried,it->second);
1765 if (ns)
1766 {
1767 result = replaceNamespaceAliasesRec(namespacesTried,ns->qualifiedName());
1768 }
1769 }
1770 break;
1771 }
1772 else
1773 {
1774 auto it = Doxygen::namespaceAliasMap.find(name.left(i).str());
1775 if (it != Doxygen::namespaceAliasMap.end())
1776 {
1777 //printf("found map %s|%s->%s\n",qPrint(name.left(i)),qPrint(name.mid(i)),qPrint(it->second.alias));
1778 auto ns = getResolvedNamespaceRec(namespacesTried,it->second);
1779 if (ns)
1780 {
1781 result = replaceNamespaceAliasesRec(namespacesTried,ns->qualifiedName()+name.mid(i));
1782 break;
1783 }
1784 }
1785 }
1786 p = i+2;
1787 }
1788 }
1789 //printf("< replaceNamespaceAliasesRec(%s)=%s\n",qPrint(name),qPrint(result));
1790 return result;
1791}
1792
1793static NamespaceDef *getResolvedNamespaceRec(StringSet &namespacesTried,const NamespaceAliasInfo &aliasInfo)
1794{
1795 size_t j = aliasInfo.context.length();
1796 for (;;)
1797 {
1798 if (j>0)
1799 {
1800 //printf("candidate %s|::%s\n",qPrint(aliasInfo.context.substr(0,j)),qPrint(aliasInfo.alias));
1801 auto candidate = replaceNamespaceAliasesRec(namespacesTried,aliasInfo.context.substr(0,j)+"::"+aliasInfo.alias);
1802 auto nd = Doxygen::namespaceLinkedMap->find(candidate);
1803 if (nd)
1804 {
1805 return nd;
1806 }
1807 }
1808 if (j>0) // strip one level from context, i.e. given N1::N2::N3
1809 // j==10 -> j==6 (N1::N2::N3->N1::N2), and then
1810 // j==6 -> j==2 (N1::N2->N1), and then
1811 // j==2 -> j==std::string::npos (N1->"")
1812 {
1813 j = aliasInfo.context.rfind("::",j-1);
1814 }
1815 else
1816 {
1817 j = std::string::npos;
1818 }
1819 if (j==std::string::npos)
1820 {
1821 //printf("candidate %s\n",qPrint(aliasInfo.alias));
1822 auto candidate = replaceNamespaceAliasesRec(namespacesTried,aliasInfo.alias);
1823 auto nd = Doxygen::namespaceLinkedMap->find(candidate);
1824 if (nd)
1825 {
1826 return nd;
1827 }
1828 break;
1829 }
1830 }
1831 return nullptr;
1832}
1833
1835{
1836 //printf("> replaceNamespaceAliases(%s)\n",qPrint(name));
1837 StringSet namespacesTried;
1838 name = replaceNamespaceAliasesRec(namespacesTried,name);
1839 //printf("< replaceNamespaceAliases: result=%s\n",qPrint(name));
1840}
1841
1843{
1844 //printf("> getResolvedNamespace(%s)\n",qPrint(name));
1845 if (name.empty()) return nullptr;
1846 StringSet namespacesTried;
1847 auto ns = getResolvedNamespaceRec(namespacesTried,NamespaceAliasInfo(name.str()));
1848 //printf("< getResolvedNamespace(%s)=%s\n",qPrint(name),ns?qPrint(ns->qualifiedName()):"nullptr");
1849 return ns;
1850}
1851
1852//--------------------------------------------------------------------------------------
1853//
1855{
1856 for (const auto &cnd : nd->getNamespaces())
1857 {
1858 if (cnd->isLinkableInProject() && !cnd->isAnonymous())
1859 {
1860 return true;
1861 }
1862 }
1863 return false;
1864}
1865
1867{
1868 //printf(">namespaceHasNestedConcept(%s)\n",qPrint(nd->name()));
1869 for (const auto &cnd : nd->getNamespaces())
1870 {
1872 {
1873 //printf("<namespaceHasNestedConcept(%s): case1\n",qPrint(nd->name()));
1874 return true;
1875 }
1876 }
1877 for (const auto &cnd : nd->getConcepts())
1878 {
1879 //printf("candidate %s isLinkableInProject()=%d\n",qPrint(cnd->name()),cnd->isLinkableInProject());
1880 if (cnd->isLinkableInProject())
1881 {
1882 //printf("<namespaceHasNestedConcept(%s): case2\n",qPrint(nd->name()));
1883 return true;
1884 }
1885 }
1886 //printf("<namespaceHasNestedConcept(%s): case3\n",qPrint(nd->name()));
1887 return false;
1888}
1889
1891{
1892 //printf(">namespaceHasNestedClass(%s,filterClasses=%d)\n",qPrint(nd->name()),filterClasses);
1893 for (const auto &cnd : nd->getNamespaces())
1894 {
1895 if (namespaceHasNestedClass(cnd,filterClasses,ct))
1896 {
1897 //printf("<namespaceHasNestedClass(%s,filterClasses=%d): case1\n",qPrint(nd->name()),filterClasses);
1898 return true;
1899 }
1900 }
1901
1902 ClassLinkedRefMap list = nd->getClasses();
1903 if (filterClasses)
1904 {
1905 switch (ct)
1906 {
1908 list = nd->getInterfaces();
1909 break;
1910 case ClassDef::Struct:
1911 list = nd->getStructs();
1912 break;
1914 list = nd->getExceptions();
1915 break;
1916 default:
1917 break;
1918 }
1919 }
1920
1921 for (const auto &cd : list)
1922 {
1923 //printf("candidate %s isLinkableInProject()=%d\n",qPrint(cd->name()),cd->isLinkableInProject());
1924 if (cd->isLinkableInProject())
1925 {
1926 //printf("<namespaceHasNestedClass(%s,filterClasses=%d): case2\n",qPrint(nd->name()),filterClasses);
1927 return true;
1928 }
1929 }
1930 //printf("<namespaceHasNestedClass(%s,filterClasses=%d): case3\n",qPrint(nd->name()),filterClasses);
1931 return false;
1932}
1933
1934
A abstract class representing of a compound symbol.
Definition classdef.h:100
virtual DString className() const =0
Returns the name of the class including outer classes, but not including namespaces.
CompoundType
The various compound types.
Definition classdef.h:105
@ Interface
Definition classdef.h:108
@ Exception
Definition classdef.h:111
virtual CompoundType compoundType() const =0
Returns the type of compound this is, i.e. class/struct/union/...
bool declVisible(const ClassDef::CompoundType *filter=nullptr) const
Definition classlist.cpp:27
void writeDocumentation(OutputList &ol, const Definition *container=nullptr) const
Definition classlist.cpp:72
void writeDeclaration(OutputList &ol, const ClassDef::CompoundType *filter, const DString &header, bool localNames) const
Definition classlist.cpp:51
bool declVisible() const
void writeDeclaration(OutputList &ol, const DString &header, bool localNames) const
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
Definition dstring.h:84
size_t rfind(char c, size_t pos=npos) const
Definition dstring.h:244
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
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
DString left(size_t len) const
Definition dstring.h:306
const std::string & str() const
Definition dstring.h:645
const DString & name() const override
const Definition * getAlias() const
DefinitionAliasMixin(const Definition *scope, const Definition *alias)
The common base class of all entity definitions found in the sources.
Definition definition.h:77
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
virtual bool isLinkable() const =0
virtual DefType definitionType() const =0
virtual const DString & name() const =0
virtual const DString & localName() const =0
virtual bool isLinkableInProject() const =0
virtual bool isAnonymous() const =0
virtual DString qualifiedName() const =0
virtual bool isHidden() const =0
virtual DString anchor() const =0
virtual CodeSymbolType codeSymbolType() const =0
virtual const Definition * findInnerCompound(const DString &name) const =0
virtual DString getOutputFileBase() const =0
DString qualifiedName() const override
void writeNavigationPath(OutputList &ol) const override
DString briefDescription(bool abbreviate=false) const override
const DString & name() const override
void setName(const DString &name) override
void writeRequirementRefs(OutputList &ol) const override
const RefItemVector & xrefListItems() const override
Definition * getOuterScope() const override
DString getDefFileName() const override
DString documentation() const override
DefinitionMixin(const DString &defFileName, int defLine, size_t defColumn, const DString &name, const char *b=nullptr, const char *d=nullptr, bool isSymbol=true)
DString inbodyDocumentation() const override
void setLocalName(const DString &name) override
void writeDocAnchorsToTagFile(TextStream &fs) const override
SrcLangExt getLanguage() const override
virtual void setOuterScope(Definition *d)=0
static NamespaceLinkedMap * namespaceLinkedMap
Definition doxygen.h:108
static bool suppressDocWarnings
Definition doxygen.h:123
static MemberNameLinkedMap * functionNameLinkedMap
Definition doxygen.h:105
static NamespaceDefMutable * globalScope
Definition doxygen.h:114
static NamespaceAliasInfoMap namespaceAliasMap
Definition doxygen.h:106
A model of a file symbol.
Definition filedef.h:97
virtual void insertMember(MemberDef *md)=0
static LayoutDocManager & instance()
Returns a reference to this singleton.
Definition layout.cpp:1437
T * add(const char *k, Args &&... args)
Definition linkedmap.h:90
const T * find(const std::string &key) const
Definition linkedmap.h:47
Container class representing a vector of objects with keys.
Definition linkedmap.h:232
bool add(const char *k, T *obj)
Definition linkedmap.h:284
size_t size() const
Definition linkedmap.h:375
iterator end()
Definition linkedmap.h:367
const T * find(const std::string &key) const
Definition linkedmap.h:243
iterator begin()
Definition linkedmap.h:366
bool empty() const
Definition linkedmap.h:374
A model of a class/file/namespace member symbol.
Definition memberdef.h:45
virtual const ClassDef * getClassDef() const =0
virtual MemberType memberType() const =0
virtual DString memberTypeName() const =0
virtual void setSectionList(const Definition *container, const MemberList *sl)=0
virtual void setFileDef(FileDef *fd)=0
virtual void setNamespace(NamespaceDef *nd)=0
A list of MemberDef objects as shown in documentation sections.
Definition memberlist.h:126
int numDocMembers() const
Definition memberlist.h:139
void writeTagFile(TextStream &, bool useQualifiedName=false, bool showNamespaceMembers=true)
void writeDeclarations(OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod, const DString &title, const DString &subtitle, bool showEnumValues=false, bool showInline=false, const ClassDef *inheritedFrom=nullptr, MemberListType lt=MemberListType::PubMethods(), bool showSectionTitle=true) const
Writes the list of members to the output.
void writeDocumentation(OutputList &ol, const DString &scopeName, const Definition *container, const DString &title, const DString &anchor, bool showEnumValues=false, bool showInline=false) const
MemberListType listType() const
Definition memberlist.h:131
void setAnchors()
bool declVisible() const
Wrapper class for the MemberListType type.
Definition types.h:346
constexpr const char * toLabel() const noexcept
Definition types.h:402
const std::unique_ptr< MemberList > & get(MemberListType lt, MemberListContainer con)
Definition memberlist.h:192
void push_back(Ptr &&p)
Definition membername.h:52
void sort()
Definition memberlist.h:77
void push_back(const T &value)
Definition memberlist.h:49
ClassLinkedRefMap getInterfaces() const override
bool subGrouping() const override
ClassLinkedRefMap getExceptions() const override
DString compoundTypeString() const override
ClassLinkedRefMap getStructs() const override
ConceptLinkedRefMap getConcepts() const override
DString getOutputFileBase() const override
ClassLinkedRefMap getClasses() const override
DefType definitionType() const override
DString displayName(bool b=true) const override
bool isLinkableInProject() const override
const NamespaceDef * getNSAlias() const
const MemberDef * getMemberByName(const DString &name) const override
int numDocMembers() const override
bool isLinkable() const override
const MemberGroupList & getMemberGroups() const override
const LinkedRefMap< const Definition > & getUsedDefinitions() const override
const Definition * findInnerCompound(const DString &name) const override
int countVisibleMembers() const override
~NamespaceDefAliasImpl() override
bool isLibrary() const override
bool hasDetailedDescription() const override
bool isVisibleInHierarchy() const override
MemberList * getMemberList(MemberListType lt) const override
NamespaceDefAliasImpl(const Definition *newScope, const NamespaceDef *nd)
DString anchor() const override
bool isModule() const override
bool isInline() const override
const DString & localName() const override
NamespaceLinkedRefMap getNamespaces() const override
const LinkedRefMap< NamespaceDef > & getUsedNamespaces() const override
DString title() const override
CodeSymbolType codeSymbolType() const override
const MemberLists & getMemberLists() const override
bool isConstantGroup() const override
An abstract interface of a namespace symbol.
virtual bool isLibrary() const =0
virtual MemberList * getMemberList(MemberListType lt) const =0
virtual bool isConstantGroup() const =0
virtual ConceptLinkedRefMap getConcepts() const =0
virtual ClassLinkedRefMap getStructs() const =0
virtual DString compoundTypeString() const =0
virtual const MemberDef * getMemberByName(const DString &) const =0
virtual const LinkedRefMap< NamespaceDef > & getUsedNamespaces() const =0
virtual ClassLinkedRefMap getExceptions() const =0
virtual const MemberLists & getMemberLists() const =0
virtual NamespaceLinkedRefMap getNamespaces() const =0
virtual bool isModule() const =0
virtual DString title() const =0
virtual bool subGrouping() const =0
virtual int countVisibleMembers() const =0
virtual int numDocMembers() const =0
virtual bool hasDetailedDescription() const =0
virtual bool isInline() const =0
virtual bool isVisibleInHierarchy() const =0
virtual ClassLinkedRefMap getClasses() const =0
virtual ClassLinkedRefMap getInterfaces() const =0
virtual const LinkedRefMap< const Definition > & getUsedDefinitions() const =0
virtual const MemberGroupList & getMemberGroups() const =0
MemberGroupList m_memberGroups
void writeQuickMemberLinks(OutputList &ol, const MemberDef *currentMd) const override
void setFileName(const DString &fn) override
bool isConstantGroup() const override
LinkedRefMap< NamespaceDef > m_usingDirList
void addUsingDirective(NamespaceDef *nd) override
const LinkedRefMap< const Definition > & getUsedDefinitions() const override
void writeMemberDocumentation(OutputList &ol, MemberListType lt, const DString &title)
NamespaceLinkedRefMap getNamespaces() const override
DString getOutputFileBase() const override
void computeAnchors() override
NamespaceLinkedRefMap m_namespaces
DString title() const override
void writeConceptsToTagFile(TextStream &)
void writeMemberPages(OutputList &ol) override
DString displayName(bool=true) const override
bool isLibrary() const override
void insertNamespace(NamespaceDef *nd) override
void writeMemberGroups(OutputList &ol)
void addInnerCompound(Definition *d) override
void insertClass(ClassDef *cd) override
int countVisibleMembers() const override
bool isLinkable() const override
void insertConcept(ConceptDef *cd) override
bool isInline() const override
void addMemberToList(MemberListType lt, MemberDef *md)
DString compoundTypeString() const override
MemberLinkedRefMap m_allMembers
DString anchor() const override
void startMemberDeclarations(OutputList &ol)
void setFileNameLocal(const DString &fn)
void writeTagFile(TextStream &) override
void writeAuthorSection(OutputList &ol)
CodeSymbolType codeSymbolType() const override
ClassLinkedRefMap m_structs
ClassLinkedRefMap getClasses() const override
MemberList * getMemberList(MemberListType lt) const override
void endMemberDocumentation(OutputList &ol)
const MemberLists & getMemberLists() const override
ClassLinkedRefMap m_interfaces
const MemberGroupList & getMemberGroups() const override
enum NamespaceDefImpl::@152056333015234071026257214045103374127312105332 m_type
void addRequirementReferences() override
void writeInlineClasses(OutputList &ol)
void writeBriefDescription(OutputList &ol)
~NamespaceDefImpl() override
void combineUsingRelations(NamespaceDefSet &visitedNamespace) override
int numDocMembers() const override
ClassLinkedRefMap m_exceptions
bool subGrouping() const override
bool isModule() const override
const MemberDef * getMemberByName(const DString &) const override
bool isVisibleInHierarchy() const override
void startMemberDocumentation(OutputList &ol)
LinkedRefMap< const Definition > m_usingDeclList
void writeNamespaceDeclarations(OutputList &ol, const DString &title, bool isConstantGroup=false)
bool hasDetailedDescription() const override
ClassLinkedRefMap getInterfaces() const override
void insertUsedFile(FileDef *fd) override
void setMetaData(const DString &m) override
void endMemberDeclarations(OutputList &ol)
const LinkedRefMap< NamespaceDef > & getUsedNamespaces() const override
void writeConcepts(OutputList &ol, const DString &title)
void addMembersToMemberGroup() override
void writeDocumentation(OutputList &ol) override
void findSectionsInDocumentation() override
void addUsingDeclaration(const Definition *cd) override
bool isLinkableInProject() const override
void writeClassDeclarations(OutputList &ol, const DString &title, const ClassLinkedRefMap &d)
NamespaceDefImpl(const DString &defFileName, int defLine, size_t defColumn, const DString &name, const DString &ref=DString(), const DString &refFile=DString(), const DString &type=DString(), bool isPublished=false)
LinkedRefMap< const Definition > m_innerCompounds
ConceptLinkedRefMap getConcepts() const override
void setInline(bool isInline) override
ClassLinkedRefMap getStructs() const override
void addNamespaceAttributes(OutputList &ol)
void distributeMemberGroupDocumentation() override
ClassLinkedRefMap m_classes
const Definition * findInnerCompound(const DString &name) const override
void countMembers() override
void writeMemberDeclarations(OutputList &ol, MemberListType lt, const DString &title)
MemberLists m_memberLists
void insertMember(MemberDef *md) override
ClassLinkedRefMap getExceptions() const override
void writePageNavigation(OutputList &ol) const override
void writeDetailedDescription(OutputList &ol, const DString &title)
void sortMemberLists() override
void setName(const DString &name) override
void addListReferences() override
ConceptLinkedRefMap m_concepts
DefType definitionType() const override
void writeClassesToTagFile(TextStream &, const ClassLinkedRefMap &d)
void writeSummaryLinks(OutputList &ol) const override
virtual void insertMember(MemberDef *md)=0
virtual void combineUsingRelations(NamespaceDefSet &visitedNamespace)=0
void writeDeclaration(OutputList &ol, const DString &title, bool isConstantGroup=false, bool localName=false)
bool declVisible(bool isContantGroup) const
Class representing a list of output generators that are written to in parallel.
Definition outputlist.h:311
void writeDoc(const IDocNodeAST *ast, const Definition *ctx, const MemberDef *md, int sectionLevel=-1)
Definition outputlist.h:379
void startMemberDeclaration()
Definition outputlist.h:565
void parseText(const DString &textStr)
void disable(OutputType o)
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 writeRuler()
Definition outputlist.h:517
void enable(OutputType o)
void endContents()
Definition outputlist.h:616
void endMemberDescription()
Definition outputlist.h:563
void endTextBlock(bool paraBreak=false)
Definition outputlist.h:668
void endMemberDeclaration(const DString &anchor, const DString &inheritId)
Definition outputlist.h:567
void docify(const DString &s)
Definition outputlist.h:433
void startMemberHeader(const DString &anchor, int typ=2)
Definition outputlist.h:465
void lineBreak(const DString &style=DString())
Definition outputlist.h:555
void writeAnchor(const DString &fileName, const DString &name)
Definition outputlist.h:519
void insertMemberAlign(bool templ=false)
Definition outputlist.h:513
void writeString(const DString &text)
Definition outputlist.h:407
void endParagraph()
Definition outputlist.h:405
void startMemberSections()
Definition outputlist.h:457
void startMemberList()
Definition outputlist.h:477
void endTextLink()
Definition outputlist.h:440
void endMemberItem(OutputGenerator::MemberItemType type)
Definition outputlist.h:491
void endMemberList()
Definition outputlist.h:479
void writeSynopsis()
Definition outputlist.h:588
void startTypewriter()
Definition outputlist.h:445
void pushGeneratorState()
void writeSummaryLink(const DString &file, const DString &anchor, const DString &title, bool first)
Definition outputlist.h:610
void disableAllBut(OutputType o)
void startTextBlock(bool dense=false)
Definition outputlist.h:666
void popGeneratorState()
void startTextLink(const DString &file, const DString &anchor)
Definition outputlist.h:438
void endGroupHeader(int extraLevels=0)
Definition outputlist.h:451
void writeLabel(const DString &l, bool isLast)
Definition outputlist.h:736
void endLabels()
Definition outputlist.h:738
void startMemberItem(const DString &anchor, OutputGenerator::MemberItemType type, const DString &id=DString())
Definition outputlist.h:489
void endQuickIndices()
Definition outputlist.h:600
void startMemberDescription(const DString &anchor, const DString &inheritId=DString(), bool typ=false)
Definition outputlist.h:561
void writePageOutline()
Definition outputlist.h:612
void generateDoc(const DString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const DString &docStr, const DocOptions &options)
void startLabels()
Definition outputlist.h:734
void startContents()
Definition outputlist.h:614
void startGroupHeader(const DString &id=DString(), int extraLevels=0)
Definition outputlist.h:449
void enableAll()
void endMemberHeader()
Definition outputlist.h:467
void endTypewriter()
Definition outputlist.h:447
void endMemberSections()
Definition outputlist.h:459
static RequirementManager & instance()
void addRequirementRefsForSymbol(const Definition *symbol)
Text streaming class that buffers data.
Definition textstream.h:36
virtual DString trPackage(const DString &name)=0
virtual DString trNamespace(bool first_capital, bool singular)=0
virtual DString trAuthor(bool first_capital, bool singular)=0
virtual DString trMore()=0
virtual DString trModule(bool first_capital, bool singular)=0
virtual DString trModuleReference(const DString &namespaceName)=0
virtual DString trGeneratedAutomatically(const DString &s)=0
virtual DString trNamespaceReference(const DString &namespaceName)=0
virtual DString trConstantGroupReference(const DString &namespaceName)=0
ClassDef * toClassDef(Definition *d)
ConceptDef * toConceptDef(Definition *d)
#define Config_getBool(name)
Definition config.h:33
#define Config_getString(name)
Definition config.h:32
#define NON_COPYABLE(cls)
Macro to help implementing the rule of 5 for a non-copyable & movable class.
Definition construct.h:37
std::set< std::string > StringSet
Definition containers.h:31
Definition * toDefinition(DefinitionMutable *dm)
DirIterator end(const DirIterator &) noexcept
Definition dir.cpp:181
IDocParserPtr createDocParser()
factory function to create a parser
Definition docparser.cpp:59
void docFindSections(const DString &input, const Definition *d, const DString &fileName)
IDocNodeASTPtr validatingParseDoc(IDocParser &parserIntf, const DString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const DString &input, const DocOptions &options)
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_sort(const char *str1, const char *str2)
Definition dstring.h:67
FileDef * toFileDef(Definition *d)
Definition filedef.cpp:1973
void endTitle(OutputList &ol, const DString &fileName, const DString &name)
Definition index.cpp:398
void endFileWithNavPath(OutputList &ol, const DefinitionMutable *d, bool showPageNavigation)
Definition index.cpp:452
void startTitle(OutputList &ol, const DString &fileName, const DefinitionMutable *def)
Definition index.cpp:388
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:405
@ NamespaceVisible
Definition index.h:91
Translator * theTranslator
Definition language.cpp:76
std::unique_ptr< MemberDef > createMemberDefAlias(const Definition *newScope, const MemberDef *aliasMd)
MemberDefMutable * toMemberDefMutable(Definition *d)
#define err(fmt,...)
Definition message.h:127
#define err_full(file, line, fmt,...)
Definition message.h:132
bool namespaceHasNestedNamespace(const NamespaceDef *nd)
std::unique_ptr< NamespaceDef > createNamespaceDef(const DString &defFileName, int defLine, size_t defColumn, const DString &name, const DString &ref, const DString &refFile, const DString &type, bool isPublished)
Factory method to create new NamespaceDef instance.
bool namespaceHasNestedClass(const NamespaceDef *nd, bool filterClasses, ClassDef::CompoundType ct)
static NamespaceDef * getResolvedNamespaceRec(StringSet &namespacesTried, const NamespaceAliasInfo &aliasInfo)
std::unique_ptr< NamespaceDef > createNamespaceDefAlias(const Definition *newScope, const NamespaceDef *nd)
Factory method to create an alias of an existing namespace.
bool needsSorting(const Container &container)
static DString makeDisplayName(const NamespaceDef *nd, bool includeScope)
static bool hasNonReferenceNestedNamespaceRec(const NamespaceDef *nd, int level)
void replaceNamespaceAliases(DString &name)
NamespaceDef * getResolvedNamespace(const DString &name)
NamespaceDef * toNamespaceDef(Definition *d)
NamespaceDefMutable * toNamespaceDefMutable(Definition *d)
static DString replaceNamespaceAliasesRec(StringSet &namespacesTried, const DString &name)
bool namespaceHasNestedConcept(const NamespaceDef *nd)
std::unordered_set< const NamespaceDef * > NamespaceDefSet
void addRefItem(const RefItemVector &sli, const DString &key, const DString &prefix, const DString &name, const DString &title, const DString &args, const Definition *scope)
Definition reflist.h:136
Helper class to pass options when calling OutputList::generateDoc().
Definition docoptions.h:24
Represents of a member declaration list with configurable title and subtitle.
Definition layout.h:111
MemberListType type
Definition layout.h:117
DString title(SrcLangExt lang) const
Definition layout.cpp:1788
Represents of a member definition list with configurable title.
Definition layout.h:131
MemberListType type
Definition layout.h:136
DString title(SrcLangExt lang) const
Definition layout.cpp:1800
Definition layout.h:101
DString title(SrcLangExt lang) const
Definition layout.cpp:1781
std::string context
Definition doxygen.h:70
std::string alias
Definition doxygen.h:69
CodeSymbolType
Definition types.h:481
SrcLangExt
Definition types.h:207
DString convertNameToFile(const DString &name, bool allowDots, bool allowUnderscore)
Definition util.cpp:2863
void addGroupListToTitle(OutputList &ol, const Definition *d)
Definition util.cpp:3921
DString stripScope(const DString &name)
Definition util.cpp:3109
void createSubDirs(const Dir &d)
Definition util.cpp:2969
DString convertToHtml(const DString &s, bool keepEntities)
Definition util.cpp:3291
void addHtmlExtensionIfMissing(DString &fName)
Definition util.cpp:3931
DString convertToXML(const DString &s, bool keepEntities, const bool citeEntry)
Definition util.cpp:3232
DString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Definition util.cpp:4629
DString removeAnonymousScopes(const DString &str)
Definition util.cpp:98
A bunch of utility functions.