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#include <map>
20#include <memory>
21
22// other includes
23#include "classdef.h"
24#include "classlist.h"
25#include "conceptdef.h"
26#include "config.h"
27#include "definitionimpl.h"
28#include "docparser.h"
29#include "doxygen.h"
30#include "language.h"
31#include "layout.h"
32#include "membergroup.h"
33#include "memberlist.h"
34#include "membername.h"
35#include "message.h"
36#include "outputlist.h"
37#include "util.h"
38
39//------------------------------------------------------------------
40static DString makeDisplayName(const NamespaceDef *nd,bool includeScope)
41{
42 DString result=includeScope ? nd->name() : nd->localName();
43 SrcLangExt lang = nd->getLanguage();
45 if (sep!="::")
46 {
47 result = substitute(result,"::",sep);
48 }
49 if (nd->isAnonymous())
50 {
51 result = removeAnonymousScopes(result);
52 }
53 //printf("makeDisplayName() %s->%s lang=%d\n",qPrint(name()),qPrint(result),lang);
54 return result;
55}
56//------------------------------------------------------------------
57
58class NamespaceDefImpl final : public DefinitionMixin<NamespaceDefMutable>
59{
60 public:
61 NamespaceDefImpl(const DString &defFileName,int defLine,size_t defColumn,
62 const DString &name,const DString &ref=DString(),
63 const DString &refFile=DString(),const DString &type=DString(),
64 bool isPublished=false);
65 ~NamespaceDefImpl() override;
67
68 DefType definitionType() const override { return TypeNamespace; }
70 { return getLanguage()==SrcLangExt::Java ? CodeSymbolType::Package : CodeSymbolType::Namespace; }
71 DString getOutputFileBase() const override;
72 DString anchor() const override { return DString(); }
73 void insertUsedFile(FileDef *fd) override;
74 void writeDocumentation(OutputList &ol) override;
75 void writeMemberPages(OutputList &ol) override;
76 void writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const override;
77 void writeTagFile(TextStream &) override;
78 void insertClass(ClassDef *cd) override;
79 void insertConcept(ConceptDef *cd) override;
80 void insertNamespace(NamespaceDef *nd) override;
81 void insertMember(MemberDef *md) override;
82 void computeAnchors() override;
83 void countMembers() override;
84 int numDocMembers() const override;
85 void addUsingDirective(NamespaceDef *nd) override;
87 void addUsingDeclaration(const Definition *cd) override;
89 void combineUsingRelations(NamespaceDefSet &visitedNamespace) override;
90 DString displayName(bool=true) const override;
91 void setInline(bool isInline) override { m_inline = isInline; }
92 bool isConstantGroup() const override { return CONSTANT_GROUP == m_type; }
93 bool isModule() const override { return NAMESPACE == m_type || MODULE == m_type; }
94 bool isLibrary() const override { return LIBRARY == m_type; }
95 bool isInline() const override { return m_inline; }
96 bool isLinkableInProject() const override;
97 bool isLinkable() const override;
98 bool isVisibleInHierarchy() const override;
99 bool hasDetailedDescription() const override;
100 void addMembersToMemberGroup() override;
102 void findSectionsInDocumentation() override;
103 void sortMemberLists() override;
104 const Definition *findInnerCompound(const DString &name) const override;
105 void addInnerCompound(Definition *d) override;
106 void addListReferences() override;
107 void addRequirementReferences() override;
108 void setFileName(const DString &fn) override;
109 bool subGrouping() const override { return m_subGrouping; }
110 MemberList *getMemberList(MemberListType lt) const override;
111 const MemberLists &getMemberLists() const override { return m_memberLists; }
112 const MemberDef *getMemberByName(const DString &) const override;
113 const MemberGroupList &getMemberGroups() const override { return m_memberGroups; }
114 ClassLinkedRefMap getClasses() const override { return m_classes; }
115 ClassLinkedRefMap getInterfaces() const override { return m_interfaces; }
116 ClassLinkedRefMap getStructs() const override { return m_structs; }
117 ClassLinkedRefMap getExceptions() const override { return m_exceptions; }
119 ConceptLinkedRefMap getConcepts() const override { return m_concepts; }
120 void setName(const DString &name) override;
121
122 DString title() const override;
123 DString compoundTypeString() const override;
124
125 void setIncludeFile(FileDef *fd,const DString &incName,bool local,bool force) override;
126 void setMetaData(const DString &m) override;
127 int countVisibleMembers() const override;
128 void writeSummaryLinks(OutputList &ol) const override;
129 void writePageNavigation(OutputList &ol) const override;
130
131 private:
140 void writeConcepts(OutputList &ol,const DString &title);
149 void setFileNameLocal(const DString &fn);
150 void writeIncludeFiles(OutputList &ol) const;
151
153 bool isConstantGroup=false);
154 void updateLocalName();
155
158
162 std::map<std::string, IncludeInfo> m_incInfo;
163
173 bool m_subGrouping = false;
175 bool m_isPublished = false;
177 bool m_inline = false;
178};
179
180std::unique_ptr<NamespaceDef> createNamespaceDef(const DString &defFileName,int defLine,size_t defColumn,
181 const DString &name,const DString &ref,
182 const DString &refFile,const DString &type,
183 bool isPublished)
184{
185 //printf("createNamespaceDef(%s)\n",qPrint(name));
186 return std::make_unique<NamespaceDefImpl>(defFileName,defLine,defColumn,name,ref,refFile,type,isPublished);
187}
188
189//------------------------------------------------------------------
190
191class NamespaceDefAliasImpl final : public DefinitionAliasMixin<NamespaceDef>
192{
193 public:
195 : DefinitionAliasMixin(newScope,nd) { init(); }
198
199 DefType definitionType() const override { return TypeNamespace; }
200
201 const NamespaceDef *getNSAlias() const { return toNamespaceDef(getAlias()); }
202
203 // ---- getters
205 { return getNSAlias()->codeSymbolType(); }
206 DString getOutputFileBase() const override
207 { return getNSAlias()->getOutputFileBase(); }
208 DString anchor() const override
209 { return getNSAlias()->anchor(); }
210 int numDocMembers() const override
211 { return getNSAlias()->numDocMembers(); }
213 { return getNSAlias()->getUsedNamespaces(); }
216 DString displayName(bool b=true) const override
217 { return makeDisplayName(this,b); }
218 const DString &localName() const override
219 { return getNSAlias()->localName(); }
220 bool isConstantGroup() const override
221 { return getNSAlias()->isConstantGroup(); }
222 bool isModule() const override
223 { return getNSAlias()->isModule(); }
224 bool isLibrary() const override
225 { return getNSAlias()->isLibrary(); }
226 bool isInline() const override
227 { return getNSAlias()->isInline(); }
228 bool isLinkableInProject() const override
229 { return getNSAlias()->isLinkableInProject(); }
230 bool isLinkable() const override
231 { return getNSAlias()->isLinkable(); }
232 bool isVisibleInHierarchy() const override
233 { return getNSAlias()->isVisibleInHierarchy(); }
234 bool hasDetailedDescription() const override
235 { return getNSAlias()->hasDetailedDescription(); }
236 const Definition *findInnerCompound(const DString &name) const override
237 { return getNSAlias()->findInnerCompound(name); }
238 bool subGrouping() const override
239 { return getNSAlias()->subGrouping(); }
241 { return getNSAlias()->getMemberList(lt); }
242 const MemberLists &getMemberLists() const override
243 { return getNSAlias()->getMemberLists(); }
244 const MemberDef *getMemberByName(const DString &name) const override
245 { return getNSAlias()->getMemberByName(name); }
246 const MemberGroupList &getMemberGroups() const override
247 { return getNSAlias()->getMemberGroups(); }
249 { return getNSAlias()->getClasses(); }
251 { return getNSAlias()->getInterfaces(); }
253 { return getNSAlias()->getStructs(); }
255 { return getNSAlias()->getExceptions(); }
257 { return getNSAlias()->getNamespaces(); }
259 { return getNSAlias()->getConcepts(); }
260 DString title() const override
261 { return getNSAlias()->title(); }
263 { return getNSAlias()->compoundTypeString(); }
264 int countVisibleMembers() const override
265 { return getNSAlias()->countVisibleMembers(); }
266};
267
268std::unique_ptr<NamespaceDef> createNamespaceDefAlias(const Definition *newScope,const NamespaceDef *nd)
269{
270 auto alnd = std::make_unique<NamespaceDefAliasImpl>(newScope,nd);
271 //printf("alnd name=%s localName=%s qualifiedName=%s displayName()=%s\n",
272 // qPrint(alnd->name()),qPrint(alnd->localName()),qPrint(alnd->qualifiedName()),
273 // qPrint(alnd->displayName()));
274 return alnd;
275}
276
277//------------------------------------------------------------------
278
280 const DString &name,const DString &lref,
281 const DString &fName, const DString &type,
282 bool isPublished) :
283 DefinitionMixin(df,dl,dc,name)
284 ,m_isPublished(isPublished)
285{
286 if (!fName.empty())
287 {
288 if (!lref.empty())
289 {
290 fileName = stripExtension(fName);
291 }
292 else
293 {
294 fileName = convertNameToFile(stripExtension(fName));
295 }
296 }
297 else
298 {
299 setFileNameLocal(name);
300 }
301 setReference(lref);
302 m_inline=false;
303 m_subGrouping=Config_getBool(SUBGROUPING);
304 if (type=="module")
305 {
306 m_type = MODULE;
307 }
308 else if (type=="constants")
309 {
310 m_type = CONSTANT_GROUP;
311 }
312 else if (type=="library")
313 {
314 m_type = LIBRARY;
315 }
316 else
317 {
318 m_type = NAMESPACE;
319 }
320
321 updateLocalName();
322}
323
325{
326 DString locName=name();
327 if (size_t i=locName.rfind("::"); i!=DString::npos) locName=locName.mid(i+2);
328 setLocalName(locName);
329}
330
336
340
342{
343 if (isReference())
344 {
345 fileName = "namespace"+fn;
346 }
347 else
348 {
349 fileName = convertNameToFile("namespace"+fn);
350 }
351}
352
354{
356}
357
359{
360 for (const auto &mg : m_memberGroups)
361 {
362 mg->distributeMemberGroupDocumentation();
363 }
364}
365
367{
371 for (const auto &mg : m_memberGroups)
372 {
373 mg->findSectionsInDocumentation(this);
374 }
375 for (auto &ml : m_memberLists)
376 {
377 if (ml->listType().isDeclaration())
378 {
379 ml->findSectionsInDocumentation(this);
380 }
381 }
382}
383
385{
386 if (fd==nullptr) return;
387 auto it = std::find(files.begin(),files.end(),fd);
388 if (it==files.end())
389 {
390 files.push_back(fd);
391 }
392}
393
395{
396 //printf("%s:NamespaceDefImpl::addInnerCompound(%s)\n",qPrint(name()),qPrint(d->name()));
399 {
401 }
403 {
405 }
407 {
409 }
410}
411
413{
415
416 if (Config_getBool(OPTIMIZE_OUTPUT_SLICE))
417 {
419 {
420 d = &m_interfaces;
421 }
422 else if (cd->compoundType()==ClassDef::Struct)
423 {
424 d = &m_structs;
425 }
426 else if (cd->compoundType()==ClassDef::Exception)
427 {
428 d = &m_exceptions;
429 }
430 }
431
432 d->add(cd->name(),cd);
433}
434
439
444
446 const DString &includeName,bool local, bool force)
447{
448 //printf("NamespaceDefImpl::setIncludeFile(%p,%s,%d,%d)\n",fd,qPrint(includeName),local,force);
449 if (!force || includeName.empty()) return; // only use header provided via \headerfile
450 auto it = m_incInfo.find(includeName.str());
451 if (it == m_incInfo.end())
452 {
453 m_incInfo.insert(std::make_pair(includeName.str(), IncludeInfo(fd,includeName,local ? IncludeKind::IncludeLocal : IncludeKind::IncludeSystem)));
454 }
455}
456
458{
459 if (m_incInfo.empty()) return;
460 ol.startParagraph();
461 for (const auto &kv : m_incInfo)
462 {
463 const IncludeInfo &incInfo = kv.second;
464 DString nm=incInfo.includeName.empty() ?
465 (incInfo.fileDef ?
466 incInfo.fileDef->docName() : DString()
467 ) :
468 incInfo.includeName;
469 if (!nm.empty())
470 {
471 ol.startTypewriter();
472 ol.docify(::includeStatement(SrcLangExt::Cpp,incInfo.kind));
473 ol.docify(::includeOpen(SrcLangExt::Cpp,incInfo.kind));
476 ol.docify(nm);
479 if (incInfo.fileDef)
480 {
481 ol.writeObjectLink(DString(),incInfo.fileDef->includeName(),DString(),nm);
482 }
483 else
484 {
485 ol.docify(nm);
486 }
488 ol.docify(::includeClose(SrcLangExt::Cpp,incInfo.kind));
489 ol.endTypewriter();
490 ol.lineBreak();
491 }
492 }
493 ol.endParagraph();
494}
495
496
498{
499 for (auto &ml : m_memberLists)
500 {
501 if (ml->listType().isDeclaration())
502 {
504 }
505 }
506
507 // add members inside sections to their groups
508 for (const auto &mg : m_memberGroups)
509 {
510 if (mg->allMembersInSameSection() && m_subGrouping)
511 {
512 //printf("----> addToDeclarationSection(%s)\n",qPrint(mg->header()));
513 mg->addToDeclarationSection();
514 }
515 }
516}
517
519{
520 //printf("%s::insertMember(%s) isInline=%d hasDocs=%d\n",qPrint(name()),qPrint(md->name()),
521 // isInline(),hasDocumentation());
522 if (md->isHidden()) return;
524
525 // if this is an inline namespace that is not documented, then insert the
526 // member in the parent scope instead
527 if (isInline() && !hasDocumentation())
528 {
529 Definition *outerScope = getOuterScope();
530 if (outerScope)
531 {
532 if (outerScope->definitionType()==Definition::TypeNamespace)
533 {
535 if (nd && nd!=Doxygen::globalScope)
536 {
537 nd->insertMember(md);
538 if (mdm)
539 {
540 mdm->setNamespace(nd);
541 }
542 }
543 }
544 else if (outerScope->definitionType()==Definition::TypeFile)
545 {
546 FileDef *fd = toFileDef(outerScope);
547 fd->insertMember(md);
548 if (mdm)
549 {
550 mdm->setFileDef(fd);
551 mdm->setOuterScope(fd);
552 }
553 }
554 }
555 }
556 else // member is a non-inline namespace or a documented inline namespace
557 {
558 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
559 if (allMemberList==nullptr)
560 {
561 m_memberLists.emplace_back(std::make_unique<MemberList>(MemberListType::AllMembersList(),MemberListContainer::Namespace));
562 allMemberList = m_memberLists.back().get();
563 }
564 allMemberList->push_back(md);
565 //printf("%s::m_allMembersDict->append(%s)\n",qPrint(name()),qPrint(md->localName()));
566 m_allMembers.add(md->localName(),md);
567 switch(md->memberType())
568 {
569 case MemberType::Variable:
570 addMemberToList(MemberListType::DecVarMembers(),md);
571 addMemberToList(MemberListType::DocVarMembers(),md);
572 break;
573 case MemberType::Function:
574 addMemberToList(MemberListType::DecFuncMembers(),md);
575 addMemberToList(MemberListType::DocFuncMembers(),md);
576 break;
577 case MemberType::Typedef:
578 addMemberToList(MemberListType::DecTypedefMembers(),md);
579 addMemberToList(MemberListType::DocTypedefMembers(),md);
580 break;
581 case MemberType::Sequence:
582 addMemberToList(MemberListType::DecSequenceMembers(),md);
583 addMemberToList(MemberListType::DocSequenceMembers(),md);
584 break;
585 case MemberType::Dictionary:
586 addMemberToList(MemberListType::DecDictionaryMembers(),md);
587 addMemberToList(MemberListType::DocDictionaryMembers(),md);
588 break;
589 case MemberType::Enumeration:
590 addMemberToList(MemberListType::DecEnumMembers(),md);
591 addMemberToList(MemberListType::DocEnumMembers(),md);
592 break;
593 case MemberType::EnumValue:
594 break;
595 case MemberType::Define:
596 addMemberToList(MemberListType::DecDefineMembers(),md);
597 addMemberToList(MemberListType::DocDefineMembers(),md);
598 break;
599 case MemberType::Property:
600 if (md->getLanguage() == SrcLangExt::Python)
601 {
602 addMemberToList(MemberListType::PropertyMembers(),md);
603 addMemberToList(MemberListType::Properties(),md);
604 break;
605 }
606 // fallthrough, explicitly no break here
607 default:
608 err("NamespaceDefImpl::insertMembers(): "
609 "member '{}' with unexpected type '{}' and class scope '{}' inserted in namespace scope '{}'!\n",
610 md->name(), md->memberTypeName(), md->getClassDef() ? md->getClassDef()->name() : "", name());
611 }
612 // if this is an inline namespace, then insert an alias of this member in the outer scope.
613 if (isInline())
614 {
615 Definition *outerScope = getOuterScope();
616 if (outerScope)
617 {
618 std::unique_ptr<MemberDef> aliasMd = createMemberDefAlias(outerScope,md);
619 if (outerScope->definitionType()==Definition::TypeNamespace)
620 {
622 if (ndm)
623 {
624 ndm->insertMember(aliasMd.get());
625 }
626 }
627 else if (outerScope->definitionType()==Definition::TypeFile)
628 {
629 toFileDef(outerScope)->insertMember(aliasMd.get());
630 }
631 if (aliasMd)
632 {
634 mn->push_back(std::move(aliasMd));
635 }
636 }
637 }
638 }
639}
640
642{
643 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
644 if (allMemberList) allMemberList->setAnchors();
645}
646
648{
649 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
650 return ((!briefDescription().empty() && repeatBrief) ||
651 !documentation().empty());
652}
653
655{
658 tagFile << " <compound kind=\"namespace\">\n";
659 tagFile << " <name>" << convertToXML(name()) << "</name>\n";
660 tagFile << " <filename>" << fn << "</filename>\n";
661 DString idStr = id();
662 if (!idStr.empty())
663 {
664 tagFile << " <clangid>" << convertToXML(idStr) << "</clangid>\n";
665 }
666 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
667 {
668 switch (lde->kind())
669 {
670 case LayoutDocEntry::NamespaceNestedNamespaces:
671 {
672 for (const auto &nd : m_namespaces)
673 {
674 if (nd->isLinkableInProject())
675 {
676 tagFile << " <namespace>" << convertToXML(nd->name()) << "</namespace>\n";
677 }
678 }
679 }
680 break;
681 case LayoutDocEntry::NamespaceClasses:
682 {
684 }
685 break;
686 case LayoutDocEntry::NamespaceInterfaces:
687 {
689 }
690 break;
691 case LayoutDocEntry::NamespaceStructs:
692 {
694 }
695 break;
696 case LayoutDocEntry::NamespaceExceptions:
697 {
699 }
700 break;
701 case LayoutDocEntry::NamespaceConcepts:
702 {
703 writeConceptsToTagFile(tagFile);
704 }
705 break;
706 case LayoutDocEntry::MemberDecl:
707 {
708 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
709 if (lmd)
710 {
711 MemberList * ml = getMemberList(lmd->type);
712 if (ml)
713 {
714 ml->writeTagFile(tagFile);
715 }
716 }
717 }
718 break;
719 case LayoutDocEntry::MemberGroups:
720 {
721 for (const auto &mg : m_memberGroups)
722 {
723 mg->writeTagFile(tagFile);
724 }
725 }
726 break;
727 default:
728 break;
729 }
730 }
732 tagFile << " </compound>\n";
733}
734
736{
738 {
741 ol.writeRuler();
745 ol.writeAnchor(DString(),"details");
747 ol.startGroupHeader("details");
748 ol.parseText(title);
749 ol.endGroupHeader();
750
751 ol.startTextBlock();
752 if (!briefDescription().empty() && Config_getBool(REPEAT_BRIEF))
753 {
755 briefLine(),
756 this,
757 nullptr,
759 DocOptions());
760 }
761 if (!briefDescription().empty() && Config_getBool(REPEAT_BRIEF) &&
762 !documentation().empty())
763 {
767 ol.enableAll();
770 ol.writeString("\n\n");
772 }
773 if (!documentation().empty())
774 {
775 ol.generateDoc(docFile(),
776 docLine(),
777 this,
778 nullptr,
779 documentation()+"\n",
780 DocOptions()
781 .setIndexWords(true));
782 }
784 ol.endTextBlock();
785 }
786}
787
789{
791 {
792 auto parser { createDocParser() };
793 auto ast { validatingParseDoc(*parser.get(),
794 briefFile(),
795 briefLine(),
796 this,
797 nullptr,
799 DocOptions()
800 .setIndexWords(true)
801 .setSingleLine(true))
802 };
803 if (!ast->empty())
804 {
805 ol.startParagraph();
808 ol.writeString(" - ");
810 ol.writeDoc(ast.get(),this,nullptr);
813 ol.writeString(" \n");
815
817 {
819 ol.startTextLink(getOutputFileBase(),"details");
821 ol.endTextLink();
822 }
824 ol.endParagraph();
825 }
826 }
827
828 // Write a summary of the Slice definition including metadata.
829 if (getLanguage() == SrcLangExt::Slice)
830 {
831 ol.startParagraph();
832 ol.startTypewriter();
833 if (!metaData.empty())
834 {
835 ol.docify(metaData);
836 ol.lineBreak();
837 }
838 ol.docify("module ");
839 ol.docify(stripScope(name()));
840 ol.docify(" { ... }");
841 ol.endTypewriter();
842 ol.endParagraph();
843 }
844
845 ol.writeSynopsis();
846}
847
852
857
859{
860 if (Config_getBool(SEPARATE_MEMBER_PAGES))
861 {
864 }
865}
866
868{
869 if (Config_getBool(SEPARATE_MEMBER_PAGES))
870 {
873 }
874}
875
880
885
890
896
898{
899 /* write user defined member groups */
900 for (const auto &mg : m_memberGroups)
901 {
902 if (!mg->allMembersInSameSection() || !m_subGrouping)
903 {
904 mg->writeDeclarations(ol,nullptr,this,nullptr,nullptr,nullptr);
905 }
906 }
907}
908
910{
911 // write Author section (Man only)
914 ol.startGroupHeader();
915 ol.parseText(theTranslator->trAuthor(true,true));
916 ol.endGroupHeader();
919}
920
922{
925 bool first=true;
926 SrcLangExt lang = getLanguage();
927 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
928 {
929 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
930 if (lde->kind()==LayoutDocEntry::NamespaceClasses && m_classes.declVisible() && ls)
931 {
932 DString label = "nested-classes";
933 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
934 first=false;
935 }
936 else if (lde->kind()==LayoutDocEntry::NamespaceInterfaces && m_interfaces.declVisible() && ls)
937 {
938 DString label = "interfaces";
939 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
940 first=false;
941 }
942 else if (lde->kind()==LayoutDocEntry::NamespaceStructs && m_structs.declVisible() && ls)
943 {
944 DString label = "structs";
945 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
946 first=false;
947 }
948 else if (lde->kind()==LayoutDocEntry::NamespaceExceptions && m_exceptions.declVisible() && ls)
949 {
950 DString label = "exceptions";
951 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
952 first=false;
953 }
954 else if (lde->kind()==LayoutDocEntry::NamespaceNestedNamespaces && m_namespaces.declVisible(false) && ls)
955 {
956 DString label = "namespaces";
957 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
958 first=false;
959 }
960 else if (lde->kind()==LayoutDocEntry::NamespaceNestedConstantGroups && m_namespaces.declVisible(true) && ls)
961 {
962 DString label = "constantgroups";
963 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
964 first=false;
965 }
966 else if (lde->kind()==LayoutDocEntry::NamespaceConcepts && m_concepts.declVisible() && ls)
967 {
968 DString label = "concepts";
969 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
970 first=false;
971 }
972 else if (lde->kind()== LayoutDocEntry::MemberDecl)
973 {
974 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
975 if (lmd)
976 {
977 MemberList * ml = getMemberList(lmd->type);
978 if (ml && ml->declVisible())
979 {
980 ol.writeSummaryLink(DString(),ml->listType().toLabel(),lmd->title(lang),first);
981 first=false;
982 }
983 }
984 }
985 }
986 if (!first)
987 {
988 ol.writeString(" </div>\n");
989 }
991}
992
997
999{
1000 // UNO IDL constant groups may be published
1001 if (getLanguage()==SrcLangExt::IDL && isConstantGroup() && m_isPublished)
1002 {
1003 ol.pushGeneratorState();
1005 ol.startLabels();
1006 ol.writeLabel("published",false);
1007 ol.endLabels();
1008 ol.popGeneratorState();
1009 }
1010 else if (isExported())
1011 {
1012 ol.pushGeneratorState();
1014 ol.startLabels();
1015 ol.writeLabel("export",false);
1016 ol.endLabels();
1017 ol.popGeneratorState();
1018 }
1019}
1020
1022{
1023 for (const auto &cd : list)
1024 {
1025 if (cd->isLinkableInProject())
1026 {
1027 tagFile << " <class kind=\"" << cd->compoundTypeString()
1028 << "\">" << convertToXML(cd->name()) << "</class>\n";
1029 }
1030 }
1031}
1032
1034{
1035 for (const auto &cd : m_concepts)
1036 {
1037 if (cd->isLinkableInProject())
1038 {
1039 tagFile << " <concept>" << convertToXML(cd->name()) << "</concept>\n";
1040 }
1041 }
1042}
1043
1045{
1046 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
1047 //bool outputJava = Config_getBool(OPTIMIZE_OUTPUT_JAVA);
1048 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
1049
1050 DString pageTitle = title();
1051 startFile(ol,getOutputFileBase(),false,name(),pageTitle,HighlightedItem::NamespaceVisible,!generateTreeView);
1052
1053 if (!generateTreeView)
1054 {
1056 {
1058 }
1059 ol.endQuickIndices();
1060 }
1061
1062 startTitle(ol,getOutputFileBase(),this);
1063 ol.parseText(pageTitle);
1064 addGroupListToTitle(ol,this);
1067 ol.startContents();
1068
1069 //---------------------------------------- start flexible part -------------------------------
1070
1071 SrcLangExt lang = getLanguage();
1072 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
1073 {
1074 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
1075 switch (lde->kind())
1076 {
1077 case LayoutDocEntry::BriefDesc:
1079 break;
1080 case LayoutDocEntry::MemberDeclStart:
1082 break;
1083 case LayoutDocEntry::NamespaceClasses:
1084 {
1085 if (ls) writeClassDeclarations(ol,ls->title(lang),m_classes);
1086 }
1087 break;
1088 case LayoutDocEntry::NamespaceInterfaces:
1089 {
1090 if (ls) writeClassDeclarations(ol,ls->title(lang),m_interfaces);
1091 }
1092 break;
1093 case LayoutDocEntry::NamespaceStructs:
1094 {
1095 if (ls) writeClassDeclarations(ol,ls->title(lang),m_structs);
1096 }
1097 break;
1098 case LayoutDocEntry::NamespaceExceptions:
1099 {
1100 if (ls) writeClassDeclarations(ol,ls->title(lang),m_exceptions);
1101 }
1102 break;
1103 case LayoutDocEntry::NamespaceConcepts:
1104 {
1105 if (ls) writeConcepts(ol,ls->title(lang));
1106 }
1107 break;
1108 case LayoutDocEntry::NamespaceNestedNamespaces:
1109 {
1110 if (ls) writeNamespaceDeclarations(ol,ls->title(lang),false);
1111 }
1112 break;
1113 case LayoutDocEntry::NamespaceNestedConstantGroups:
1114 {
1115 if (ls) writeNamespaceDeclarations(ol,ls->title(lang),true);
1116 }
1117 break;
1118 case LayoutDocEntry::MemberGroups:
1120 break;
1121 case LayoutDocEntry::MemberDecl:
1122 {
1123 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
1124 if (lmd) writeMemberDeclarations(ol,lmd->type,lmd->title(lang));
1125 }
1126 break;
1127 case LayoutDocEntry::MemberDeclEnd:
1129 break;
1130 case LayoutDocEntry::DetailedDesc:
1131 {
1132 if (ls) writeDetailedDescription(ol,ls->title(lang));
1133 }
1134 break;
1135 case LayoutDocEntry::MemberDefStart:
1137 break;
1138 case LayoutDocEntry::NamespaceInlineClasses:
1140 break;
1141 case LayoutDocEntry::MemberDef:
1142 {
1143 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
1144 if (lmd) writeMemberDocumentation(ol,lmd->type,lmd->title(lang));
1145 }
1146 break;
1147 case LayoutDocEntry::MemberDefEnd:
1149 break;
1150 case LayoutDocEntry::AuthorSection:
1152 break;
1153 case LayoutDocEntry::Includes:
1155 break;
1156 case LayoutDocEntry::ClassInheritanceGraph:
1157 case LayoutDocEntry::ClassNestedClasses:
1158 case LayoutDocEntry::ClassCollaborationGraph:
1159 case LayoutDocEntry::ClassAllMembersLink:
1160 case LayoutDocEntry::ClassUsedFiles:
1161 case LayoutDocEntry::ClassInlineClasses:
1162 case LayoutDocEntry::ConceptDefinition:
1163 case LayoutDocEntry::FileClasses:
1164 case LayoutDocEntry::FileConcepts:
1165 case LayoutDocEntry::FileInterfaces:
1166 case LayoutDocEntry::FileStructs:
1167 case LayoutDocEntry::FileExceptions:
1168 case LayoutDocEntry::FileNamespaces:
1169 case LayoutDocEntry::FileConstantGroups:
1170 case LayoutDocEntry::FileIncludeGraph:
1171 case LayoutDocEntry::FileIncludedByGraph:
1172 case LayoutDocEntry::FileSourceLink:
1173 case LayoutDocEntry::FileInlineClasses:
1174 case LayoutDocEntry::GroupClasses:
1175 case LayoutDocEntry::GroupConcepts:
1176 case LayoutDocEntry::GroupModules:
1177 case LayoutDocEntry::GroupInlineClasses:
1178 case LayoutDocEntry::GroupNamespaces:
1179 case LayoutDocEntry::GroupDirs:
1180 case LayoutDocEntry::GroupNestedGroups:
1181 case LayoutDocEntry::GroupFiles:
1182 case LayoutDocEntry::GroupGraph:
1183 case LayoutDocEntry::GroupPageDocs:
1184 case LayoutDocEntry::ModuleExports:
1185 case LayoutDocEntry::ModuleClasses:
1186 case LayoutDocEntry::ModuleConcepts:
1187 case LayoutDocEntry::ModuleUsedFiles:
1188 case LayoutDocEntry::DirSubDirs:
1189 case LayoutDocEntry::DirFiles:
1190 case LayoutDocEntry::DirGraph:
1191 err("Internal inconsistency: member '{}' should not be part of "
1192 "LayoutDocManager::Namespace entry list\n",lde->entryToString());
1193 break;
1194 }
1195 }
1196
1197 //---------------------------------------- end flexible part -------------------------------
1198
1199 ol.endContents();
1200
1201 endFileWithNavPath(ol,this);
1202
1203 if (Config_getBool(SEPARATE_MEMBER_PAGES))
1204 {
1205 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
1206 if (allMemberList) allMemberList->sort();
1207 writeMemberPages(ol);
1208 }
1209}
1210
1212{
1213 ol.pushGeneratorState();
1215
1216 for (const auto &ml : m_memberLists)
1217 {
1218 if (ml->listType().isDocumentation())
1219 {
1220 ml->writeDocumentationPage(ol,displayName(),this);
1221 }
1222 }
1223 ol.popGeneratorState();
1224}
1225
1227{
1228 bool createSubDirs=Config_getBool(CREATE_SUBDIRS);
1229
1230 ol.writeString(" <div class=\"navtab\">\n");
1231 ol.writeString(" <table>\n");
1232
1233 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
1234 if (allMemberList)
1235 {
1236 for (const auto &md : *allMemberList)
1237 {
1238 if (md->getNamespaceDef()==this && md->isLinkable() && !md->isEnumValue())
1239 {
1240 if (md->isLinkableInProject())
1241 {
1242 DString fn = md->getOutputFileBase();
1244 if (md==currentMd) // selected item => highlight
1245 {
1246 ol.writeString(" <tr><td class=\"navtabHL\">");
1247 }
1248 else
1249 {
1250 ol.writeString(" <tr><td class=\"navtab\">");
1251 }
1252 ol.writeString("<span class=\"label\"><a ");
1253 ol.writeString("href=\"");
1254 if (createSubDirs) ol.writeString("../../");
1255 ol.writeString(fn+"#"+md->anchor());
1256 ol.writeString("\">");
1257 ol.writeString(convertToHtml(md->localName()));
1258 ol.writeString("</a></span>");
1259 ol.writeString("</td></tr>\n");
1260 }
1261 }
1262 }
1263 }
1264
1265 ol.writeString(" </table>\n");
1266 ol.writeString(" </div>\n");
1267}
1268
1270{
1271 for (auto &ml : m_memberLists)
1272 {
1273 ml->countDecMembers();
1274 ml->countDocMembers();
1275 }
1276 for (const auto &mg : m_memberGroups)
1277 {
1278 mg->countDecMembers();
1279 mg->countDocMembers();
1280 }
1281}
1282
1284{
1285 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
1286 return (allMemberList ? allMemberList->numDocMembers() : 0) + static_cast<int>(m_innerCompounds.size());
1287}
1288
1290{
1292 //printf("%s: NamespaceDefImpl::addUsingDirective: %s:%zu\n",qPrint(name()),qPrint(nd->qualifiedName()),m_usingDirList.size());
1293}
1294
1299
1304
1306{
1307 if (n==nullptr) return nullptr;
1308 const Definition *d = m_innerCompounds.find(n);
1309 if (d==nullptr)
1310 {
1311 if (!m_usingDirList.empty())
1312 {
1313 d = m_usingDirList.find(n);
1314 }
1315 if (d==nullptr && !m_usingDeclList.empty())
1316 {
1317 d = m_usingDeclList.find(n);
1318 }
1319 }
1320 return d;
1321}
1322
1324{
1326 qualifiedName(),
1327 getLanguage()==SrcLangExt::Fortran ?
1328 theTranslator->trModule(true,true) :
1329 theTranslator->trNamespace(true,true),
1331 DString(),
1332 this
1333 );
1334 for (const auto &mg : m_memberGroups)
1335 {
1336 mg->addListReferences(this);
1337 }
1338 for (auto &ml : m_memberLists)
1339 {
1340 if (ml->listType().isDocumentation())
1341 {
1342 ml->addListReferences(this);
1343 }
1344 }
1345}
1346
1348{
1350 for (const auto &mg : m_memberGroups)
1351 {
1352 mg->addRequirementReferences(this);
1353 }
1354 for (auto &ml : m_memberLists)
1355 {
1356 if (ml->listType().isDocumentation())
1357 {
1358 ml->addRequirementReferences(this);
1359 }
1360 }
1361}
1362
1364{
1365 return makeDisplayName(this,includeScope);
1366}
1367
1369{
1370 if (visitedNamespaces.find(this)!=visitedNamespaces.end()) return; // already processed
1371 visitedNamespaces.insert(this);
1372
1374 for (auto &nd : usingDirList)
1375 {
1377 if (ndm)
1378 {
1379 ndm->combineUsingRelations(visitedNamespaces);
1380 }
1381 }
1382
1383 for (auto &nd : usingDirList)
1384 {
1385 // add used namespaces of namespace nd to this namespace
1386 for (const auto &und : nd->getUsedNamespaces())
1387 {
1388 addUsingDirective(und);
1389 }
1390 // add used classes of namespace nd to this namespace
1391 for (const auto &ud : nd->getUsedDefinitions())
1392 {
1394 }
1395 }
1396}
1397
1399{
1400 int count=0;
1401 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
1402 {
1403 if (lde->kind()==LayoutDocEntry::MemberDef)
1404 {
1405 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
1406 if (lmd)
1407 {
1408 MemberList *ml = getMemberList(lmd->type);
1409 if (ml)
1410 {
1411 for (const auto &md : *ml)
1412 {
1413 if (md->visibleInIndex())
1414 {
1415 count++;
1416 }
1417 }
1418 }
1419 }
1420 }
1421 }
1422 return count;
1423}
1424
1425
1426
1427//-------------------------------------------------------------------------------
1428
1429bool NamespaceLinkedRefMap::declVisible(bool isConstantGroup) const
1430{
1431 bool found=false;
1432 for (const auto &nd : *this)
1433 {
1434 if (nd->isLinkable() && nd->hasDocumentation())
1435 {
1436 SrcLangExt lang = nd->getLanguage();
1437 if (SrcLangExt::IDL==lang)
1438 {
1439 if (isConstantGroup == nd->isConstantGroup())
1440 {
1441 found=true;
1442 break;
1443 }
1444 }
1445 else if (!isConstantGroup) // ensure we only get extra section in IDL
1446 {
1447 if (nd->isConstantGroup())
1448 {
1449 err("Internal inconsistency: constant group but not IDL?\n");
1450 }
1451 found=true;
1452 break;
1453 }
1454 }
1455 }
1456 return found;
1457}
1458
1460 bool const isConstantGroup,bool localName)
1461{
1462
1463
1464 if (empty()) return; // no namespaces in the list
1465
1466 if (Config_getBool(OPTIMIZE_OUTPUT_VHDL)) return;
1467
1468 if (!declVisible(isConstantGroup)) return;
1469
1470 // write list of namespaces
1471 ol.startMemberHeader(isConstantGroup ? "constantgroups" : "namespaces");
1472 //bool javaOpt = Config_getBool(OPTIMIZE_OUTPUT_JAVA);
1473 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
1474 ol.parseText(title);
1475 ol.endMemberHeader();
1476 ol.startMemberList();
1477 for (const auto &nd : *this)
1478 {
1479 if (nd->isLinkable() && nd->hasDocumentation())
1480 {
1481 SrcLangExt lang = nd->getLanguage();
1482 if (lang==SrcLangExt::IDL && (isConstantGroup != nd->isConstantGroup()))
1483 continue; // will be output in another pass, see layout_default.xml
1485 DString name = localName ? nd->localName() : nd->displayName();
1486 DString anc = nd->anchor();
1487 if (anc.empty()) anc=name; else anc.prepend(name+"_");
1489 DString ct = nd->compoundTypeString();
1490 ol.docify(ct);
1491 ol.docify(" ");
1492 ol.insertMemberAlign();
1493 ol.writeObjectLink(nd->getReference(),nd->getOutputFileBase(),DString(),name);
1495 if (!nd->briefDescription().empty() && Config_getBool(BRIEF_MEMBER_DESC))
1496 {
1497 ol.startMemberDescription(nd->getOutputFileBase());
1498 ol.generateDoc(nd->briefFile(),
1499 nd->briefLine(),
1500 nd,
1501 nullptr,
1502 nd->briefDescription(),
1503 DocOptions()
1504 .setSingleLine(true));
1506 }
1508 }
1509 }
1510 ol.endMemberList();
1511}
1512
1513//-------------------------------------------------------------------------------
1514
1516{
1517 bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS);
1518 bool sortMemberDocs = Config_getBool(SORT_MEMBER_DOCS);
1520 ml->setNeedsSorting(
1521 (ml->listType().isDeclaration() && sortBriefDocs) ||
1522 (ml->listType().isDocumentation() && sortMemberDocs));
1523 ml->push_back(md);
1524
1525 if (ml->listType().isDeclaration())
1526 {
1528 if (mdm)
1529 {
1530 mdm->setSectionList(this,ml.get());
1531 }
1532 }
1533}
1534
1535template<class Container>
1536bool needsSorting(const Container &container)
1537{
1538 DString prev;
1539 bool allSame = true;
1540 for (const auto &c : container)
1541 {
1542 DString name = c->getDefFileName();
1543 if (!prev.empty() && prev!=name)
1544 {
1545 allSame = false;
1546 break;
1547 }
1548 prev = name;
1549 }
1550 return !allSame || Config_getBool(SORT_BRIEF_DOCS);
1551}
1552
1554{
1555 for (auto &ml : m_memberLists)
1556 {
1557 if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(false); }
1558 }
1559
1560 auto classComp = [](const ClassLinkedRefMap::Ptr &c1,const ClassLinkedRefMap::Ptr &c2)
1561 {
1562 return Config_getBool(SORT_BY_SCOPE_NAME) ?
1563 dstricmp_sort(c1->name(), c2->name())<0 :
1564 dstricmp_sort(c1->className(), c2->className())<0;
1565 };
1566
1567 if (needsSorting(m_classes)) std::stable_sort(m_classes.begin(), m_classes.end(), classComp);
1568 if (needsSorting(m_interfaces)) std::stable_sort(m_interfaces.begin(),m_interfaces.end(),classComp);
1569 if (needsSorting(m_structs)) std::stable_sort(m_structs.begin(), m_structs.end(), classComp);
1570 if (needsSorting(m_exceptions)) std::stable_sort(m_exceptions.begin(),m_exceptions.end(),classComp);
1571
1572 auto conceptComp = [](const ConceptLinkedRefMap::Ptr &c1,const ConceptLinkedRefMap::Ptr &c2)
1573 {
1574 return dstricmp_sort(c1->name(),c2->name())<0;
1575 };
1576
1577 if (needsSorting(m_concepts)) std::stable_sort(m_concepts.begin(), m_concepts.end(), conceptComp);
1578
1579 auto namespaceComp = [](const NamespaceLinkedRefMap::Ptr &n1,const NamespaceLinkedRefMap::Ptr &n2)
1580 {
1581 return dstricmp_sort(n1->name(),n2->name())<0;
1582 };
1583
1584 if (needsSorting(m_namespaces)) std::stable_sort(m_namespaces.begin(),m_namespaces.end(),namespaceComp);
1585
1586}
1587
1589{
1590 for (auto &ml : m_memberLists)
1591 {
1592 if (ml->listType()==lt)
1593 {
1594 return ml.get();
1595 }
1596 }
1597 return nullptr;
1598}
1599
1601{
1602 MemberList * ml = getMemberList(lt);
1603 if (ml) ml->writeDeclarations(ol,nullptr,this,nullptr,nullptr,nullptr,title,DString());
1604}
1605
1611
1612static bool hasNonReferenceNestedNamespaceRec(const NamespaceDef *nd,int level)
1613{
1614 if (level>30)
1615 {
1616 err("Possible recursive namespace relation while inside {}\n",nd->name());
1617 return false;
1618 }
1619 bool found=nd->isLinkableInProject();
1620 if (found)
1621 {
1622 return true;
1623 }
1624 else
1625 {
1626 for (const auto &ind : nd->getNamespaces())
1627 {
1628 found = found || hasNonReferenceNestedNamespaceRec(ind,level+1);
1629 if (found) break;
1630 }
1631 }
1632 return found;
1633}
1634
1636{
1637 bool allExternals = Config_getBool(ALLEXTERNALS);
1638 return allExternals || hasNonReferenceNestedNamespaceRec(this,0) || isLinkable();
1639}
1640
1642{
1643 size_t i = name().rfind("::");
1644 if (i==DString::npos) i=0; else i+=2;
1645 bool extractAnonNs = Config_getBool(EXTRACT_ANON_NSPACES);
1646 bool hideUndoc = Config_getBool(HIDE_UNDOC_NAMESPACES);
1647 if (extractAnonNs && // extract anonymous ns
1648 name().mid(i,20)=="anonymous_namespace{" // correct prefix
1649 ) // not disabled by config
1650 {
1651 return true;
1652 }
1653 return !name().empty() && name().at(i)!='@' && // not anonymous
1654 (hasDocumentation() || !hideUndoc || getLanguage()==SrcLangExt::CSharp) && // documented
1655 !isReference() && // not an external reference
1656 !isHidden() && // not hidden
1657 !isArtificial(); // or artificial
1658}
1659
1661{
1662 return isLinkableInProject() || isReference();
1663}
1664
1666{
1667 return m_allMembers.find(n);
1668}
1669
1671{
1672 DString pageTitle;
1673 SrcLangExt lang = getLanguage();
1674
1675 auto getReferenceTitle = [this](std::function<DString()> translateFunc) -> DString
1676 {
1677 return Config_getBool(HIDE_COMPOUND_REFERENCE) ? displayName() : translateFunc();
1678 };
1679
1680 if (lang==SrcLangExt::Java)
1681 {
1682 pageTitle = theTranslator->trPackage(displayName());
1683 }
1684 else if (lang==SrcLangExt::Fortran || lang==SrcLangExt::Slice)
1685 {
1686 pageTitle = getReferenceTitle([this](){
1688 });
1689 }
1690 else if (lang==SrcLangExt::IDL)
1691 {
1692 pageTitle = getReferenceTitle([this](){
1693 return isConstantGroup()
1696 });
1697 }
1698 else
1699 {
1700 pageTitle = getReferenceTitle([this](){
1702 });
1703 }
1704 return pageTitle;
1705}
1706
1708{
1709 SrcLangExt lang = getLanguage();
1710 if (lang==SrcLangExt::Java)
1711 {
1712 return "package";
1713 }
1714 else if(lang==SrcLangExt::CSharp)
1715 {
1716 return "namespace";
1717 }
1718 else if (lang==SrcLangExt::Fortran)
1719 {
1720 return "module";
1721 }
1722 else if (lang==SrcLangExt::IDL)
1723 {
1724 if (isModule())
1725 {
1726 return "module";
1727 }
1728 else if (isConstantGroup())
1729 {
1730 return "constants";
1731 }
1732 else if (isLibrary())
1733 {
1734 return "library";
1735 }
1736 else
1737 {
1738 err_full(getDefFileName(),getDefLine(),"Internal inconsistency: namespace in IDL not module, library or constant group");
1739 }
1740 }
1741 return "namespace";
1742}
1743
1745{
1746 metaData = m;
1747}
1748
1749// --- Cast functions
1750//
1752{
1753 if (d && (typeid(*d)==typeid(NamespaceDefImpl) || typeid(*d)==typeid(NamespaceDefAliasImpl)))
1754 {
1755 return static_cast<NamespaceDef*>(d);
1756 }
1757 else
1758 {
1759 return nullptr;
1760 }
1761}
1762
1764{
1765 Definition *d = toDefinition(md);
1766 if (d && typeid(*d)==typeid(NamespaceDefImpl))
1767 {
1768 return static_cast<NamespaceDef*>(d);
1769 }
1770 else
1771 {
1772 return nullptr;
1773 }
1774}
1775
1776
1778{
1779 if (d && (typeid(*d)==typeid(NamespaceDefImpl) || typeid(*d)==typeid(NamespaceDefAliasImpl)))
1780 {
1781 return static_cast<const NamespaceDef*>(d);
1782 }
1783 else
1784 {
1785 return nullptr;
1786 }
1787}
1788
1790{
1791 if (d && typeid(*d)==typeid(NamespaceDefImpl))
1792 {
1793 return static_cast<NamespaceDefMutable*>(d);
1794 }
1795 else
1796 {
1797 return nullptr;
1798 }
1799}
1800
1801// --- Helpers
1802
1803static NamespaceDef *getResolvedNamespaceRec(StringSet &namespacesTried,const NamespaceAliasInfo &aliasInfo);
1804
1805static DString replaceNamespaceAliasesRec(StringSet &namespacesTried,const DString &name)
1806{
1807 DString result = name;
1808 //printf("> replaceNamespaceAliasesRec(%s)\n",qPrint(name));
1809 if (namespacesTried.find(name.str())==namespacesTried.end())
1810 {
1811 namespacesTried.insert(name.str());
1812 size_t p = 0;
1813 for (;;)
1814 {
1815 size_t i = name.str().find("::",p);
1816 if (i==std::string::npos)
1817 {
1818 auto it = Doxygen::namespaceAliasMap.find(name.str());
1819 if (it != Doxygen::namespaceAliasMap.end())
1820 {
1821 //printf("found map %s->%s\n",qPrint(name),qPrint(it->second.alias));
1822 auto ns = getResolvedNamespaceRec(namespacesTried,it->second);
1823 if (ns)
1824 {
1825 result = replaceNamespaceAliasesRec(namespacesTried,ns->qualifiedName());
1826 }
1827 }
1828 break;
1829 }
1830 else
1831 {
1832 auto it = Doxygen::namespaceAliasMap.find(name.left(i).str());
1833 if (it != Doxygen::namespaceAliasMap.end())
1834 {
1835 //printf("found map %s|%s->%s\n",qPrint(name.left(i)),qPrint(name.mid(i)),qPrint(it->second.alias));
1836 auto ns = getResolvedNamespaceRec(namespacesTried,it->second);
1837 if (ns)
1838 {
1839 result = replaceNamespaceAliasesRec(namespacesTried,ns->qualifiedName()+name.mid(i));
1840 break;
1841 }
1842 }
1843 }
1844 p = i+2;
1845 }
1846 }
1847 //printf("< replaceNamespaceAliasesRec(%s)=%s\n",qPrint(name),qPrint(result));
1848 return result;
1849}
1850
1851static NamespaceDef *getResolvedNamespaceRec(StringSet &namespacesTried,const NamespaceAliasInfo &aliasInfo)
1852{
1853 size_t j = aliasInfo.context.length();
1854 for (;;)
1855 {
1856 if (j>0)
1857 {
1858 //printf("candidate %s|::%s\n",qPrint(aliasInfo.context.substr(0,j)),qPrint(aliasInfo.alias));
1859 auto candidate = replaceNamespaceAliasesRec(namespacesTried,aliasInfo.context.substr(0,j)+"::"+aliasInfo.alias);
1860 auto nd = Doxygen::namespaceLinkedMap->find(candidate);
1861 if (nd)
1862 {
1863 return nd;
1864 }
1865 }
1866 if (j>0) // strip one level from context, i.e. given N1::N2::N3
1867 // j==10 -> j==6 (N1::N2::N3->N1::N2), and then
1868 // j==6 -> j==2 (N1::N2->N1), and then
1869 // j==2 -> j==std::string::npos (N1->"")
1870 {
1871 j = aliasInfo.context.rfind("::",j-1);
1872 }
1873 else
1874 {
1875 j = std::string::npos;
1876 }
1877 if (j==std::string::npos)
1878 {
1879 //printf("candidate %s\n",qPrint(aliasInfo.alias));
1880 auto candidate = replaceNamespaceAliasesRec(namespacesTried,aliasInfo.alias);
1881 auto nd = Doxygen::namespaceLinkedMap->find(candidate);
1882 if (nd)
1883 {
1884 return nd;
1885 }
1886 break;
1887 }
1888 }
1889 return nullptr;
1890}
1891
1893{
1894 //printf("> replaceNamespaceAliases(%s)\n",qPrint(name));
1895 StringSet namespacesTried;
1896 name = replaceNamespaceAliasesRec(namespacesTried,name);
1897 //printf("< replaceNamespaceAliases: result=%s\n",qPrint(name));
1898}
1899
1901{
1902 //printf("> getResolvedNamespace(%s)\n",qPrint(name));
1903 if (name.empty()) return nullptr;
1904 StringSet namespacesTried;
1905 auto ns = getResolvedNamespaceRec(namespacesTried,NamespaceAliasInfo(name.str()));
1906 //printf("< getResolvedNamespace(%s)=%s\n",qPrint(name),ns?qPrint(ns->qualifiedName()):"nullptr");
1907 return ns;
1908}
1909
1910//--------------------------------------------------------------------------------------
1911//
1913{
1914 for (const auto &cnd : nd->getNamespaces())
1915 {
1916 if (cnd->isLinkableInProject() && !cnd->isAnonymous())
1917 {
1918 return true;
1919 }
1920 }
1921 return false;
1922}
1923
1925{
1926 //printf(">namespaceHasNestedConcept(%s)\n",qPrint(nd->name()));
1927 for (const auto &cnd : nd->getNamespaces())
1928 {
1930 {
1931 //printf("<namespaceHasNestedConcept(%s): case1\n",qPrint(nd->name()));
1932 return true;
1933 }
1934 }
1935 for (const auto &cnd : nd->getConcepts())
1936 {
1937 //printf("candidate %s isLinkableInProject()=%d\n",qPrint(cnd->name()),cnd->isLinkableInProject());
1938 if (cnd->isLinkableInProject())
1939 {
1940 //printf("<namespaceHasNestedConcept(%s): case2\n",qPrint(nd->name()));
1941 return true;
1942 }
1943 }
1944 //printf("<namespaceHasNestedConcept(%s): case3\n",qPrint(nd->name()));
1945 return false;
1946}
1947
1949{
1950 //printf(">namespaceHasNestedClass(%s,filterClasses=%d)\n",qPrint(nd->name()),filterClasses);
1951 for (const auto &cnd : nd->getNamespaces())
1952 {
1953 if (namespaceHasNestedClass(cnd,filterClasses,ct))
1954 {
1955 //printf("<namespaceHasNestedClass(%s,filterClasses=%d): case1\n",qPrint(nd->name()),filterClasses);
1956 return true;
1957 }
1958 }
1959
1960 ClassLinkedRefMap list = nd->getClasses();
1961 if (filterClasses)
1962 {
1963 switch (ct)
1964 {
1966 list = nd->getInterfaces();
1967 break;
1968 case ClassDef::Struct:
1969 list = nd->getStructs();
1970 break;
1972 list = nd->getExceptions();
1973 break;
1974 default:
1975 break;
1976 }
1977 }
1978
1979 for (const auto &cd : list)
1980 {
1981 //printf("candidate %s isLinkableInProject()=%d\n",qPrint(cd->name()),cd->isLinkableInProject());
1982 if (cd->isLinkableInProject())
1983 {
1984 //printf("<namespaceHasNestedClass(%s,filterClasses=%d): case2\n",qPrint(nd->name()),filterClasses);
1985 return true;
1986 }
1987 }
1988 //printf("<namespaceHasNestedClass(%s,filterClasses=%d): case3\n",qPrint(nd->name()),filterClasses);
1989 return false;
1990}
1991
1992
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 DString includeName() const =0
virtual const DString & docName() const =0
virtual void insertMember(MemberDef *md)=0
Class representing the data associated with a #include statement.
Definition filedef.h:72
IncludeKind kind
Definition filedef.h:79
const FileDef * fileDef
Definition filedef.h:77
DString includeName
Definition filedef.h:78
static LayoutDocManager & instance()
Returns a reference to this singleton.
Definition layout.cpp:1439
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
std::map< std::string, IncludeInfo > m_incInfo
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
void setIncludeFile(FileDef *fd, const DString &incName, bool local, bool force) override
int numDocMembers() const override
ClassLinkedRefMap m_exceptions
bool subGrouping() const override
bool isModule() const override
void writeIncludeFiles(OutputList &ol) const
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
DString includeClose(SrcLangExt lang, IncludeKind kind)
Definition filedef.cpp:82
DString includeOpen(SrcLangExt lang, IncludeKind kind)
Definition filedef.cpp:69
FileDef * toFileDef(Definition *d)
Definition filedef.cpp:2027
DString includeStatement(SrcLangExt lang, IncludeKind kind)
Definition filedef.cpp:52
@ IncludeLocal
Definition filedef.h:47
@ IncludeSystem
Definition filedef.h:46
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:1790
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:1802
Definition layout.h:101
DString title(SrcLangExt lang) const
Definition layout.cpp:1783
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:2864
void addGroupListToTitle(OutputList &ol, const Definition *d)
Definition util.cpp:3922
DString stripScope(const DString &name)
Definition util.cpp:3110
void createSubDirs(const Dir &d)
Definition util.cpp:2970
DString convertToHtml(const DString &s, bool keepEntities)
Definition util.cpp:3292
void addHtmlExtensionIfMissing(DString &fName)
Definition util.cpp:3932
DString convertToXML(const DString &s, bool keepEntities, const bool citeEntry)
Definition util.cpp:3233
DString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Definition util.cpp:4630
DString removeAnonymousScopes(const DString &str)
Definition util.cpp:98
A bunch of utility functions.