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 if (md->anonymousMemberForDeclaration()==nullptr) // not a split member that has a separate declaration member
571 {
572 addMemberToList(MemberListType::DecVarMembers(),md);
573 }
574 if (!md->isAnonymous() && md->anonymousMemberForDetails()==nullptr) // not a split member that has a separate details member
575 {
576 addMemberToList(MemberListType::DocVarMembers(),md);
577 }
578 break;
579 case MemberType::Function:
580 addMemberToList(MemberListType::DecFuncMembers(),md);
581 addMemberToList(MemberListType::DocFuncMembers(),md);
582 break;
583 case MemberType::Typedef:
584 addMemberToList(MemberListType::DecTypedefMembers(),md);
585 addMemberToList(MemberListType::DocTypedefMembers(),md);
586 break;
587 case MemberType::Sequence:
588 addMemberToList(MemberListType::DecSequenceMembers(),md);
589 addMemberToList(MemberListType::DocSequenceMembers(),md);
590 break;
591 case MemberType::Dictionary:
592 addMemberToList(MemberListType::DecDictionaryMembers(),md);
593 addMemberToList(MemberListType::DocDictionaryMembers(),md);
594 break;
595 case MemberType::Enumeration:
596 addMemberToList(MemberListType::DecEnumMembers(),md);
597 addMemberToList(MemberListType::DocEnumMembers(),md);
598 break;
599 case MemberType::EnumValue:
600 break;
601 case MemberType::Define:
602 addMemberToList(MemberListType::DecDefineMembers(),md);
603 addMemberToList(MemberListType::DocDefineMembers(),md);
604 break;
605 case MemberType::Property:
606 if (md->getLanguage() == SrcLangExt::Python)
607 {
608 addMemberToList(MemberListType::PropertyMembers(),md);
609 addMemberToList(MemberListType::Properties(),md);
610 break;
611 }
612 // fallthrough, explicitly no break here
613 default:
614 err("NamespaceDefImpl::insertMembers(): "
615 "member '{}' with unexpected type '{}' and class scope '{}' inserted in namespace scope '{}'!\n",
616 md->name(), md->memberTypeName(), md->getClassDef() ? md->getClassDef()->name() : "", name());
617 }
618 // if this is an inline namespace, then insert an alias of this member in the outer scope.
619 if (isInline())
620 {
621 Definition *outerScope = getOuterScope();
622 if (outerScope)
623 {
624 std::unique_ptr<MemberDef> aliasMd = createMemberDefAlias(outerScope,md);
625 if (outerScope->definitionType()==Definition::TypeNamespace)
626 {
628 if (ndm)
629 {
630 ndm->insertMember(aliasMd.get());
631 }
632 }
633 else if (outerScope->definitionType()==Definition::TypeFile)
634 {
635 toFileDef(outerScope)->insertMember(aliasMd.get());
636 }
637 if (aliasMd)
638 {
640 mn->push_back(std::move(aliasMd));
641 }
642 }
643 }
644 }
645}
646
648{
649 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
650 if (allMemberList) allMemberList->setAnchors();
651}
652
654{
655 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
656 return ((!briefDescription().empty() && repeatBrief) ||
657 !documentation().empty());
658}
659
661{
664 tagFile << " <compound kind=\"namespace\">\n";
665 tagFile << " <name>" << convertToXML(name()) << "</name>\n";
666 tagFile << " <filename>" << fn << "</filename>\n";
667 DString idStr = id();
668 if (!idStr.empty())
669 {
670 tagFile << " <clangid>" << convertToXML(idStr) << "</clangid>\n";
671 }
672 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
673 {
674 switch (lde->kind())
675 {
676 case LayoutDocEntry::NamespaceNestedNamespaces:
677 {
678 for (const auto &nd : m_namespaces)
679 {
680 if (nd->isLinkableInProject())
681 {
682 tagFile << " <namespace>" << convertToXML(nd->name()) << "</namespace>\n";
683 }
684 }
685 }
686 break;
687 case LayoutDocEntry::NamespaceClasses:
688 {
690 }
691 break;
692 case LayoutDocEntry::NamespaceInterfaces:
693 {
695 }
696 break;
697 case LayoutDocEntry::NamespaceStructs:
698 {
700 }
701 break;
702 case LayoutDocEntry::NamespaceExceptions:
703 {
705 }
706 break;
707 case LayoutDocEntry::NamespaceConcepts:
708 {
709 writeConceptsToTagFile(tagFile);
710 }
711 break;
712 case LayoutDocEntry::MemberDecl:
713 {
714 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
715 if (lmd)
716 {
717 MemberList * ml = getMemberList(lmd->type);
718 if (ml)
719 {
720 ml->writeTagFile(tagFile);
721 }
722 }
723 }
724 break;
725 case LayoutDocEntry::MemberGroups:
726 {
727 for (const auto &mg : m_memberGroups)
728 {
729 mg->writeTagFile(tagFile);
730 }
731 }
732 break;
733 default:
734 break;
735 }
736 }
738 tagFile << " </compound>\n";
739}
740
742{
744 {
747 ol.writeRuler();
751 ol.writeAnchor(DString(),"details");
753 ol.startGroupHeader("details");
754 ol.parseText(title);
755 ol.endGroupHeader();
756
757 ol.startTextBlock();
758 if (!briefDescription().empty() && Config_getBool(REPEAT_BRIEF))
759 {
761 briefLine(),
762 this,
763 nullptr,
765 DocOptions());
766 }
767 if (!briefDescription().empty() && Config_getBool(REPEAT_BRIEF) &&
768 !documentation().empty())
769 {
773 ol.enableAll();
776 ol.writeString("\n\n");
778 }
779 if (!documentation().empty())
780 {
781 ol.generateDoc(docFile(),
782 docLine(),
783 this,
784 nullptr,
785 documentation()+"\n",
786 DocOptions()
787 .setIndexWords(true));
788 }
790 ol.endTextBlock();
791 }
792}
793
795{
797 {
798 auto parser { createDocParser() };
799 auto ast { validatingParseDoc(*parser.get(),
800 briefFile(),
801 briefLine(),
802 this,
803 nullptr,
805 DocOptions()
806 .setIndexWords(true)
807 .setSingleLine(true))
808 };
809 if (!ast->empty())
810 {
811 ol.startParagraph();
814 ol.writeString(" - ");
816 ol.writeDoc(ast.get(),this,nullptr);
819 ol.writeString(" \n");
821
823 {
825 ol.startTextLink(getOutputFileBase(),"details");
827 ol.endTextLink();
828 }
830 ol.endParagraph();
831 }
832 }
833
834 // Write a summary of the Slice definition including metadata.
835 if (getLanguage() == SrcLangExt::Slice)
836 {
837 ol.startParagraph();
838 ol.startTypewriter();
839 if (!metaData.empty())
840 {
841 ol.docify(metaData);
842 ol.lineBreak();
843 }
844 ol.docify("module ");
845 ol.docify(stripScope(name()));
846 ol.docify(" { ... }");
847 ol.endTypewriter();
848 ol.endParagraph();
849 }
850
851 ol.writeSynopsis();
852}
853
858
863
865{
866 if (Config_getBool(SEPARATE_MEMBER_PAGES))
867 {
870 }
871}
872
874{
875 if (Config_getBool(SEPARATE_MEMBER_PAGES))
876 {
879 }
880}
881
886
891
896
902
904{
905 /* write user defined member groups */
906 for (const auto &mg : m_memberGroups)
907 {
908 if (!mg->allMembersInSameSection() || !m_subGrouping)
909 {
910 mg->writeDeclarations(ol,nullptr,this,nullptr,nullptr,nullptr);
911 }
912 }
913}
914
916{
917 // write Author section (Man only)
920 ol.startGroupHeader();
921 ol.parseText(theTranslator->trAuthor(true,true));
922 ol.endGroupHeader();
925}
926
928{
931 bool first=true;
932 SrcLangExt lang = getLanguage();
933 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
934 {
935 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
936 if (lde->kind()==LayoutDocEntry::NamespaceClasses && m_classes.declVisible() && ls)
937 {
938 DString label = "nested-classes";
939 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
940 first=false;
941 }
942 else if (lde->kind()==LayoutDocEntry::NamespaceInterfaces && m_interfaces.declVisible() && ls)
943 {
944 DString label = "interfaces";
945 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
946 first=false;
947 }
948 else if (lde->kind()==LayoutDocEntry::NamespaceStructs && m_structs.declVisible() && ls)
949 {
950 DString label = "structs";
951 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
952 first=false;
953 }
954 else if (lde->kind()==LayoutDocEntry::NamespaceExceptions && m_exceptions.declVisible() && ls)
955 {
956 DString label = "exceptions";
957 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
958 first=false;
959 }
960 else if (lde->kind()==LayoutDocEntry::NamespaceNestedNamespaces && m_namespaces.declVisible(false) && ls)
961 {
962 DString label = "namespaces";
963 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
964 first=false;
965 }
966 else if (lde->kind()==LayoutDocEntry::NamespaceNestedConstantGroups && m_namespaces.declVisible(true) && ls)
967 {
968 DString label = "constantgroups";
969 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
970 first=false;
971 }
972 else if (lde->kind()==LayoutDocEntry::NamespaceConcepts && m_concepts.declVisible() && ls)
973 {
974 DString label = "concepts";
975 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
976 first=false;
977 }
978 else if (lde->kind()== LayoutDocEntry::MemberDecl)
979 {
980 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
981 if (lmd)
982 {
983 MemberList * ml = getMemberList(lmd->type);
984 if (ml && ml->declVisible())
985 {
986 ol.writeSummaryLink(DString(),ml->listType().toLabel(),lmd->title(lang),first);
987 first=false;
988 }
989 }
990 }
991 }
992 if (!first)
993 {
994 ol.writeString(" </div>\n");
995 }
997}
998
1003
1005{
1006 // UNO IDL constant groups may be published
1007 if (getLanguage()==SrcLangExt::IDL && isConstantGroup() && m_isPublished)
1008 {
1009 ol.pushGeneratorState();
1011 ol.startLabels();
1012 ol.writeLabel("published",false);
1013 ol.endLabels();
1014 ol.popGeneratorState();
1015 }
1016 else if (isExported())
1017 {
1018 ol.pushGeneratorState();
1020 ol.startLabels();
1021 ol.writeLabel("export",false);
1022 ol.endLabels();
1023 ol.popGeneratorState();
1024 }
1025}
1026
1028{
1029 for (const auto &cd : list)
1030 {
1031 if (cd->isLinkableInProject())
1032 {
1033 tagFile << " <class kind=\"" << cd->compoundTypeString()
1034 << "\">" << convertToXML(cd->name()) << "</class>\n";
1035 }
1036 }
1037}
1038
1040{
1041 for (const auto &cd : m_concepts)
1042 {
1043 if (cd->isLinkableInProject())
1044 {
1045 tagFile << " <concept>" << convertToXML(cd->name()) << "</concept>\n";
1046 }
1047 }
1048}
1049
1051{
1052 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
1053 //bool outputJava = Config_getBool(OPTIMIZE_OUTPUT_JAVA);
1054 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
1055
1056 DString pageTitle = title();
1057 startFile(ol,getOutputFileBase(),false,name(),pageTitle,HighlightedItem::NamespaceVisible,!generateTreeView);
1058
1059 if (!generateTreeView)
1060 {
1062 {
1064 }
1065 ol.endQuickIndices();
1066 }
1067
1068 startTitle(ol,getOutputFileBase(),this);
1069 ol.parseText(pageTitle);
1070 addGroupListToTitle(ol,this);
1073 ol.startContents();
1074
1075 //---------------------------------------- start flexible part -------------------------------
1076
1077 SrcLangExt lang = getLanguage();
1078 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
1079 {
1080 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
1081 switch (lde->kind())
1082 {
1083 case LayoutDocEntry::BriefDesc:
1085 break;
1086 case LayoutDocEntry::MemberDeclStart:
1088 break;
1089 case LayoutDocEntry::NamespaceClasses:
1090 {
1091 if (ls) writeClassDeclarations(ol,ls->title(lang),m_classes);
1092 }
1093 break;
1094 case LayoutDocEntry::NamespaceInterfaces:
1095 {
1096 if (ls) writeClassDeclarations(ol,ls->title(lang),m_interfaces);
1097 }
1098 break;
1099 case LayoutDocEntry::NamespaceStructs:
1100 {
1101 if (ls) writeClassDeclarations(ol,ls->title(lang),m_structs);
1102 }
1103 break;
1104 case LayoutDocEntry::NamespaceExceptions:
1105 {
1106 if (ls) writeClassDeclarations(ol,ls->title(lang),m_exceptions);
1107 }
1108 break;
1109 case LayoutDocEntry::NamespaceConcepts:
1110 {
1111 if (ls) writeConcepts(ol,ls->title(lang));
1112 }
1113 break;
1114 case LayoutDocEntry::NamespaceNestedNamespaces:
1115 {
1116 if (ls) writeNamespaceDeclarations(ol,ls->title(lang),false);
1117 }
1118 break;
1119 case LayoutDocEntry::NamespaceNestedConstantGroups:
1120 {
1121 if (ls) writeNamespaceDeclarations(ol,ls->title(lang),true);
1122 }
1123 break;
1124 case LayoutDocEntry::MemberGroups:
1126 break;
1127 case LayoutDocEntry::MemberDecl:
1128 {
1129 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
1130 if (lmd) writeMemberDeclarations(ol,lmd->type,lmd->title(lang));
1131 }
1132 break;
1133 case LayoutDocEntry::MemberDeclEnd:
1135 break;
1136 case LayoutDocEntry::DetailedDesc:
1137 {
1138 if (ls) writeDetailedDescription(ol,ls->title(lang));
1139 }
1140 break;
1141 case LayoutDocEntry::MemberDefStart:
1143 break;
1144 case LayoutDocEntry::NamespaceInlineClasses:
1146 break;
1147 case LayoutDocEntry::MemberDef:
1148 {
1149 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
1150 if (lmd) writeMemberDocumentation(ol,lmd->type,lmd->title(lang));
1151 }
1152 break;
1153 case LayoutDocEntry::MemberDefEnd:
1155 break;
1156 case LayoutDocEntry::AuthorSection:
1158 break;
1159 case LayoutDocEntry::Includes:
1161 break;
1162 case LayoutDocEntry::ClassInheritanceGraph:
1163 case LayoutDocEntry::ClassNestedClasses:
1164 case LayoutDocEntry::ClassCollaborationGraph:
1165 case LayoutDocEntry::ClassAllMembersLink:
1166 case LayoutDocEntry::ClassUsedFiles:
1167 case LayoutDocEntry::ClassInlineClasses:
1168 case LayoutDocEntry::ConceptDefinition:
1169 case LayoutDocEntry::FileClasses:
1170 case LayoutDocEntry::FileConcepts:
1171 case LayoutDocEntry::FileInterfaces:
1172 case LayoutDocEntry::FileStructs:
1173 case LayoutDocEntry::FileExceptions:
1174 case LayoutDocEntry::FileNamespaces:
1175 case LayoutDocEntry::FileConstantGroups:
1176 case LayoutDocEntry::FileIncludeGraph:
1177 case LayoutDocEntry::FileIncludedByGraph:
1178 case LayoutDocEntry::FileSourceLink:
1179 case LayoutDocEntry::FileInlineClasses:
1180 case LayoutDocEntry::GroupClasses:
1181 case LayoutDocEntry::GroupConcepts:
1182 case LayoutDocEntry::GroupModules:
1183 case LayoutDocEntry::GroupInlineClasses:
1184 case LayoutDocEntry::GroupNamespaces:
1185 case LayoutDocEntry::GroupDirs:
1186 case LayoutDocEntry::GroupNestedGroups:
1187 case LayoutDocEntry::GroupFiles:
1188 case LayoutDocEntry::GroupGraph:
1189 case LayoutDocEntry::GroupPageDocs:
1190 case LayoutDocEntry::ModuleExports:
1191 case LayoutDocEntry::ModuleClasses:
1192 case LayoutDocEntry::ModuleConcepts:
1193 case LayoutDocEntry::ModuleUsedFiles:
1194 case LayoutDocEntry::DirSubDirs:
1195 case LayoutDocEntry::DirFiles:
1196 case LayoutDocEntry::DirGraph:
1197 err("Internal inconsistency: member '{}' should not be part of "
1198 "LayoutDocManager::Namespace entry list\n",lde->entryToString());
1199 break;
1200 }
1201 }
1202
1203 //---------------------------------------- end flexible part -------------------------------
1204
1205 ol.endContents();
1206
1207 endFileWithNavPath(ol,this);
1208
1209 if (Config_getBool(SEPARATE_MEMBER_PAGES))
1210 {
1211 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
1212 if (allMemberList) allMemberList->sort();
1213 writeMemberPages(ol);
1214 }
1215}
1216
1218{
1219 ol.pushGeneratorState();
1221
1222 for (const auto &ml : m_memberLists)
1223 {
1224 if (ml->listType().isDocumentation())
1225 {
1226 ml->writeDocumentationPage(ol,displayName(),this);
1227 }
1228 }
1229 ol.popGeneratorState();
1230}
1231
1233{
1234 bool createSubDirs=Config_getBool(CREATE_SUBDIRS);
1235
1236 ol.writeString(" <div class=\"navtab\">\n");
1237 ol.writeString(" <table>\n");
1238
1239 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
1240 if (allMemberList)
1241 {
1242 for (const auto &md : *allMemberList)
1243 {
1244 if (md->getNamespaceDef()==this && md->isLinkable() && !md->isEnumValue())
1245 {
1246 if (md->isLinkableInProject())
1247 {
1248 DString fn = md->getOutputFileBase();
1250 if (md==currentMd) // selected item => highlight
1251 {
1252 ol.writeString(" <tr><td class=\"navtabHL\">");
1253 }
1254 else
1255 {
1256 ol.writeString(" <tr><td class=\"navtab\">");
1257 }
1258 ol.writeString("<span class=\"label\"><a ");
1259 ol.writeString("href=\"");
1260 if (createSubDirs) ol.writeString("../../");
1261 ol.writeString(fn+"#"+md->anchor());
1262 ol.writeString("\">");
1263 ol.writeString(convertToHtml(md->localName()));
1264 ol.writeString("</a></span>");
1265 ol.writeString("</td></tr>\n");
1266 }
1267 }
1268 }
1269 }
1270
1271 ol.writeString(" </table>\n");
1272 ol.writeString(" </div>\n");
1273}
1274
1276{
1277 for (auto &ml : m_memberLists)
1278 {
1279 ml->countDecMembers();
1280 ml->countDocMembers();
1281 }
1282 for (const auto &mg : m_memberGroups)
1283 {
1284 mg->countDecMembers();
1285 mg->countDocMembers();
1286 }
1287}
1288
1290{
1291 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
1292 return (allMemberList ? allMemberList->numDocMembers() : 0) + static_cast<int>(m_innerCompounds.size());
1293}
1294
1296{
1298 //printf("%s: NamespaceDefImpl::addUsingDirective: %s:%zu\n",qPrint(name()),qPrint(nd->qualifiedName()),m_usingDirList.size());
1299}
1300
1305
1310
1312{
1313 if (n==nullptr) return nullptr;
1314 const Definition *d = m_innerCompounds.find(n);
1315 if (d==nullptr)
1316 {
1317 if (!m_usingDirList.empty())
1318 {
1319 d = m_usingDirList.find(n);
1320 }
1321 if (d==nullptr && !m_usingDeclList.empty())
1322 {
1323 d = m_usingDeclList.find(n);
1324 }
1325 }
1326 return d;
1327}
1328
1330{
1332 qualifiedName(),
1333 getLanguage()==SrcLangExt::Fortran ?
1334 theTranslator->trModule(true,true) :
1335 theTranslator->trNamespace(true,true),
1337 DString(),
1338 this
1339 );
1340 for (const auto &mg : m_memberGroups)
1341 {
1342 mg->addListReferences(this);
1343 }
1344 for (auto &ml : m_memberLists)
1345 {
1346 if (ml->listType().isDocumentation())
1347 {
1348 ml->addListReferences(this);
1349 }
1350 }
1351}
1352
1354{
1356 for (const auto &mg : m_memberGroups)
1357 {
1358 mg->addRequirementReferences(this);
1359 }
1360 for (auto &ml : m_memberLists)
1361 {
1362 if (ml->listType().isDocumentation())
1363 {
1364 ml->addRequirementReferences(this);
1365 }
1366 }
1367}
1368
1370{
1371 return makeDisplayName(this,includeScope);
1372}
1373
1375{
1376 if (visitedNamespaces.find(this)!=visitedNamespaces.end()) return; // already processed
1377 visitedNamespaces.insert(this);
1378
1380 for (auto &nd : usingDirList)
1381 {
1383 if (ndm)
1384 {
1385 ndm->combineUsingRelations(visitedNamespaces);
1386 }
1387 }
1388
1389 for (auto &nd : usingDirList)
1390 {
1391 // add used namespaces of namespace nd to this namespace
1392 for (const auto &und : nd->getUsedNamespaces())
1393 {
1394 addUsingDirective(und);
1395 }
1396 // add used classes of namespace nd to this namespace
1397 for (const auto &ud : nd->getUsedDefinitions())
1398 {
1400 }
1401 }
1402}
1403
1405{
1406 int count=0;
1407 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
1408 {
1409 if (lde->kind()==LayoutDocEntry::MemberDef)
1410 {
1411 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
1412 if (lmd)
1413 {
1414 MemberList *ml = getMemberList(lmd->type);
1415 if (ml)
1416 {
1417 for (const auto &md : *ml)
1418 {
1419 if (md->visibleInIndex())
1420 {
1421 count++;
1422 }
1423 }
1424 }
1425 }
1426 }
1427 }
1428 return count;
1429}
1430
1431
1432
1433//-------------------------------------------------------------------------------
1434
1435bool NamespaceLinkedRefMap::declVisible(bool isConstantGroup) const
1436{
1437 bool found=false;
1438 for (const auto &nd : *this)
1439 {
1440 if (nd->isLinkable() && nd->hasDocumentation())
1441 {
1442 SrcLangExt lang = nd->getLanguage();
1443 if (SrcLangExt::IDL==lang)
1444 {
1445 if (isConstantGroup == nd->isConstantGroup())
1446 {
1447 found=true;
1448 break;
1449 }
1450 }
1451 else if (!isConstantGroup) // ensure we only get extra section in IDL
1452 {
1453 if (nd->isConstantGroup())
1454 {
1455 err("Internal inconsistency: constant group but not IDL?\n");
1456 }
1457 found=true;
1458 break;
1459 }
1460 }
1461 }
1462 return found;
1463}
1464
1466 bool const isConstantGroup,bool localName)
1467{
1468
1469
1470 if (empty()) return; // no namespaces in the list
1471
1472 if (Config_getBool(OPTIMIZE_OUTPUT_VHDL)) return;
1473
1474 if (!declVisible(isConstantGroup)) return;
1475
1476 // write list of namespaces
1477 ol.startMemberHeader(isConstantGroup ? "constantgroups" : "namespaces");
1478 //bool javaOpt = Config_getBool(OPTIMIZE_OUTPUT_JAVA);
1479 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
1480 ol.parseText(title);
1481 ol.endMemberHeader();
1482 ol.startMemberList();
1483 for (const auto &nd : *this)
1484 {
1485 if (nd->isLinkable() && nd->hasDocumentation())
1486 {
1487 SrcLangExt lang = nd->getLanguage();
1488 if (lang==SrcLangExt::IDL && (isConstantGroup != nd->isConstantGroup()))
1489 continue; // will be output in another pass, see layout_default.xml
1491 DString name = localName ? nd->localName() : nd->displayName();
1492 DString anc = nd->anchor();
1493 if (anc.empty()) anc=name; else anc.prepend(name+"_");
1495 DString ct = nd->compoundTypeString();
1496 ol.docify(ct);
1497 ol.docify(" ");
1498 ol.insertMemberAlign();
1499 ol.writeObjectLink(nd->getReference(),nd->getOutputFileBase(),DString(),name);
1501 if (!nd->briefDescription().empty() && Config_getBool(BRIEF_MEMBER_DESC))
1502 {
1503 ol.startMemberDescription(nd->getOutputFileBase());
1504 ol.generateDoc(nd->briefFile(),
1505 nd->briefLine(),
1506 nd,
1507 nullptr,
1508 nd->briefDescription(),
1509 DocOptions()
1510 .setSingleLine(true));
1512 }
1514 }
1515 }
1516 ol.endMemberList();
1517}
1518
1519//-------------------------------------------------------------------------------
1520
1522{
1523 bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS);
1524 bool sortMemberDocs = Config_getBool(SORT_MEMBER_DOCS);
1526 ml->setNeedsSorting(
1527 (ml->listType().isDeclaration() && sortBriefDocs) ||
1528 (ml->listType().isDocumentation() && sortMemberDocs));
1529 ml->push_back(md);
1530
1531 if (ml->listType().isDeclaration())
1532 {
1534 if (mdm)
1535 {
1536 mdm->setSectionList(this,ml.get());
1537 }
1538 }
1539}
1540
1541template<class Container>
1542bool needsSorting(const Container &container)
1543{
1544 DString prev;
1545 bool allSame = true;
1546 for (const auto &c : container)
1547 {
1548 DString name = c->getDefFileName();
1549 if (!prev.empty() && prev!=name)
1550 {
1551 allSame = false;
1552 break;
1553 }
1554 prev = name;
1555 }
1556 return !allSame || Config_getBool(SORT_BRIEF_DOCS);
1557}
1558
1560{
1561 for (auto &ml : m_memberLists)
1562 {
1563 if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(false); }
1564 }
1565
1566 auto classComp = [](const ClassLinkedRefMap::Ptr &c1,const ClassLinkedRefMap::Ptr &c2)
1567 {
1568 return Config_getBool(SORT_BY_SCOPE_NAME) ?
1569 dstricmp_sort(c1->name(), c2->name())<0 :
1570 dstricmp_sort(c1->className(), c2->className())<0;
1571 };
1572
1573 if (needsSorting(m_classes)) std::stable_sort(m_classes.begin(), m_classes.end(), classComp);
1574 if (needsSorting(m_interfaces)) std::stable_sort(m_interfaces.begin(),m_interfaces.end(),classComp);
1575 if (needsSorting(m_structs)) std::stable_sort(m_structs.begin(), m_structs.end(), classComp);
1576 if (needsSorting(m_exceptions)) std::stable_sort(m_exceptions.begin(),m_exceptions.end(),classComp);
1577
1578 auto conceptComp = [](const ConceptLinkedRefMap::Ptr &c1,const ConceptLinkedRefMap::Ptr &c2)
1579 {
1580 return dstricmp_sort(c1->name(),c2->name())<0;
1581 };
1582
1583 if (needsSorting(m_concepts)) std::stable_sort(m_concepts.begin(), m_concepts.end(), conceptComp);
1584
1585 auto namespaceComp = [](const NamespaceLinkedRefMap::Ptr &n1,const NamespaceLinkedRefMap::Ptr &n2)
1586 {
1587 return dstricmp_sort(n1->name(),n2->name())<0;
1588 };
1589
1590 if (needsSorting(m_namespaces)) std::stable_sort(m_namespaces.begin(),m_namespaces.end(),namespaceComp);
1591
1592}
1593
1595{
1596 for (auto &ml : m_memberLists)
1597 {
1598 if (ml->listType()==lt)
1599 {
1600 return ml.get();
1601 }
1602 }
1603 return nullptr;
1604}
1605
1607{
1608 MemberList * ml = getMemberList(lt);
1609 if (ml) ml->writeDeclarations(ol,nullptr,this,nullptr,nullptr,nullptr,title,DString());
1610}
1611
1617
1618static bool hasNonReferenceNestedNamespaceRec(const NamespaceDef *nd,int level)
1619{
1620 if (level>30)
1621 {
1622 err("Possible recursive namespace relation while inside {}\n",nd->name());
1623 return false;
1624 }
1625 bool found=nd->isLinkableInProject();
1626 if (found)
1627 {
1628 return true;
1629 }
1630 else
1631 {
1632 for (const auto &ind : nd->getNamespaces())
1633 {
1634 found = found || hasNonReferenceNestedNamespaceRec(ind,level+1);
1635 if (found) break;
1636 }
1637 }
1638 return found;
1639}
1640
1642{
1643 bool allExternals = Config_getBool(ALLEXTERNALS);
1644 return allExternals || hasNonReferenceNestedNamespaceRec(this,0) || isLinkable();
1645}
1646
1648{
1649 size_t i = name().rfind("::");
1650 if (i==DString::npos) i=0; else i+=2;
1651 bool extractAnonNs = Config_getBool(EXTRACT_ANON_NSPACES);
1652 bool hideUndoc = Config_getBool(HIDE_UNDOC_NAMESPACES);
1653 if (extractAnonNs && // extract anonymous ns
1654 name().mid(i,20)=="anonymous_namespace{" // correct prefix
1655 ) // not disabled by config
1656 {
1657 return true;
1658 }
1659 return !name().empty() && name().at(i)!='@' && // not anonymous
1660 (hasDocumentation() || !hideUndoc || getLanguage()==SrcLangExt::CSharp) && // documented
1661 !isReference() && // not an external reference
1662 !isHidden() && // not hidden
1663 !isArtificial(); // or artificial
1664}
1665
1667{
1668 return isLinkableInProject() || isReference();
1669}
1670
1672{
1673 return m_allMembers.find(n);
1674}
1675
1677{
1678 DString pageTitle;
1679 SrcLangExt lang = getLanguage();
1680
1681 auto getReferenceTitle = [this](std::function<DString()> translateFunc) -> DString
1682 {
1683 return Config_getBool(HIDE_COMPOUND_REFERENCE) ? displayName() : translateFunc();
1684 };
1685
1686 if (lang==SrcLangExt::Java)
1687 {
1688 pageTitle = theTranslator->trPackage(displayName());
1689 }
1690 else if (lang==SrcLangExt::Fortran || lang==SrcLangExt::Slice)
1691 {
1692 pageTitle = getReferenceTitle([this](){
1694 });
1695 }
1696 else if (lang==SrcLangExt::IDL)
1697 {
1698 pageTitle = getReferenceTitle([this](){
1699 return isConstantGroup()
1702 });
1703 }
1704 else
1705 {
1706 pageTitle = getReferenceTitle([this](){
1708 });
1709 }
1710 return pageTitle;
1711}
1712
1714{
1715 SrcLangExt lang = getLanguage();
1716 if (lang==SrcLangExt::Java)
1717 {
1718 return "package";
1719 }
1720 else if(lang==SrcLangExt::CSharp)
1721 {
1722 return "namespace";
1723 }
1724 else if (lang==SrcLangExt::Fortran)
1725 {
1726 return "module";
1727 }
1728 else if (lang==SrcLangExt::IDL)
1729 {
1730 if (isModule())
1731 {
1732 return "module";
1733 }
1734 else if (isConstantGroup())
1735 {
1736 return "constants";
1737 }
1738 else if (isLibrary())
1739 {
1740 return "library";
1741 }
1742 else
1743 {
1744 err_full(getDefFileName(),getDefLine(),"Internal inconsistency: namespace in IDL not module, library or constant group");
1745 }
1746 }
1747 return "namespace";
1748}
1749
1751{
1752 metaData = m;
1753}
1754
1755// --- Cast functions
1756//
1758{
1759 if (d && (typeid(*d)==typeid(NamespaceDefImpl) || typeid(*d)==typeid(NamespaceDefAliasImpl)))
1760 {
1761 return static_cast<NamespaceDef*>(d);
1762 }
1763 else
1764 {
1765 return nullptr;
1766 }
1767}
1768
1770{
1771 Definition *d = toDefinition(md);
1772 if (d && typeid(*d)==typeid(NamespaceDefImpl))
1773 {
1774 return static_cast<NamespaceDef*>(d);
1775 }
1776 else
1777 {
1778 return nullptr;
1779 }
1780}
1781
1782
1784{
1785 if (d && (typeid(*d)==typeid(NamespaceDefImpl) || typeid(*d)==typeid(NamespaceDefAliasImpl)))
1786 {
1787 return static_cast<const NamespaceDef*>(d);
1788 }
1789 else
1790 {
1791 return nullptr;
1792 }
1793}
1794
1796{
1797 if (d && typeid(*d)==typeid(NamespaceDefImpl))
1798 {
1799 return static_cast<NamespaceDefMutable*>(d);
1800 }
1801 else
1802 {
1803 return nullptr;
1804 }
1805}
1806
1807// --- Helpers
1808
1809static NamespaceDef *getResolvedNamespaceRec(StringSet &namespacesTried,const NamespaceAliasInfo &aliasInfo);
1810
1811static DString replaceNamespaceAliasesRec(StringSet &namespacesTried,const DString &name)
1812{
1813 DString result = name;
1814 //printf("> replaceNamespaceAliasesRec(%s)\n",qPrint(name));
1815 if (namespacesTried.find(name.str())==namespacesTried.end())
1816 {
1817 namespacesTried.insert(name.str());
1818 size_t p = 0;
1819 for (;;)
1820 {
1821 size_t i = name.str().find("::",p);
1822 if (i==std::string::npos)
1823 {
1824 auto it = Doxygen::namespaceAliasMap.find(name.str());
1825 if (it != Doxygen::namespaceAliasMap.end())
1826 {
1827 //printf("found map %s->%s\n",qPrint(name),qPrint(it->second.alias));
1828 auto ns = getResolvedNamespaceRec(namespacesTried,it->second);
1829 if (ns)
1830 {
1831 result = replaceNamespaceAliasesRec(namespacesTried,ns->qualifiedName());
1832 }
1833 }
1834 break;
1835 }
1836 else
1837 {
1838 auto it = Doxygen::namespaceAliasMap.find(name.left(i).str());
1839 if (it != Doxygen::namespaceAliasMap.end())
1840 {
1841 //printf("found map %s|%s->%s\n",qPrint(name.left(i)),qPrint(name.mid(i)),qPrint(it->second.alias));
1842 auto ns = getResolvedNamespaceRec(namespacesTried,it->second);
1843 if (ns)
1844 {
1845 result = replaceNamespaceAliasesRec(namespacesTried,ns->qualifiedName()+name.mid(i));
1846 break;
1847 }
1848 }
1849 }
1850 p = i+2;
1851 }
1852 }
1853 //printf("< replaceNamespaceAliasesRec(%s)=%s\n",qPrint(name),qPrint(result));
1854 return result;
1855}
1856
1857static NamespaceDef *getResolvedNamespaceRec(StringSet &namespacesTried,const NamespaceAliasInfo &aliasInfo)
1858{
1859 size_t j = aliasInfo.context.length();
1860 for (;;)
1861 {
1862 if (j>0)
1863 {
1864 //printf("candidate %s|::%s\n",qPrint(aliasInfo.context.substr(0,j)),qPrint(aliasInfo.alias));
1865 auto candidate = replaceNamespaceAliasesRec(namespacesTried,aliasInfo.context.substr(0,j)+"::"+aliasInfo.alias);
1866 auto nd = Doxygen::namespaceLinkedMap->find(candidate);
1867 if (nd)
1868 {
1869 return nd;
1870 }
1871 }
1872 if (j>0) // strip one level from context, i.e. given N1::N2::N3
1873 // j==10 -> j==6 (N1::N2::N3->N1::N2), and then
1874 // j==6 -> j==2 (N1::N2->N1), and then
1875 // j==2 -> j==std::string::npos (N1->"")
1876 {
1877 j = aliasInfo.context.rfind("::",j-1);
1878 }
1879 else
1880 {
1881 j = std::string::npos;
1882 }
1883 if (j==std::string::npos)
1884 {
1885 //printf("candidate %s\n",qPrint(aliasInfo.alias));
1886 auto candidate = replaceNamespaceAliasesRec(namespacesTried,aliasInfo.alias);
1887 auto nd = Doxygen::namespaceLinkedMap->find(candidate);
1888 if (nd)
1889 {
1890 return nd;
1891 }
1892 break;
1893 }
1894 }
1895 return nullptr;
1896}
1897
1899{
1900 //printf("> replaceNamespaceAliases(%s)\n",qPrint(name));
1901 StringSet namespacesTried;
1902 name = replaceNamespaceAliasesRec(namespacesTried,name);
1903 //printf("< replaceNamespaceAliases: result=%s\n",qPrint(name));
1904}
1905
1907{
1908 //printf("> getResolvedNamespace(%s)\n",qPrint(name));
1909 if (name.empty()) return nullptr;
1910 StringSet namespacesTried;
1911 auto ns = getResolvedNamespaceRec(namespacesTried,NamespaceAliasInfo(name.str()));
1912 //printf("< getResolvedNamespace(%s)=%s\n",qPrint(name),ns?qPrint(ns->qualifiedName()):"nullptr");
1913 return ns;
1914}
1915
1916//--------------------------------------------------------------------------------------
1917//
1919{
1920 for (const auto &cnd : nd->getNamespaces())
1921 {
1922 if (cnd->isLinkableInProject() && !cnd->isAnonymous())
1923 {
1924 return true;
1925 }
1926 }
1927 return false;
1928}
1929
1931{
1932 //printf(">namespaceHasNestedConcept(%s)\n",qPrint(nd->name()));
1933 for (const auto &cnd : nd->getNamespaces())
1934 {
1936 {
1937 //printf("<namespaceHasNestedConcept(%s): case1\n",qPrint(nd->name()));
1938 return true;
1939 }
1940 }
1941 for (const auto &cnd : nd->getConcepts())
1942 {
1943 //printf("candidate %s isLinkableInProject()=%d\n",qPrint(cnd->name()),cnd->isLinkableInProject());
1944 if (cnd->isLinkableInProject())
1945 {
1946 //printf("<namespaceHasNestedConcept(%s): case2\n",qPrint(nd->name()));
1947 return true;
1948 }
1949 }
1950 //printf("<namespaceHasNestedConcept(%s): case3\n",qPrint(nd->name()));
1951 return false;
1952}
1953
1955{
1956 //printf(">namespaceHasNestedClass(%s,filterClasses=%d)\n",qPrint(nd->name()),filterClasses);
1957 for (const auto &cnd : nd->getNamespaces())
1958 {
1959 if (namespaceHasNestedClass(cnd,filterClasses,ct))
1960 {
1961 //printf("<namespaceHasNestedClass(%s,filterClasses=%d): case1\n",qPrint(nd->name()),filterClasses);
1962 return true;
1963 }
1964 }
1965
1966 ClassLinkedRefMap list = nd->getClasses();
1967 if (filterClasses)
1968 {
1969 switch (ct)
1970 {
1972 list = nd->getInterfaces();
1973 break;
1974 case ClassDef::Struct:
1975 list = nd->getStructs();
1976 break;
1978 list = nd->getExceptions();
1979 break;
1980 default:
1981 break;
1982 }
1983 }
1984
1985 for (const auto &cd : list)
1986 {
1987 //printf("candidate %s isLinkableInProject()=%d\n",qPrint(cd->name()),cd->isLinkableInProject());
1988 if (cd->isLinkableInProject())
1989 {
1990 //printf("<namespaceHasNestedClass(%s,filterClasses=%d): case2\n",qPrint(nd->name()),filterClasses);
1991 return true;
1992 }
1993 }
1994 //printf("<namespaceHasNestedClass(%s,filterClasses=%d): case3\n",qPrint(nd->name()),filterClasses);
1995 return false;
1996}
1997
1998
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
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:1449
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 const MemberDef * anonymousMemberForDeclaration() const =0
virtual const MemberDef * anonymousMemberForDetails() 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:2033
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:1800
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:1812
Definition layout.h:101
DString title(SrcLangExt lang) const
Definition layout.cpp:1793
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.