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#include "namespacedef.h"
17#include "outputlist.h"
18#include "util.h"
19#include "language.h"
20#include "classdef.h"
21#include "classlist.h"
22#include "memberlist.h"
23#include "doxygen.h"
24#include "message.h"
25#include "docparser.h"
26#include "searchindex.h"
27#include "vhdldocgen.h"
28#include "layout.h"
29#include "membergroup.h"
30#include "config.h"
31#include "definitionimpl.h"
32#include "membername.h"
33#include "conceptdef.h"
34
35//------------------------------------------------------------------
36static DString makeDisplayName(const NamespaceDef *nd,bool includeScope)
37{
38 DString result=includeScope ? nd->name() : nd->localName();
39 SrcLangExt lang = nd->getLanguage();
41 if (sep!="::")
42 {
43 result = substitute(result,"::",sep);
44 }
45 if (nd->isAnonymous())
46 {
47 result = removeAnonymousScopes(result);
48 }
49 //printf("makeDisplayName() %s->%s lang=%d\n",qPrint(name()),qPrint(result),lang);
50 return result;
51}
52//------------------------------------------------------------------
53
54class NamespaceDefImpl final : public DefinitionMixin<NamespaceDefMutable>
55{
56 public:
57 NamespaceDefImpl(const DString &defFileName,int defLine,size_t defColumn,
58 const DString &name,const DString &ref=DString(),
59 const DString &refFile=DString(),const DString &type=DString(),
60 bool isPublished=false);
61 ~NamespaceDefImpl() override;
63
64 DefType definitionType() const override { return TypeNamespace; }
66 { return getLanguage()==SrcLangExt::Java ? CodeSymbolType::Package : CodeSymbolType::Namespace; }
67 DString getOutputFileBase() const override;
68 DString anchor() const override { return DString(); }
69 void insertUsedFile(FileDef *fd) override;
70 void writeDocumentation(OutputList &ol) override;
71 void writeMemberPages(OutputList &ol) override;
72 void writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const override;
73 void writeTagFile(TextStream &) override;
74 void insertClass(ClassDef *cd) override;
75 void insertConcept(ConceptDef *cd) override;
76 void insertNamespace(NamespaceDef *nd) override;
77 void insertMember(MemberDef *md) override;
78 void computeAnchors() override;
79 void countMembers() override;
80 int numDocMembers() const override;
81 void addUsingDirective(NamespaceDef *nd) override;
83 void addUsingDeclaration(const Definition *cd) override;
85 void combineUsingRelations(NamespaceDefSet &visitedNamespace) override;
86 DString displayName(bool=true) const override;
87 void setInline(bool isInline) override { m_inline = isInline; }
88 bool isConstantGroup() const override { return CONSTANT_GROUP == m_type; }
89 bool isModule() const override { return NAMESPACE == m_type || MODULE == m_type; }
90 bool isLibrary() const override { return LIBRARY == m_type; }
91 bool isInline() const override { return m_inline; }
92 bool isLinkableInProject() const override;
93 bool isLinkable() const override;
94 bool isVisibleInHierarchy() const override;
95 bool hasDetailedDescription() const override;
96 void addMembersToMemberGroup() override;
98 void findSectionsInDocumentation() override;
99 void sortMemberLists() override;
100 const Definition *findInnerCompound(const DString &name) const override;
101 void addInnerCompound(Definition *d) override;
102 void addListReferences() override;
103 void addRequirementReferences() override;
104 void setFileName(const DString &fn) override;
105 bool subGrouping() const override { return m_subGrouping; }
106 MemberList *getMemberList(MemberListType lt) const override;
107 const MemberLists &getMemberLists() const override { return m_memberLists; }
108 const MemberDef *getMemberByName(const DString &) const override;
109 const MemberGroupList &getMemberGroups() const override { return m_memberGroups; }
110 ClassLinkedRefMap getClasses() const override { return m_classes; }
111 ClassLinkedRefMap getInterfaces() const override { return m_interfaces; }
112 ClassLinkedRefMap getStructs() const override { return m_structs; }
113 ClassLinkedRefMap getExceptions() const override { return m_exceptions; }
115 ConceptLinkedRefMap getConcepts() const override { return m_concepts; }
116 void setName(const DString &name) override;
117
118 DString title() const override;
119 DString compoundTypeString() const override;
120
121 void setMetaData(const DString &m) override;
122 int countVisibleMembers() const override;
123 void writeSummaryLinks(OutputList &ol) const override;
124 void writePageNavigation(OutputList &ol) const override;
125
126 private:
135 void writeConcepts(OutputList &ol,const DString &title);
144 void setFileNameLocal(const DString &fn);
145
147 bool isConstantGroup=false);
148 void updateLocalName();
149
152
156
166 bool m_subGrouping = false;
168 bool m_isPublished = false;
170 bool m_inline = false;
171};
172
173std::unique_ptr<NamespaceDef> createNamespaceDef(const DString &defFileName,int defLine,size_t defColumn,
174 const DString &name,const DString &ref,
175 const DString &refFile,const DString &type,
176 bool isPublished)
177{
178 //printf("createNamespaceDef(%s)\n",qPrint(name));
179 return std::make_unique<NamespaceDefImpl>(defFileName,defLine,defColumn,name,ref,refFile,type,isPublished);
180}
181
182//------------------------------------------------------------------
183
184class NamespaceDefAliasImpl final : public DefinitionAliasMixin<NamespaceDef>
185{
186 public:
188 : DefinitionAliasMixin(newScope,nd) { init(); }
191
192 DefType definitionType() const override { return TypeNamespace; }
193
194 const NamespaceDef *getNSAlias() const { return toNamespaceDef(getAlias()); }
195
196 // ---- getters
198 { return getNSAlias()->codeSymbolType(); }
199 DString getOutputFileBase() const override
200 { return getNSAlias()->getOutputFileBase(); }
201 DString anchor() const override
202 { return getNSAlias()->anchor(); }
203 int numDocMembers() const override
204 { return getNSAlias()->numDocMembers(); }
206 { return getNSAlias()->getUsedNamespaces(); }
209 DString displayName(bool b=true) const override
210 { return makeDisplayName(this,b); }
211 const DString &localName() const override
212 { return getNSAlias()->localName(); }
213 bool isConstantGroup() const override
214 { return getNSAlias()->isConstantGroup(); }
215 bool isModule() const override
216 { return getNSAlias()->isModule(); }
217 bool isLibrary() const override
218 { return getNSAlias()->isLibrary(); }
219 bool isInline() const override
220 { return getNSAlias()->isInline(); }
221 bool isLinkableInProject() const override
222 { return getNSAlias()->isLinkableInProject(); }
223 bool isLinkable() const override
224 { return getNSAlias()->isLinkable(); }
225 bool isVisibleInHierarchy() const override
226 { return getNSAlias()->isVisibleInHierarchy(); }
227 bool hasDetailedDescription() const override
228 { return getNSAlias()->hasDetailedDescription(); }
229 const Definition *findInnerCompound(const DString &name) const override
230 { return getNSAlias()->findInnerCompound(name); }
231 bool subGrouping() const override
232 { return getNSAlias()->subGrouping(); }
234 { return getNSAlias()->getMemberList(lt); }
235 const MemberLists &getMemberLists() const override
236 { return getNSAlias()->getMemberLists(); }
237 const MemberDef *getMemberByName(const DString &name) const override
238 { return getNSAlias()->getMemberByName(name); }
239 const MemberGroupList &getMemberGroups() const override
240 { return getNSAlias()->getMemberGroups(); }
242 { return getNSAlias()->getClasses(); }
244 { return getNSAlias()->getInterfaces(); }
246 { return getNSAlias()->getStructs(); }
248 { return getNSAlias()->getExceptions(); }
250 { return getNSAlias()->getNamespaces(); }
252 { return getNSAlias()->getConcepts(); }
253 DString title() const override
254 { return getNSAlias()->title(); }
256 { return getNSAlias()->compoundTypeString(); }
257 int countVisibleMembers() const override
258 { return getNSAlias()->countVisibleMembers(); }
259};
260
261std::unique_ptr<NamespaceDef> createNamespaceDefAlias(const Definition *newScope,const NamespaceDef *nd)
262{
263 auto alnd = std::make_unique<NamespaceDefAliasImpl>(newScope,nd);
264 //printf("alnd name=%s localName=%s qualifiedName=%s displayName()=%s\n",
265 // qPrint(alnd->name()),qPrint(alnd->localName()),qPrint(alnd->qualifiedName()),
266 // qPrint(alnd->displayName()));
267 return alnd;
268}
269
270//------------------------------------------------------------------
271
273 const DString &name,const DString &lref,
274 const DString &fName, const DString &type,
275 bool isPublished) :
276 DefinitionMixin(df,dl,dc,name)
277 ,m_isPublished(isPublished)
278{
279 if (!fName.empty())
280 {
281 if (!lref.empty())
282 {
283 fileName = stripExtension(fName);
284 }
285 else
286 {
287 fileName = convertNameToFile(stripExtension(fName));
288 }
289 }
290 else
291 {
292 setFileNameLocal(name);
293 }
294 setReference(lref);
295 m_inline=false;
296 m_subGrouping=Config_getBool(SUBGROUPING);
297 if (type=="module")
298 {
299 m_type = MODULE;
300 }
301 else if (type=="constants")
302 {
303 m_type = CONSTANT_GROUP;
304 }
305 else if (type=="library")
306 {
307 m_type = LIBRARY;
308 }
309 else
310 {
311 m_type = NAMESPACE;
312 }
313
314 updateLocalName();
315}
316
318{
319 DString locName=name();
320 if (size_t i=locName.rfind("::"); i!=DString::npos) locName=locName.mid(i+2);
321 setLocalName(locName);
322}
323
329
333
335{
336 if (isReference())
337 {
338 fileName = "namespace"+fn;
339 }
340 else
341 {
342 fileName = convertNameToFile("namespace"+fn);
343 }
344}
345
347{
349}
350
352{
353 for (const auto &mg : m_memberGroups)
354 {
355 mg->distributeMemberGroupDocumentation();
356 }
357}
358
360{
364 for (const auto &mg : m_memberGroups)
365 {
366 mg->findSectionsInDocumentation(this);
367 }
368 for (auto &ml : m_memberLists)
369 {
370 if (ml->listType().isDeclaration())
371 {
372 ml->findSectionsInDocumentation(this);
373 }
374 }
375}
376
378{
379 if (fd==nullptr) return;
380 auto it = std::find(files.begin(),files.end(),fd);
381 if (it==files.end())
382 {
383 files.push_back(fd);
384 }
385}
386
388{
389 //printf("%s:NamespaceDefImpl::addInnerCompound(%s)\n",qPrint(name()),qPrint(d->name()));
392 {
394 }
396 {
398 }
400 {
402 }
403}
404
406{
408
409 if (Config_getBool(OPTIMIZE_OUTPUT_SLICE))
410 {
412 {
413 d = &m_interfaces;
414 }
415 else if (cd->compoundType()==ClassDef::Struct)
416 {
417 d = &m_structs;
418 }
419 else if (cd->compoundType()==ClassDef::Exception)
420 {
421 d = &m_exceptions;
422 }
423 }
424
425 d->add(cd->name(),cd);
426}
427
432
437
438
440{
441 for (auto &ml : m_memberLists)
442 {
443 if (ml->listType().isDeclaration())
444 {
446 }
447 }
448
449 // add members inside sections to their groups
450 for (const auto &mg : m_memberGroups)
451 {
452 if (mg->allMembersInSameSection() && m_subGrouping)
453 {
454 //printf("----> addToDeclarationSection(%s)\n",qPrint(mg->header()));
455 mg->addToDeclarationSection();
456 }
457 }
458}
459
461{
462 //printf("%s::insertMember(%s) isInline=%d hasDocs=%d\n",qPrint(name()),qPrint(md->name()),
463 // isInline(),hasDocumentation());
464 if (md->isHidden()) return;
466
467 // if this is an inline namespace that is not documented, then insert the
468 // member in the parent scope instead
469 if (isInline() && !hasDocumentation())
470 {
471 Definition *outerScope = getOuterScope();
472 if (outerScope)
473 {
474 if (outerScope->definitionType()==Definition::TypeNamespace)
475 {
477 if (nd && nd!=Doxygen::globalScope)
478 {
479 nd->insertMember(md);
480 if (mdm)
481 {
482 mdm->setNamespace(nd);
483 }
484 }
485 }
486 else if (outerScope->definitionType()==Definition::TypeFile)
487 {
488 FileDef *fd = toFileDef(outerScope);
489 fd->insertMember(md);
490 if (mdm)
491 {
492 mdm->setFileDef(fd);
493 mdm->setOuterScope(fd);
494 }
495 }
496 }
497 }
498 else // member is a non-inline namespace or a documented inline namespace
499 {
500 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
501 if (allMemberList==nullptr)
502 {
503 m_memberLists.emplace_back(std::make_unique<MemberList>(MemberListType::AllMembersList(),MemberListContainer::Namespace));
504 allMemberList = m_memberLists.back().get();
505 }
506 allMemberList->push_back(md);
507 //printf("%s::m_allMembersDict->append(%s)\n",qPrint(name()),qPrint(md->localName()));
508 m_allMembers.add(md->localName(),md);
509 switch(md->memberType())
510 {
511 case MemberType::Variable:
512 addMemberToList(MemberListType::DecVarMembers(),md);
513 addMemberToList(MemberListType::DocVarMembers(),md);
514 break;
515 case MemberType::Function:
516 addMemberToList(MemberListType::DecFuncMembers(),md);
517 addMemberToList(MemberListType::DocFuncMembers(),md);
518 break;
519 case MemberType::Typedef:
520 addMemberToList(MemberListType::DecTypedefMembers(),md);
521 addMemberToList(MemberListType::DocTypedefMembers(),md);
522 break;
523 case MemberType::Sequence:
524 addMemberToList(MemberListType::DecSequenceMembers(),md);
525 addMemberToList(MemberListType::DocSequenceMembers(),md);
526 break;
527 case MemberType::Dictionary:
528 addMemberToList(MemberListType::DecDictionaryMembers(),md);
529 addMemberToList(MemberListType::DocDictionaryMembers(),md);
530 break;
531 case MemberType::Enumeration:
532 addMemberToList(MemberListType::DecEnumMembers(),md);
533 addMemberToList(MemberListType::DocEnumMembers(),md);
534 break;
535 case MemberType::EnumValue:
536 break;
537 case MemberType::Define:
538 addMemberToList(MemberListType::DecDefineMembers(),md);
539 addMemberToList(MemberListType::DocDefineMembers(),md);
540 break;
541 case MemberType::Property:
542 if (md->getLanguage() == SrcLangExt::Python)
543 {
544 addMemberToList(MemberListType::PropertyMembers(),md);
545 addMemberToList(MemberListType::Properties(),md);
546 break;
547 }
548 // fallthrough, explicitly no break here
549 default:
550 err("NamespaceDefImpl::insertMembers(): "
551 "member '{}' with unexpected type '{}' and class scope '{}' inserted in namespace scope '{}'!\n",
552 md->name(), md->memberTypeName(), md->getClassDef() ? md->getClassDef()->name() : "", name());
553 }
554 // if this is an inline namespace, then insert an alias of this member in the outer scope.
555 if (isInline())
556 {
557 Definition *outerScope = getOuterScope();
558 if (outerScope)
559 {
560 std::unique_ptr<MemberDef> aliasMd = createMemberDefAlias(outerScope,md);
561 if (outerScope->definitionType()==Definition::TypeNamespace)
562 {
564 if (ndm)
565 {
566 ndm->insertMember(aliasMd.get());
567 }
568 }
569 else if (outerScope->definitionType()==Definition::TypeFile)
570 {
571 toFileDef(outerScope)->insertMember(aliasMd.get());
572 }
573 if (aliasMd)
574 {
576 mn->push_back(std::move(aliasMd));
577 }
578 }
579 }
580 }
581}
582
584{
585 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
586 if (allMemberList) allMemberList->setAnchors();
587}
588
590{
591 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
592 return ((!briefDescription().empty() && repeatBrief) ||
593 !documentation().empty());
594}
595
597{
600 tagFile << " <compound kind=\"namespace\">\n";
601 tagFile << " <name>" << convertToXML(name()) << "</name>\n";
602 tagFile << " <filename>" << fn << "</filename>\n";
603 DString idStr = id();
604 if (!idStr.empty())
605 {
606 tagFile << " <clangid>" << convertToXML(idStr) << "</clangid>\n";
607 }
608 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
609 {
610 switch (lde->kind())
611 {
612 case LayoutDocEntry::NamespaceNestedNamespaces:
613 {
614 for (const auto &nd : m_namespaces)
615 {
616 if (nd->isLinkableInProject())
617 {
618 tagFile << " <namespace>" << convertToXML(nd->name()) << "</namespace>\n";
619 }
620 }
621 }
622 break;
623 case LayoutDocEntry::NamespaceClasses:
624 {
626 }
627 break;
628 case LayoutDocEntry::NamespaceInterfaces:
629 {
631 }
632 break;
633 case LayoutDocEntry::NamespaceStructs:
634 {
636 }
637 break;
638 case LayoutDocEntry::NamespaceExceptions:
639 {
641 }
642 break;
643 case LayoutDocEntry::NamespaceConcepts:
644 {
645 writeConceptsToTagFile(tagFile);
646 }
647 break;
648 case LayoutDocEntry::MemberDecl:
649 {
650 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
651 if (lmd)
652 {
653 MemberList * ml = getMemberList(lmd->type);
654 if (ml)
655 {
656 ml->writeTagFile(tagFile);
657 }
658 }
659 }
660 break;
661 case LayoutDocEntry::MemberGroups:
662 {
663 for (const auto &mg : m_memberGroups)
664 {
665 mg->writeTagFile(tagFile);
666 }
667 }
668 break;
669 default:
670 break;
671 }
672 }
674 tagFile << " </compound>\n";
675}
676
678{
680 {
683 ol.writeRuler();
687 ol.writeAnchor(DString(),"details");
689 ol.startGroupHeader("details");
690 ol.parseText(title);
691 ol.endGroupHeader();
692
693 ol.startTextBlock();
694 if (!briefDescription().empty() && Config_getBool(REPEAT_BRIEF))
695 {
697 briefLine(),
698 this,
699 nullptr,
701 DocOptions());
702 }
703 if (!briefDescription().empty() && Config_getBool(REPEAT_BRIEF) &&
704 !documentation().empty())
705 {
709 ol.enableAll();
712 ol.writeString("\n\n");
714 }
715 if (!documentation().empty())
716 {
717 ol.generateDoc(docFile(),
718 docLine(),
719 this,
720 nullptr,
721 documentation()+"\n",
722 DocOptions()
723 .setIndexWords(true));
724 }
726 ol.endTextBlock();
727 }
728}
729
731{
733 {
734 auto parser { createDocParser() };
735 auto ast { validatingParseDoc(*parser.get(),
736 briefFile(),
737 briefLine(),
738 this,
739 nullptr,
741 DocOptions()
742 .setIndexWords(true)
743 .setSingleLine(true))
744 };
745 if (!ast->empty())
746 {
747 ol.startParagraph();
750 ol.writeString(" - ");
752 ol.writeDoc(ast.get(),this,nullptr);
755 ol.writeString(" \n");
757
759 {
761 ol.startTextLink(getOutputFileBase(),"details");
763 ol.endTextLink();
764 }
766 ol.endParagraph();
767 }
768 }
769
770 // Write a summary of the Slice definition including metadata.
771 if (getLanguage() == SrcLangExt::Slice)
772 {
773 ol.startParagraph();
774 ol.startTypewriter();
775 if (!metaData.empty())
776 {
777 ol.docify(metaData);
778 ol.lineBreak();
779 }
780 ol.docify("module ");
781 ol.docify(stripScope(name()));
782 ol.docify(" { ... }");
783 ol.endTypewriter();
784 ol.endParagraph();
785 }
786
787 ol.writeSynopsis();
788}
789
794
799
801{
802 if (Config_getBool(SEPARATE_MEMBER_PAGES))
803 {
806 }
807}
808
810{
811 if (Config_getBool(SEPARATE_MEMBER_PAGES))
812 {
815 }
816}
817
822
827
832
838
840{
841 /* write user defined member groups */
842 for (const auto &mg : m_memberGroups)
843 {
844 if (!mg->allMembersInSameSection() || !m_subGrouping)
845 {
846 mg->writeDeclarations(ol,nullptr,this,nullptr,nullptr,nullptr);
847 }
848 }
849}
850
852{
853 // write Author section (Man only)
856 ol.startGroupHeader();
857 ol.parseText(theTranslator->trAuthor(true,true));
858 ol.endGroupHeader();
861}
862
864{
867 bool first=true;
868 SrcLangExt lang = getLanguage();
869 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
870 {
871 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
872 if (lde->kind()==LayoutDocEntry::NamespaceClasses && m_classes.declVisible() && ls)
873 {
874 DString label = "nested-classes";
875 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
876 first=false;
877 }
878 else if (lde->kind()==LayoutDocEntry::NamespaceInterfaces && m_interfaces.declVisible() && ls)
879 {
880 DString label = "interfaces";
881 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
882 first=false;
883 }
884 else if (lde->kind()==LayoutDocEntry::NamespaceStructs && m_structs.declVisible() && ls)
885 {
886 DString label = "structs";
887 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
888 first=false;
889 }
890 else if (lde->kind()==LayoutDocEntry::NamespaceExceptions && m_exceptions.declVisible() && ls)
891 {
892 DString label = "exceptions";
893 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
894 first=false;
895 }
896 else if (lde->kind()==LayoutDocEntry::NamespaceNestedNamespaces && m_namespaces.declVisible(false) && ls)
897 {
898 DString label = "namespaces";
899 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
900 first=false;
901 }
902 else if (lde->kind()==LayoutDocEntry::NamespaceNestedConstantGroups && m_namespaces.declVisible(true) && ls)
903 {
904 DString label = "constantgroups";
905 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
906 first=false;
907 }
908 else if (lde->kind()==LayoutDocEntry::NamespaceConcepts && m_concepts.declVisible() && ls)
909 {
910 DString label = "concepts";
911 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
912 first=false;
913 }
914 else if (lde->kind()== LayoutDocEntry::MemberDecl)
915 {
916 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
917 if (lmd)
918 {
919 MemberList * ml = getMemberList(lmd->type);
920 if (ml && ml->declVisible())
921 {
922 ol.writeSummaryLink(DString(),ml->listType().toLabel(),lmd->title(lang),first);
923 first=false;
924 }
925 }
926 }
927 }
928 if (!first)
929 {
930 ol.writeString(" </div>\n");
931 }
933}
934
939
941{
942 // UNO IDL constant groups may be published
943 if (getLanguage()==SrcLangExt::IDL && isConstantGroup() && m_isPublished)
944 {
947 ol.startLabels();
948 ol.writeLabel("published",false);
949 ol.endLabels();
951 }
952 else if (isExported())
953 {
956 ol.startLabels();
957 ol.writeLabel("export",false);
958 ol.endLabels();
960 }
961}
962
964{
965 for (const auto &cd : list)
966 {
967 if (cd->isLinkableInProject())
968 {
969 tagFile << " <class kind=\"" << cd->compoundTypeString()
970 << "\">" << convertToXML(cd->name()) << "</class>\n";
971 }
972 }
973}
974
976{
977 for (const auto &cd : m_concepts)
978 {
979 if (cd->isLinkableInProject())
980 {
981 tagFile << " <concept>" << convertToXML(cd->name()) << "</concept>\n";
982 }
983 }
984}
985
987{
988 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
989 //bool outputJava = Config_getBool(OPTIMIZE_OUTPUT_JAVA);
990 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
991
992 DString pageTitle = title();
993 startFile(ol,getOutputFileBase(),false,name(),pageTitle,HighlightedItem::NamespaceVisible,!generateTreeView);
994
995 if (!generateTreeView)
996 {
998 {
1000 }
1001 ol.endQuickIndices();
1002 }
1003
1004 startTitle(ol,getOutputFileBase(),this);
1005 ol.parseText(pageTitle);
1006 addGroupListToTitle(ol,this);
1009 ol.startContents();
1010
1011 //---------------------------------------- start flexible part -------------------------------
1012
1013 SrcLangExt lang = getLanguage();
1014 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
1015 {
1016 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
1017 switch (lde->kind())
1018 {
1019 case LayoutDocEntry::BriefDesc:
1021 break;
1022 case LayoutDocEntry::MemberDeclStart:
1024 break;
1025 case LayoutDocEntry::NamespaceClasses:
1026 {
1027 if (ls) writeClassDeclarations(ol,ls->title(lang),m_classes);
1028 }
1029 break;
1030 case LayoutDocEntry::NamespaceInterfaces:
1031 {
1032 if (ls) writeClassDeclarations(ol,ls->title(lang),m_interfaces);
1033 }
1034 break;
1035 case LayoutDocEntry::NamespaceStructs:
1036 {
1037 if (ls) writeClassDeclarations(ol,ls->title(lang),m_structs);
1038 }
1039 break;
1040 case LayoutDocEntry::NamespaceExceptions:
1041 {
1042 if (ls) writeClassDeclarations(ol,ls->title(lang),m_exceptions);
1043 }
1044 break;
1045 case LayoutDocEntry::NamespaceConcepts:
1046 {
1047 if (ls) writeConcepts(ol,ls->title(lang));
1048 }
1049 break;
1050 case LayoutDocEntry::NamespaceNestedNamespaces:
1051 {
1052 if (ls) writeNamespaceDeclarations(ol,ls->title(lang),false);
1053 }
1054 break;
1055 case LayoutDocEntry::NamespaceNestedConstantGroups:
1056 {
1057 if (ls) writeNamespaceDeclarations(ol,ls->title(lang),true);
1058 }
1059 break;
1060 case LayoutDocEntry::MemberGroups:
1062 break;
1063 case LayoutDocEntry::MemberDecl:
1064 {
1065 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
1066 if (lmd) writeMemberDeclarations(ol,lmd->type,lmd->title(lang));
1067 }
1068 break;
1069 case LayoutDocEntry::MemberDeclEnd:
1071 break;
1072 case LayoutDocEntry::DetailedDesc:
1073 {
1074 if (ls) writeDetailedDescription(ol,ls->title(lang));
1075 }
1076 break;
1077 case LayoutDocEntry::MemberDefStart:
1079 break;
1080 case LayoutDocEntry::NamespaceInlineClasses:
1082 break;
1083 case LayoutDocEntry::MemberDef:
1084 {
1085 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
1086 if (lmd) writeMemberDocumentation(ol,lmd->type,lmd->title(lang));
1087 }
1088 break;
1089 case LayoutDocEntry::MemberDefEnd:
1091 break;
1092 case LayoutDocEntry::AuthorSection:
1094 break;
1095 case LayoutDocEntry::ClassIncludes:
1096 case LayoutDocEntry::ClassInheritanceGraph:
1097 case LayoutDocEntry::ClassNestedClasses:
1098 case LayoutDocEntry::ClassCollaborationGraph:
1099 case LayoutDocEntry::ClassAllMembersLink:
1100 case LayoutDocEntry::ClassUsedFiles:
1101 case LayoutDocEntry::ClassInlineClasses:
1102 case LayoutDocEntry::ConceptDefinition:
1103 case LayoutDocEntry::FileClasses:
1104 case LayoutDocEntry::FileConcepts:
1105 case LayoutDocEntry::FileInterfaces:
1106 case LayoutDocEntry::FileStructs:
1107 case LayoutDocEntry::FileExceptions:
1108 case LayoutDocEntry::FileNamespaces:
1109 case LayoutDocEntry::FileConstantGroups:
1110 case LayoutDocEntry::FileIncludes:
1111 case LayoutDocEntry::FileIncludeGraph:
1112 case LayoutDocEntry::FileIncludedByGraph:
1113 case LayoutDocEntry::FileSourceLink:
1114 case LayoutDocEntry::FileInlineClasses:
1115 case LayoutDocEntry::GroupClasses:
1116 case LayoutDocEntry::GroupConcepts:
1117 case LayoutDocEntry::GroupModules:
1118 case LayoutDocEntry::GroupInlineClasses:
1119 case LayoutDocEntry::GroupNamespaces:
1120 case LayoutDocEntry::GroupDirs:
1121 case LayoutDocEntry::GroupNestedGroups:
1122 case LayoutDocEntry::GroupFiles:
1123 case LayoutDocEntry::GroupGraph:
1124 case LayoutDocEntry::GroupPageDocs:
1125 case LayoutDocEntry::ModuleExports:
1126 case LayoutDocEntry::ModuleClasses:
1127 case LayoutDocEntry::ModuleConcepts:
1128 case LayoutDocEntry::ModuleUsedFiles:
1129 case LayoutDocEntry::DirSubDirs:
1130 case LayoutDocEntry::DirFiles:
1131 case LayoutDocEntry::DirGraph:
1132 err("Internal inconsistency: member '{}' should not be part of "
1133 "LayoutDocManager::Namespace entry list\n",lde->entryToString());
1134 break;
1135 }
1136 }
1137
1138 //---------------------------------------- end flexible part -------------------------------
1139
1140 ol.endContents();
1141
1142 endFileWithNavPath(ol,this);
1143
1144 if (Config_getBool(SEPARATE_MEMBER_PAGES))
1145 {
1146 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
1147 if (allMemberList) allMemberList->sort();
1148 writeMemberPages(ol);
1149 }
1150}
1151
1153{
1154 ol.pushGeneratorState();
1156
1157 for (const auto &ml : m_memberLists)
1158 {
1159 if (ml->listType().isDocumentation())
1160 {
1161 ml->writeDocumentationPage(ol,displayName(),this);
1162 }
1163 }
1164 ol.popGeneratorState();
1165}
1166
1168{
1169 bool createSubDirs=Config_getBool(CREATE_SUBDIRS);
1170
1171 ol.writeString(" <div class=\"navtab\">\n");
1172 ol.writeString(" <table>\n");
1173
1174 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
1175 if (allMemberList)
1176 {
1177 for (const auto &md : *allMemberList)
1178 {
1179 if (md->getNamespaceDef()==this && md->isLinkable() && !md->isEnumValue())
1180 {
1181 if (md->isLinkableInProject())
1182 {
1183 DString fn = md->getOutputFileBase();
1185 if (md==currentMd) // selected item => highlight
1186 {
1187 ol.writeString(" <tr><td class=\"navtabHL\">");
1188 }
1189 else
1190 {
1191 ol.writeString(" <tr><td class=\"navtab\">");
1192 }
1193 ol.writeString("<span class=\"label\"><a ");
1194 ol.writeString("href=\"");
1195 if (createSubDirs) ol.writeString("../../");
1196 ol.writeString(fn+"#"+md->anchor());
1197 ol.writeString("\">");
1198 ol.writeString(convertToHtml(md->localName()));
1199 ol.writeString("</a></span>");
1200 ol.writeString("</td></tr>\n");
1201 }
1202 }
1203 }
1204 }
1205
1206 ol.writeString(" </table>\n");
1207 ol.writeString(" </div>\n");
1208}
1209
1211{
1212 for (auto &ml : m_memberLists)
1213 {
1214 ml->countDecMembers();
1215 ml->countDocMembers();
1216 }
1217 for (const auto &mg : m_memberGroups)
1218 {
1219 mg->countDecMembers();
1220 mg->countDocMembers();
1221 }
1222}
1223
1225{
1226 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
1227 return (allMemberList ? allMemberList->numDocMembers() : 0) + static_cast<int>(m_innerCompounds.size());
1228}
1229
1231{
1233 //printf("%s: NamespaceDefImpl::addUsingDirective: %s:%zu\n",qPrint(name()),qPrint(nd->qualifiedName()),m_usingDirList.size());
1234}
1235
1240
1245
1247{
1248 if (n==nullptr) return nullptr;
1249 const Definition *d = m_innerCompounds.find(n);
1250 if (d==nullptr)
1251 {
1252 if (!m_usingDirList.empty())
1253 {
1254 d = m_usingDirList.find(n);
1255 }
1256 if (d==nullptr && !m_usingDeclList.empty())
1257 {
1258 d = m_usingDeclList.find(n);
1259 }
1260 }
1261 return d;
1262}
1263
1265{
1267 qualifiedName(),
1268 getLanguage()==SrcLangExt::Fortran ?
1269 theTranslator->trModule(true,true) :
1270 theTranslator->trNamespace(true,true),
1272 DString(),
1273 this
1274 );
1275 for (const auto &mg : m_memberGroups)
1276 {
1277 mg->addListReferences(this);
1278 }
1279 for (auto &ml : m_memberLists)
1280 {
1281 if (ml->listType().isDocumentation())
1282 {
1283 ml->addListReferences(this);
1284 }
1285 }
1286}
1287
1289{
1291 for (const auto &mg : m_memberGroups)
1292 {
1293 mg->addRequirementReferences(this);
1294 }
1295 for (auto &ml : m_memberLists)
1296 {
1297 if (ml->listType().isDocumentation())
1298 {
1299 ml->addRequirementReferences(this);
1300 }
1301 }
1302}
1303
1305{
1306 return makeDisplayName(this,includeScope);
1307}
1308
1310{
1311 if (visitedNamespaces.find(this)!=visitedNamespaces.end()) return; // already processed
1312 visitedNamespaces.insert(this);
1313
1315 for (auto &nd : usingDirList)
1316 {
1318 if (ndm)
1319 {
1320 ndm->combineUsingRelations(visitedNamespaces);
1321 }
1322 }
1323
1324 for (auto &nd : usingDirList)
1325 {
1326 // add used namespaces of namespace nd to this namespace
1327 for (const auto &und : nd->getUsedNamespaces())
1328 {
1329 addUsingDirective(und);
1330 }
1331 // add used classes of namespace nd to this namespace
1332 for (const auto &ud : nd->getUsedDefinitions())
1333 {
1335 }
1336 }
1337}
1338
1340{
1341 int count=0;
1342 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
1343 {
1344 if (lde->kind()==LayoutDocEntry::MemberDef)
1345 {
1346 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
1347 if (lmd)
1348 {
1349 MemberList *ml = getMemberList(lmd->type);
1350 if (ml)
1351 {
1352 for (const auto &md : *ml)
1353 {
1354 if (md->visibleInIndex())
1355 {
1356 count++;
1357 }
1358 }
1359 }
1360 }
1361 }
1362 }
1363 return count;
1364}
1365
1366
1367
1368//-------------------------------------------------------------------------------
1369
1370bool NamespaceLinkedRefMap::declVisible(bool isConstantGroup) const
1371{
1372 bool found=false;
1373 for (const auto &nd : *this)
1374 {
1375 if (nd->isLinkable() && nd->hasDocumentation())
1376 {
1377 SrcLangExt lang = nd->getLanguage();
1378 if (SrcLangExt::IDL==lang)
1379 {
1380 if (isConstantGroup == nd->isConstantGroup())
1381 {
1382 found=true;
1383 break;
1384 }
1385 }
1386 else if (!isConstantGroup) // ensure we only get extra section in IDL
1387 {
1388 if (nd->isConstantGroup())
1389 {
1390 err("Internal inconsistency: constant group but not IDL?\n");
1391 }
1392 found=true;
1393 break;
1394 }
1395 }
1396 }
1397 return found;
1398}
1399
1401 bool const isConstantGroup,bool localName)
1402{
1403
1404
1405 if (empty()) return; // no namespaces in the list
1406
1407 if (Config_getBool(OPTIMIZE_OUTPUT_VHDL)) return;
1408
1409 if (!declVisible(isConstantGroup)) return;
1410
1411 // write list of namespaces
1412 ol.startMemberHeader(isConstantGroup ? "constantgroups" : "namespaces");
1413 //bool javaOpt = Config_getBool(OPTIMIZE_OUTPUT_JAVA);
1414 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
1415 ol.parseText(title);
1416 ol.endMemberHeader();
1417 ol.startMemberList();
1418 for (const auto &nd : *this)
1419 {
1420 if (nd->isLinkable() && nd->hasDocumentation())
1421 {
1422 SrcLangExt lang = nd->getLanguage();
1423 if (lang==SrcLangExt::IDL && (isConstantGroup != nd->isConstantGroup()))
1424 continue; // will be output in another pass, see layout_default.xml
1426 DString name = localName ? nd->localName() : nd->displayName();
1427 DString anc = nd->anchor();
1428 if (anc.empty()) anc=name; else anc.prepend(name+"_");
1430 DString ct = nd->compoundTypeString();
1431 ol.docify(ct);
1432 ol.docify(" ");
1433 ol.insertMemberAlign();
1434 ol.writeObjectLink(nd->getReference(),nd->getOutputFileBase(),DString(),name);
1436 if (!nd->briefDescription().empty() && Config_getBool(BRIEF_MEMBER_DESC))
1437 {
1438 ol.startMemberDescription(nd->getOutputFileBase());
1439 ol.generateDoc(nd->briefFile(),
1440 nd->briefLine(),
1441 nd,
1442 nullptr,
1443 nd->briefDescription(),
1444 DocOptions()
1445 .setSingleLine(true));
1447 }
1449 }
1450 }
1451 ol.endMemberList();
1452}
1453
1454//-------------------------------------------------------------------------------
1455
1457{
1458 bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS);
1459 bool sortMemberDocs = Config_getBool(SORT_MEMBER_DOCS);
1461 ml->setNeedsSorting(
1462 (ml->listType().isDeclaration() && sortBriefDocs) ||
1463 (ml->listType().isDocumentation() && sortMemberDocs));
1464 ml->push_back(md);
1465
1466 if (ml->listType().isDeclaration())
1467 {
1469 if (mdm)
1470 {
1471 mdm->setSectionList(this,ml.get());
1472 }
1473 }
1474}
1475
1476template<class Container>
1477bool needsSorting(const Container &container)
1478{
1479 DString prev;
1480 bool allSame = true;
1481 for (const auto &c : container)
1482 {
1483 DString name = c->getDefFileName();
1484 if (!prev.empty() && prev!=name)
1485 {
1486 allSame = false;
1487 break;
1488 }
1489 prev = name;
1490 }
1491 return !allSame || Config_getBool(SORT_BRIEF_DOCS);
1492}
1493
1495{
1496 for (auto &ml : m_memberLists)
1497 {
1498 if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(false); }
1499 }
1500
1501 auto classComp = [](const ClassLinkedRefMap::Ptr &c1,const ClassLinkedRefMap::Ptr &c2)
1502 {
1503 return Config_getBool(SORT_BY_SCOPE_NAME) ?
1504 dstricmp_sort(c1->name(), c2->name())<0 :
1505 dstricmp_sort(c1->className(), c2->className())<0;
1506 };
1507
1508 if (needsSorting(m_classes)) std::stable_sort(m_classes.begin(), m_classes.end(), classComp);
1509 if (needsSorting(m_interfaces)) std::stable_sort(m_interfaces.begin(),m_interfaces.end(),classComp);
1510 if (needsSorting(m_structs)) std::stable_sort(m_structs.begin(), m_structs.end(), classComp);
1511 if (needsSorting(m_exceptions)) std::stable_sort(m_exceptions.begin(),m_exceptions.end(),classComp);
1512
1513 auto conceptComp = [](const ConceptLinkedRefMap::Ptr &c1,const ConceptLinkedRefMap::Ptr &c2)
1514 {
1515 return dstricmp_sort(c1->name(),c2->name())<0;
1516 };
1517
1518 if (needsSorting(m_concepts)) std::stable_sort(m_concepts.begin(), m_concepts.end(), conceptComp);
1519
1520 auto namespaceComp = [](const NamespaceLinkedRefMap::Ptr &n1,const NamespaceLinkedRefMap::Ptr &n2)
1521 {
1522 return dstricmp_sort(n1->name(),n2->name())<0;
1523 };
1524
1525 if (needsSorting(m_namespaces)) std::stable_sort(m_namespaces.begin(),m_namespaces.end(),namespaceComp);
1526
1527}
1528
1530{
1531 for (auto &ml : m_memberLists)
1532 {
1533 if (ml->listType()==lt)
1534 {
1535 return ml.get();
1536 }
1537 }
1538 return nullptr;
1539}
1540
1542{
1543 MemberList * ml = getMemberList(lt);
1544 if (ml) ml->writeDeclarations(ol,nullptr,this,nullptr,nullptr,nullptr,title,DString());
1545}
1546
1552
1553static bool hasNonReferenceNestedNamespaceRec(const NamespaceDef *nd,int level)
1554{
1555 if (level>30)
1556 {
1557 err("Possible recursive namespace relation while inside {}\n",nd->name());
1558 return false;
1559 }
1560 bool found=nd->isLinkableInProject();
1561 if (found)
1562 {
1563 return true;
1564 }
1565 else
1566 {
1567 for (const auto &ind : nd->getNamespaces())
1568 {
1569 found = found || hasNonReferenceNestedNamespaceRec(ind,level+1);
1570 if (found) break;
1571 }
1572 }
1573 return found;
1574}
1575
1577{
1578 bool allExternals = Config_getBool(ALLEXTERNALS);
1579 return allExternals || hasNonReferenceNestedNamespaceRec(this,0) || isLinkable();
1580}
1581
1583{
1584 size_t i = name().rfind("::");
1585 if (i==DString::npos) i=0; else i+=2;
1586 bool extractAnonNs = Config_getBool(EXTRACT_ANON_NSPACES);
1587 bool hideUndoc = Config_getBool(HIDE_UNDOC_NAMESPACES);
1588 if (extractAnonNs && // extract anonymous ns
1589 name().mid(i,20)=="anonymous_namespace{" // correct prefix
1590 ) // not disabled by config
1591 {
1592 return true;
1593 }
1594 return !name().empty() && name().at(i)!='@' && // not anonymous
1595 (hasDocumentation() || !hideUndoc || getLanguage()==SrcLangExt::CSharp) && // documented
1596 !isReference() && // not an external reference
1597 !isHidden() && // not hidden
1598 !isArtificial(); // or artificial
1599}
1600
1602{
1603 return isLinkableInProject() || isReference();
1604}
1605
1607{
1608 return m_allMembers.find(n);
1609}
1610
1612{
1613 DString pageTitle;
1614 SrcLangExt lang = getLanguage();
1615
1616 auto getReferenceTitle = [this](std::function<DString()> translateFunc) -> DString
1617 {
1618 return Config_getBool(HIDE_COMPOUND_REFERENCE) ? displayName() : translateFunc();
1619 };
1620
1621 if (lang==SrcLangExt::Java)
1622 {
1623 pageTitle = theTranslator->trPackage(displayName());
1624 }
1625 else if (lang==SrcLangExt::Fortran || lang==SrcLangExt::Slice)
1626 {
1627 pageTitle = getReferenceTitle([this](){
1629 });
1630 }
1631 else if (lang==SrcLangExt::IDL)
1632 {
1633 pageTitle = getReferenceTitle([this](){
1634 return isConstantGroup()
1637 });
1638 }
1639 else
1640 {
1641 pageTitle = getReferenceTitle([this](){
1643 });
1644 }
1645 return pageTitle;
1646}
1647
1649{
1650 SrcLangExt lang = getLanguage();
1651 if (lang==SrcLangExt::Java)
1652 {
1653 return "package";
1654 }
1655 else if(lang==SrcLangExt::CSharp)
1656 {
1657 return "namespace";
1658 }
1659 else if (lang==SrcLangExt::Fortran)
1660 {
1661 return "module";
1662 }
1663 else if (lang==SrcLangExt::IDL)
1664 {
1665 if (isModule())
1666 {
1667 return "module";
1668 }
1669 else if (isConstantGroup())
1670 {
1671 return "constants";
1672 }
1673 else if (isLibrary())
1674 {
1675 return "library";
1676 }
1677 else
1678 {
1679 err_full(getDefFileName(),getDefLine(),"Internal inconsistency: namespace in IDL not module, library or constant group");
1680 }
1681 }
1682 return "namespace";
1683}
1684
1686{
1687 metaData = m;
1688}
1689
1690// --- Cast functions
1691//
1693{
1694 if (d && (typeid(*d)==typeid(NamespaceDefImpl) || typeid(*d)==typeid(NamespaceDefAliasImpl)))
1695 {
1696 return static_cast<NamespaceDef*>(d);
1697 }
1698 else
1699 {
1700 return nullptr;
1701 }
1702}
1703
1705{
1706 Definition *d = toDefinition(md);
1707 if (d && typeid(*d)==typeid(NamespaceDefImpl))
1708 {
1709 return static_cast<NamespaceDef*>(d);
1710 }
1711 else
1712 {
1713 return nullptr;
1714 }
1715}
1716
1717
1719{
1720 if (d && (typeid(*d)==typeid(NamespaceDefImpl) || typeid(*d)==typeid(NamespaceDefAliasImpl)))
1721 {
1722 return static_cast<const NamespaceDef*>(d);
1723 }
1724 else
1725 {
1726 return nullptr;
1727 }
1728}
1729
1731{
1732 if (d && typeid(*d)==typeid(NamespaceDefImpl))
1733 {
1734 return static_cast<NamespaceDefMutable*>(d);
1735 }
1736 else
1737 {
1738 return nullptr;
1739 }
1740}
1741
1742// --- Helpers
1743
1744static NamespaceDef *getResolvedNamespaceRec(StringSet &namespacesTried,const NamespaceAliasInfo &aliasInfo);
1745
1746static DString replaceNamespaceAliasesRec(StringSet &namespacesTried,const DString &name)
1747{
1748 DString result = name;
1749 //printf("> replaceNamespaceAliasesRec(%s)\n",qPrint(name));
1750 if (namespacesTried.find(name.str())==namespacesTried.end())
1751 {
1752 namespacesTried.insert(name.str());
1753 size_t p = 0;
1754 for (;;)
1755 {
1756 size_t i = name.str().find("::",p);
1757 if (i==std::string::npos)
1758 {
1759 auto it = Doxygen::namespaceAliasMap.find(name.str());
1760 if (it != Doxygen::namespaceAliasMap.end())
1761 {
1762 //printf("found map %s->%s\n",qPrint(name),qPrint(it->second.alias));
1763 auto ns = getResolvedNamespaceRec(namespacesTried,it->second);
1764 if (ns)
1765 {
1766 result = replaceNamespaceAliasesRec(namespacesTried,ns->qualifiedName());
1767 }
1768 }
1769 break;
1770 }
1771 else
1772 {
1773 auto it = Doxygen::namespaceAliasMap.find(name.left(i).str());
1774 if (it != Doxygen::namespaceAliasMap.end())
1775 {
1776 //printf("found map %s|%s->%s\n",qPrint(name.left(i)),qPrint(name.mid(i)),qPrint(it->second.alias));
1777 auto ns = getResolvedNamespaceRec(namespacesTried,it->second);
1778 if (ns)
1779 {
1780 result = replaceNamespaceAliasesRec(namespacesTried,ns->qualifiedName()+name.mid(i));
1781 break;
1782 }
1783 }
1784 }
1785 p = i+2;
1786 }
1787 }
1788 //printf("< replaceNamespaceAliasesRec(%s)=%s\n",qPrint(name),qPrint(result));
1789 return result;
1790}
1791
1792static NamespaceDef *getResolvedNamespaceRec(StringSet &namespacesTried,const NamespaceAliasInfo &aliasInfo)
1793{
1794 size_t j = aliasInfo.context.length();
1795 for (;;)
1796 {
1797 if (j>0)
1798 {
1799 //printf("candidate %s|::%s\n",qPrint(aliasInfo.context.substr(0,j)),qPrint(aliasInfo.alias));
1800 auto candidate = replaceNamespaceAliasesRec(namespacesTried,aliasInfo.context.substr(0,j)+"::"+aliasInfo.alias);
1801 auto nd = Doxygen::namespaceLinkedMap->find(candidate);
1802 if (nd)
1803 {
1804 return nd;
1805 }
1806 }
1807 if (j>0) // strip one level from context, i.e. given N1::N2::N3
1808 // j==10 -> j==6 (N1::N2::N3->N1::N2), and then
1809 // j==6 -> j==2 (N1::N2->N1), and then
1810 // j==2 -> j==std::string::npos (N1->"")
1811 {
1812 j = aliasInfo.context.rfind("::",j-1);
1813 }
1814 else
1815 {
1816 j = std::string::npos;
1817 }
1818 if (j==std::string::npos)
1819 {
1820 //printf("candidate %s\n",qPrint(aliasInfo.alias));
1821 auto candidate = replaceNamespaceAliasesRec(namespacesTried,aliasInfo.alias);
1822 auto nd = Doxygen::namespaceLinkedMap->find(candidate);
1823 if (nd)
1824 {
1825 return nd;
1826 }
1827 break;
1828 }
1829 }
1830 return nullptr;
1831}
1832
1834{
1835 //printf("> replaceNamespaceAliases(%s)\n",qPrint(name));
1836 StringSet namespacesTried;
1837 name = replaceNamespaceAliasesRec(namespacesTried,name);
1838 //printf("< replaceNamespaceAliases: result=%s\n",qPrint(name));
1839}
1840
1842{
1843 //printf("> getResolvedNamespace(%s)\n",qPrint(name));
1844 if (name.empty()) return nullptr;
1845 StringSet namespacesTried;
1846 auto ns = getResolvedNamespaceRec(namespacesTried,NamespaceAliasInfo(name.str()));
1847 //printf("< getResolvedNamespace(%s)=%s\n",qPrint(name),ns?qPrint(ns->qualifiedName()):"nullptr");
1848 return ns;
1849}
1850
1851//--------------------------------------------------------------------------------------
1852//
1854{
1855 for (const auto &cnd : nd->getNamespaces())
1856 {
1857 if (cnd->isLinkableInProject() && !cnd->isAnonymous())
1858 {
1859 return true;
1860 }
1861 }
1862 return false;
1863}
1864
1866{
1867 //printf(">namespaceHasNestedConcept(%s)\n",qPrint(nd->name()));
1868 for (const auto &cnd : nd->getNamespaces())
1869 {
1871 {
1872 //printf("<namespaceHasNestedConcept(%s): case1\n",qPrint(nd->name()));
1873 return true;
1874 }
1875 }
1876 for (const auto &cnd : nd->getConcepts())
1877 {
1878 //printf("candidate %s isLinkableInProject()=%d\n",qPrint(cnd->name()),cnd->isLinkableInProject());
1879 if (cnd->isLinkableInProject())
1880 {
1881 //printf("<namespaceHasNestedConcept(%s): case2\n",qPrint(nd->name()));
1882 return true;
1883 }
1884 }
1885 //printf("<namespaceHasNestedConcept(%s): case3\n",qPrint(nd->name()));
1886 return false;
1887}
1888
1890{
1891 //printf(">namespaceHasNestedClass(%s,filterClasses=%d)\n",qPrint(nd->name()),filterClasses);
1892 for (const auto &cnd : nd->getNamespaces())
1893 {
1894 if (namespaceHasNestedClass(cnd,filterClasses,ct))
1895 {
1896 //printf("<namespaceHasNestedClass(%s,filterClasses=%d): case1\n",qPrint(nd->name()),filterClasses);
1897 return true;
1898 }
1899 }
1900
1901 ClassLinkedRefMap list = nd->getClasses();
1902 if (filterClasses)
1903 {
1904 switch (ct)
1905 {
1907 list = nd->getInterfaces();
1908 break;
1909 case ClassDef::Struct:
1910 list = nd->getStructs();
1911 break;
1913 list = nd->getExceptions();
1914 break;
1915 default:
1916 break;
1917 }
1918 }
1919
1920 for (const auto &cd : list)
1921 {
1922 //printf("candidate %s isLinkableInProject()=%d\n",qPrint(cd->name()),cd->isLinkableInProject());
1923 if (cd->isLinkableInProject())
1924 {
1925 //printf("<namespaceHasNestedClass(%s,filterClasses=%d): case2\n",qPrint(nd->name()),filterClasses);
1926 return true;
1927 }
1928 }
1929 //printf("<namespaceHasNestedClass(%s,filterClasses=%d): case3\n",qPrint(nd->name()),filterClasses);
1930 return false;
1931}
1932
1933
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:29
void writeDocumentation(OutputList &ol, const Definition *container=nullptr) const
Definition classlist.cpp:74
void writeDeclaration(OutputList &ol, const ClassDef::CompoundType *filter, const DString &header, bool localNames) const
Definition classlist.cpp:53
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:88
DString()=default
size_t rfind(char c, size_t pos=npos) const
Definition dstring.h:248
DString mid(size_t index, size_t len=npos) const
Definition dstring.h:322
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
Definition dstring.h:152
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:182
char & at(size_t i)
Returns a reference to the character at index i.
Definition dstring.h:690
DString & prepend(const char *s)
Definition dstring.h:519
DString left(size_t len) const
Definition dstring.h:310
const std::string & str() const
Definition dstring.h:649
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:1436
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:125
int numDocMembers() const
Definition memberlist.h:138
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:130
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:191
void push_back(Ptr &&p)
Definition membername.h:52
void sort()
Definition memberlist.h:76
void push_back(const T &value)
Definition memberlist.h:48
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:176
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:481
int dstricmp_sort(const char *str1, const char *str2)
Definition dstring.h:71
FileDef * toFileDef(Definition *d)
Definition filedef.cpp:1976
void endTitle(OutputList &ol, const DString &fileName, const DString &name)
Definition index.cpp:397
void endFileWithNavPath(OutputList &ol, const DefinitionMutable *d, bool showPageNavigation)
Definition index.cpp:451
void startTitle(OutputList &ol, const DString &fileName, const DefinitionMutable *def)
Definition index.cpp:387
void startFile(OutputList &ol, const DString &name, bool isSource, const DString &manName, const DString &title, HighlightedItem hli, bool additionalIndices, const DString &altSidebarName, int hierarchyLevel, const DString &allMembersFile)
Definition index.cpp:404
@ NamespaceVisible
Definition index.h:91
Translator * theTranslator
Definition language.cpp:71
std::unique_ptr< MemberDef > createMemberDefAlias(const Definition *newScope, const MemberDef *aliasMd)
MemberDefMutable * toMemberDefMutable(Definition *d)
void addMembersToMemberGroup(MemberList *ml, MemberGroupList *pMemberGroups, const Definition *context)
#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:134
Web server based search engine.
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:1787
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:1799
Definition layout.h:101
DString title(SrcLangExt lang) const
Definition layout.cpp:1780
std::string context
Definition doxygen.h:70
NamespaceAliasInfo(const std::string &a, const std::string &ctx=std::string())
Definition doxygen.h:68
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:2865
void addGroupListToTitle(OutputList &ol, const Definition *d)
Definition util.cpp:3923
DString stripScope(const DString &name)
Definition util.cpp:3111
void createSubDirs(const Dir &d)
Definition util.cpp:2971
DString convertToHtml(const DString &s, bool keepEntities)
Definition util.cpp:3293
void addHtmlExtensionIfMissing(DString &fName)
Definition util.cpp:3933
DString convertToXML(const DString &s, bool keepEntities, const bool citeEntry)
Definition util.cpp:3234
DString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Definition util.cpp:4631
DString removeAnonymousScopes(const DString &str)
Definition util.cpp:100
A bunch of utility functions.