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 getRecords() const override { return m_records; }
118 ClassLinkedRefMap getExceptions() const override { return m_exceptions; }
120 ConceptLinkedRefMap getConcepts() const override { return m_concepts; }
121 void setName(const DString &name) override;
122
123 DString title() const override;
124 DString compoundTypeString() const override;
125
126 void setIncludeFile(FileDef *fd,const DString &incName,bool local,bool force) override;
127 void setMetaData(const DString &m) override;
128 int countVisibleMembers() const override;
129 void writeSummaryLinks(OutputList &ol) const override;
130 void writePageNavigation(OutputList &ol) const override;
131
132 private:
141 void writeConcepts(OutputList &ol,const DString &title);
150 void setFileNameLocal(const DString &fn);
151 void writeIncludeFiles(OutputList &ol) const;
152
154 bool isConstantGroup=false);
155 void updateLocalName();
156
159
163 std::map<std::string, IncludeInfo> m_incInfo;
164
175 bool m_subGrouping = false;
177 bool m_isPublished = false;
179 bool m_inline = false;
180};
181
182std::unique_ptr<NamespaceDef> createNamespaceDef(const DString &defFileName,int defLine,size_t defColumn,
183 const DString &name,const DString &ref,
184 const DString &refFile,const DString &type,
185 bool isPublished)
186{
187 //printf("createNamespaceDef(%s)\n",qPrint(name));
188 return std::make_unique<NamespaceDefImpl>(defFileName,defLine,defColumn,name,ref,refFile,type,isPublished);
189}
190
191//------------------------------------------------------------------
192
193class NamespaceDefAliasImpl final : public DefinitionAliasMixin<NamespaceDef>
194{
195 public:
197 : DefinitionAliasMixin(newScope,nd) { init(); }
200
201 DefType definitionType() const override { return TypeNamespace; }
202
203 const NamespaceDef *getNSAlias() const { return toNamespaceDef(getAlias()); }
204
205 // ---- getters
207 { return getNSAlias()->codeSymbolType(); }
208 DString getOutputFileBase() const override
209 { return getNSAlias()->getOutputFileBase(); }
210 DString anchor() const override
211 { return getNSAlias()->anchor(); }
212 int numDocMembers() const override
213 { return getNSAlias()->numDocMembers(); }
215 { return getNSAlias()->getUsedNamespaces(); }
218 DString displayName(bool b=true) const override
219 { return makeDisplayName(this,b); }
220 const DString &localName() const override
221 { return getNSAlias()->localName(); }
222 bool isConstantGroup() const override
223 { return getNSAlias()->isConstantGroup(); }
224 bool isModule() const override
225 { return getNSAlias()->isModule(); }
226 bool isLibrary() const override
227 { return getNSAlias()->isLibrary(); }
228 bool isInline() const override
229 { return getNSAlias()->isInline(); }
230 bool isLinkableInProject() const override
231 { return getNSAlias()->isLinkableInProject(); }
232 bool isLinkable() const override
233 { return getNSAlias()->isLinkable(); }
234 bool isVisibleInHierarchy() const override
235 { return getNSAlias()->isVisibleInHierarchy(); }
236 bool hasDetailedDescription() const override
237 { return getNSAlias()->hasDetailedDescription(); }
238 const Definition *findInnerCompound(const DString &name) const override
239 { return getNSAlias()->findInnerCompound(name); }
240 bool subGrouping() const override
241 { return getNSAlias()->subGrouping(); }
243 { return getNSAlias()->getMemberList(lt); }
244 const MemberLists &getMemberLists() const override
245 { return getNSAlias()->getMemberLists(); }
246 const MemberDef *getMemberByName(const DString &name) const override
247 { return getNSAlias()->getMemberByName(name); }
248 const MemberGroupList &getMemberGroups() const override
249 { return getNSAlias()->getMemberGroups(); }
251 { return getNSAlias()->getClasses(); }
253 { return getNSAlias()->getInterfaces(); }
255 { return getNSAlias()->getStructs(); }
257 { return getNSAlias()->getRecords(); }
259 { return getNSAlias()->getExceptions(); }
261 { return getNSAlias()->getNamespaces(); }
263 { return getNSAlias()->getConcepts(); }
264 DString title() const override
265 { return getNSAlias()->title(); }
267 { return getNSAlias()->compoundTypeString(); }
268 int countVisibleMembers() const override
269 { return getNSAlias()->countVisibleMembers(); }
270};
271
272std::unique_ptr<NamespaceDef> createNamespaceDefAlias(const Definition *newScope,const NamespaceDef *nd)
273{
274 auto alnd = std::make_unique<NamespaceDefAliasImpl>(newScope,nd);
275 //printf("alnd name=%s localName=%s qualifiedName=%s displayName()=%s\n",
276 // qPrint(alnd->name()),qPrint(alnd->localName()),qPrint(alnd->qualifiedName()),
277 // qPrint(alnd->displayName()));
278 return alnd;
279}
280
281//------------------------------------------------------------------
282
284 const DString &name,const DString &lref,
285 const DString &fName, const DString &type,
286 bool isPublished) :
287 DefinitionMixin(df,dl,dc,name)
288 ,m_isPublished(isPublished)
289{
290 if (!fName.empty())
291 {
292 if (!lref.empty())
293 {
294 fileName = stripExtension(fName);
295 }
296 else
297 {
298 fileName = convertNameToFile(stripExtension(fName));
299 }
300 }
301 else
302 {
303 setFileNameLocal(name);
304 }
305 setReference(lref);
306 m_inline=false;
307 m_subGrouping=Config_getBool(SUBGROUPING);
308 if (type=="module")
309 {
310 m_type = MODULE;
311 }
312 else if (type=="constants")
313 {
314 m_type = CONSTANT_GROUP;
315 }
316 else if (type=="library")
317 {
318 m_type = LIBRARY;
319 }
320 else
321 {
322 m_type = NAMESPACE;
323 }
324
325 updateLocalName();
326}
327
329{
330 DString locName=name();
331 if (size_t i=locName.rfind("::"); i!=DString::npos) locName=locName.mid(i+2);
332 setLocalName(locName);
333}
334
340
344
346{
347 if (isReference())
348 {
349 fileName = "namespace"+fn;
350 }
351 else
352 {
353 fileName = convertNameToFile("namespace"+fn);
354 }
355}
356
358{
360}
361
363{
364 for (const auto &mg : m_memberGroups)
365 {
366 mg->distributeMemberGroupDocumentation();
367 }
368}
369
371{
375 for (const auto &mg : m_memberGroups)
376 {
377 mg->findSectionsInDocumentation(this);
378 }
379 for (auto &ml : m_memberLists)
380 {
381 if (ml->listType().isDeclaration())
382 {
383 ml->findSectionsInDocumentation(this);
384 }
385 }
386}
387
389{
390 if (fd==nullptr) return;
391 auto it = std::find(files.begin(),files.end(),fd);
392 if (it==files.end())
393 {
394 files.push_back(fd);
395 }
396}
397
399{
400 //printf("%s:NamespaceDefImpl::addInnerCompound(%s)\n",qPrint(name()),qPrint(d->name()));
403 {
405 }
407 {
409 }
411 {
413 }
414}
415
417{
419
420 if (Config_getBool(OPTIMIZE_OUTPUT_SLICE))
421 {
423 {
424 d = &m_interfaces;
425 }
426 else if (cd->compoundType()==ClassDef::Struct)
427 {
428 d = &m_structs;
429 }
430 else if (cd->compoundType()==ClassDef::Record)
431 {
432 d = &m_records;
433 }
434 else if (cd->compoundType()==ClassDef::Exception)
435 {
436 d = &m_exceptions;
437 }
438 }
439
440 d->add(cd->name(),cd);
441}
442
447
452
454 const DString &includeName,bool local, bool force)
455{
456 //printf("NamespaceDefImpl::setIncludeFile(%p,%s,%d,%d)\n",fd,qPrint(includeName),local,force);
457 if (!force || includeName.empty()) return; // only use header provided via \headerfile
458 auto it = m_incInfo.find(includeName.str());
459 if (it == m_incInfo.end())
460 {
461 m_incInfo.insert(std::make_pair(includeName.str(), IncludeInfo(fd,includeName,local ? IncludeKind::IncludeLocal : IncludeKind::IncludeSystem)));
462 }
463}
464
466{
467 if (m_incInfo.empty()) return;
468 ol.startParagraph();
469 for (const auto &kv : m_incInfo)
470 {
471 const IncludeInfo &incInfo = kv.second;
472 DString nm=incInfo.includeName.empty() ?
473 (incInfo.fileDef ?
474 incInfo.fileDef->docName() : DString()
475 ) :
476 incInfo.includeName;
477 if (!nm.empty())
478 {
479 ol.startTypewriter();
480 ol.docify(::includeStatement(SrcLangExt::Cpp,incInfo.kind));
481 ol.docify(::includeOpen(SrcLangExt::Cpp,incInfo.kind));
484 ol.docify(nm);
487 if (incInfo.fileDef)
488 {
489 ol.writeObjectLink(DString(),incInfo.fileDef->includeName(),DString(),nm);
490 }
491 else
492 {
493 ol.docify(nm);
494 }
496 ol.docify(::includeClose(SrcLangExt::Cpp,incInfo.kind));
497 ol.endTypewriter();
498 ol.lineBreak();
499 }
500 }
501 ol.endParagraph();
502}
503
504
506{
507 for (auto &ml : m_memberLists)
508 {
509 if (ml->listType().isDeclaration())
510 {
512 }
513 }
514
515 // add members inside sections to their groups
516 for (const auto &mg : m_memberGroups)
517 {
518 if (mg->allMembersInSameSection() && m_subGrouping)
519 {
520 //printf("----> addToDeclarationSection(%s)\n",qPrint(mg->header()));
521 mg->addToDeclarationSection();
522 }
523 }
524}
525
527{
528 //printf("%s::insertMember(%s) isInline=%d hasDocs=%d\n",qPrint(name()),qPrint(md->name()),
529 // isInline(),hasDocumentation());
530 if (md->isHidden()) return;
532
533 // if this is an inline namespace that is not documented, then insert the
534 // member in the parent scope instead
535 if (isInline() && !hasDocumentation())
536 {
537 Definition *outerScope = getOuterScope();
538 if (outerScope)
539 {
540 if (outerScope->definitionType()==Definition::TypeNamespace)
541 {
543 if (nd && nd!=Doxygen::globalScope)
544 {
545 nd->insertMember(md);
546 if (mdm)
547 {
548 mdm->setNamespace(nd);
549 }
550 }
551 }
552 else if (outerScope->definitionType()==Definition::TypeFile)
553 {
554 FileDef *fd = toFileDef(outerScope);
555 fd->insertMember(md);
556 if (mdm)
557 {
558 mdm->setFileDef(fd);
559 mdm->setOuterScope(fd);
560 }
561 }
562 }
563 }
564 else // member is a non-inline namespace or a documented inline namespace
565 {
566 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
567 if (allMemberList==nullptr)
568 {
569 m_memberLists.emplace_back(std::make_unique<MemberList>(MemberListType::AllMembersList(),MemberListContainer::Namespace));
570 allMemberList = m_memberLists.back().get();
571 }
572 allMemberList->push_back(md);
573 //printf("%s::m_allMembersDict->append(%s)\n",qPrint(name()),qPrint(md->localName()));
574 m_allMembers.add(md->localName(),md);
575 switch(md->memberType())
576 {
577 case MemberType::Variable:
578 if (md->anonymousMemberForDeclaration()==nullptr) // not a split member that has a separate declaration member
579 {
580 addMemberToList(MemberListType::DecVarMembers(),md);
581 }
582 if (!md->isAnonymous() && md->anonymousMemberForDetails()==nullptr) // not a split member that has a separate details member
583 {
584 addMemberToList(MemberListType::DocVarMembers(),md);
585 }
586 break;
587 case MemberType::Function:
588 addMemberToList(MemberListType::DecFuncMembers(),md);
589 addMemberToList(MemberListType::DocFuncMembers(),md);
590 break;
591 case MemberType::Typedef:
592 addMemberToList(MemberListType::DecTypedefMembers(),md);
593 addMemberToList(MemberListType::DocTypedefMembers(),md);
594 break;
595 case MemberType::Sequence:
596 addMemberToList(MemberListType::DecSequenceMembers(),md);
597 addMemberToList(MemberListType::DocSequenceMembers(),md);
598 break;
599 case MemberType::Dictionary:
600 addMemberToList(MemberListType::DecDictionaryMembers(),md);
601 addMemberToList(MemberListType::DocDictionaryMembers(),md);
602 break;
603 case MemberType::Enumeration:
604 addMemberToList(MemberListType::DecEnumMembers(),md);
605 addMemberToList(MemberListType::DocEnumMembers(),md);
606 break;
607 case MemberType::EnumValue:
608 break;
609 case MemberType::Define:
610 addMemberToList(MemberListType::DecDefineMembers(),md);
611 addMemberToList(MemberListType::DocDefineMembers(),md);
612 break;
613 case MemberType::Property:
614 if (md->getLanguage() == SrcLangExt::Python)
615 {
616 addMemberToList(MemberListType::PropertyMembers(),md);
617 addMemberToList(MemberListType::Properties(),md);
618 break;
619 }
620 // fallthrough, explicitly no break here
621 default:
622 err("NamespaceDefImpl::insertMembers(): "
623 "member '{}' with unexpected type '{}' and class scope '{}' inserted in namespace scope '{}'!\n",
624 md->name(), md->memberTypeName(), md->getClassDef() ? md->getClassDef()->name() : "", name());
625 }
626 // if this is an inline namespace, then insert an alias of this member in the outer scope.
627 if (isInline())
628 {
629 Definition *outerScope = getOuterScope();
630 if (outerScope)
631 {
632 std::unique_ptr<MemberDef> aliasMd = createMemberDefAlias(outerScope,md);
633 if (outerScope->definitionType()==Definition::TypeNamespace)
634 {
636 if (ndm)
637 {
638 ndm->insertMember(aliasMd.get());
639 }
640 }
641 else if (outerScope->definitionType()==Definition::TypeFile)
642 {
643 toFileDef(outerScope)->insertMember(aliasMd.get());
644 }
645 if (aliasMd)
646 {
648 mn->push_back(std::move(aliasMd));
649 }
650 }
651 }
652 }
653}
654
656{
657 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
658 if (allMemberList) allMemberList->setAnchors();
659}
660
662{
663 bool repeatBrief = Config_getBool(REPEAT_BRIEF);
664 return ((!briefDescription().empty() && repeatBrief) ||
665 !documentation().empty());
666}
667
669{
672 tagFile << " <compound kind=\"namespace\">\n";
673 tagFile << " <name>" << convertToXML(name()) << "</name>\n";
674 tagFile << " <filename>" << fn << "</filename>\n";
675 DString idStr = id();
676 if (!idStr.empty())
677 {
678 tagFile << " <clangid>" << convertToXML(idStr) << "</clangid>\n";
679 }
680 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
681 {
682 switch (lde->kind())
683 {
684 case LayoutDocEntry::NamespaceNestedNamespaces:
685 {
686 for (const auto &nd : m_namespaces)
687 {
688 if (nd->isLinkableInProject())
689 {
690 tagFile << " <namespace>" << convertToXML(nd->name()) << "</namespace>\n";
691 }
692 }
693 }
694 break;
695 case LayoutDocEntry::NamespaceClasses:
696 {
698 }
699 break;
700 case LayoutDocEntry::NamespaceInterfaces:
701 {
703 }
704 break;
705 case LayoutDocEntry::NamespaceStructs:
706 {
708 }
709 break;
710 case LayoutDocEntry::NamespaceRecords:
711 {
713 }
714 break;
715 case LayoutDocEntry::NamespaceExceptions:
716 {
718 }
719 break;
720 case LayoutDocEntry::NamespaceConcepts:
721 {
722 writeConceptsToTagFile(tagFile);
723 }
724 break;
725 case LayoutDocEntry::MemberDecl:
726 {
727 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
728 if (lmd)
729 {
730 MemberList * ml = getMemberList(lmd->type);
731 if (ml)
732 {
733 ml->writeTagFile(tagFile);
734 }
735 }
736 }
737 break;
738 case LayoutDocEntry::MemberGroups:
739 {
740 for (const auto &mg : m_memberGroups)
741 {
742 mg->writeTagFile(tagFile);
743 }
744 }
745 break;
746 default:
747 break;
748 }
749 }
751 tagFile << " </compound>\n";
752}
753
755{
757 {
760 ol.writeRuler();
764 ol.writeAnchor(DString(),"details");
766 ol.startGroupHeader("details");
767 ol.parseText(title);
768 ol.endGroupHeader();
769
770 ol.startTextBlock();
771 if (!briefDescription().empty() && Config_getBool(REPEAT_BRIEF))
772 {
774 briefLine(),
775 this,
776 nullptr,
778 DocOptions());
779 }
780 if (!briefDescription().empty() && Config_getBool(REPEAT_BRIEF) &&
781 !documentation().empty())
782 {
786 ol.enableAll();
789 ol.writeString("\n\n");
791 }
792 if (!documentation().empty())
793 {
794 ol.generateDoc(docFile(),
795 docLine(),
796 this,
797 nullptr,
798 documentation()+"\n",
799 DocOptions()
800 .setIndexWords(true));
801 }
803 ol.endTextBlock();
804 }
805}
806
808{
810 {
811 auto parser { createDocParser() };
812 auto ast { validatingParseDoc(*parser.get(),
813 briefFile(),
814 briefLine(),
815 this,
816 nullptr,
818 DocOptions()
819 .setIndexWords(true)
820 .setSingleLine(true))
821 };
822 if (!ast->empty())
823 {
824 ol.startParagraph();
827 ol.writeString(" - ");
829 ol.writeDoc(ast.get(),this,nullptr);
832 ol.writeString(" \n");
834
836 {
838 ol.startTextLink(getOutputFileBase(),"details");
840 ol.endTextLink();
841 }
843 ol.endParagraph();
844 }
845 }
846
847 // Write a summary of the Slice definition including metadata.
848 if (getLanguage() == SrcLangExt::Slice)
849 {
850 ol.startParagraph();
851 ol.startTypewriter();
852 if (!metaData.empty())
853 {
854 ol.docify(metaData);
855 ol.lineBreak();
856 }
857 ol.docify("module ");
858 ol.docify(stripScope(name()));
859 ol.docify(" { ... }");
860 ol.endTypewriter();
861 ol.endParagraph();
862 }
863
864 ol.writeSynopsis();
865}
866
871
876
878{
879 if (Config_getBool(SEPARATE_MEMBER_PAGES))
880 {
883 }
884}
885
887{
888 if (Config_getBool(SEPARATE_MEMBER_PAGES))
889 {
892 }
893}
894
899
904
909
915
917{
918 /* write user defined member groups */
919 for (const auto &mg : m_memberGroups)
920 {
921 if (!mg->allMembersInSameSection() || !m_subGrouping)
922 {
923 mg->writeDeclarations(ol,nullptr,this,nullptr,nullptr,nullptr);
924 }
925 }
926}
927
929{
930 // write Author section (Man only)
933 ol.startGroupHeader();
934 ol.parseText(theTranslator->trAuthor(true,true));
935 ol.endGroupHeader();
938}
939
941{
944 bool first=true;
945 SrcLangExt lang = getLanguage();
946 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
947 {
948 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
949 if (lde->kind()==LayoutDocEntry::NamespaceClasses && m_classes.declVisible() && ls)
950 {
951 DString label = "nested-classes";
952 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
953 first=false;
954 }
955 else if (lde->kind()==LayoutDocEntry::NamespaceInterfaces && m_interfaces.declVisible() && ls)
956 {
957 DString label = "interfaces";
958 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
959 first=false;
960 }
961 else if (lde->kind()==LayoutDocEntry::NamespaceStructs && m_structs.declVisible() && ls)
962 {
963 DString label = "structs";
964 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
965 first=false;
966 }
967 else if (lde->kind()==LayoutDocEntry::NamespaceRecords && m_records.declVisible() && ls)
968 {
969 DString label = "records";
970 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
971 first=false;
972 }
973 else if (lde->kind()==LayoutDocEntry::NamespaceExceptions && m_exceptions.declVisible() && ls)
974 {
975 DString label = "exceptions";
976 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
977 first=false;
978 }
979 else if (lde->kind()==LayoutDocEntry::NamespaceNestedNamespaces && m_namespaces.declVisible(false) && ls)
980 {
981 DString label = "namespaces";
982 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
983 first=false;
984 }
985 else if (lde->kind()==LayoutDocEntry::NamespaceNestedConstantGroups && m_namespaces.declVisible(true) && ls)
986 {
987 DString label = "constantgroups";
988 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
989 first=false;
990 }
991 else if (lde->kind()==LayoutDocEntry::NamespaceConcepts && m_concepts.declVisible() && ls)
992 {
993 DString label = "concepts";
994 ol.writeSummaryLink(DString(),label,ls->title(lang),first);
995 first=false;
996 }
997 else if (lde->kind()== LayoutDocEntry::MemberDecl)
998 {
999 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
1000 if (lmd)
1001 {
1002 MemberList * ml = getMemberList(lmd->type);
1003 if (ml && ml->declVisible())
1004 {
1005 ol.writeSummaryLink(DString(),ml->listType().toLabel(),lmd->title(lang),first);
1006 first=false;
1007 }
1008 }
1009 }
1010 }
1011 if (!first)
1012 {
1013 ol.writeString(" </div>\n");
1014 }
1015 ol.popGeneratorState();
1016}
1017
1022
1024{
1025 // UNO IDL constant groups may be published
1026 if (getLanguage()==SrcLangExt::IDL && isConstantGroup() && m_isPublished)
1027 {
1028 ol.pushGeneratorState();
1030 ol.startLabels();
1031 ol.writeLabel("published",false);
1032 ol.endLabels();
1033 ol.popGeneratorState();
1034 }
1035 else if (isExported())
1036 {
1037 ol.pushGeneratorState();
1039 ol.startLabels();
1040 ol.writeLabel("export",false);
1041 ol.endLabels();
1042 ol.popGeneratorState();
1043 }
1044}
1045
1047{
1048 for (const auto &cd : list)
1049 {
1050 if (cd->isLinkableInProject())
1051 {
1052 tagFile << " <class kind=\"" << cd->compoundTypeString()
1053 << "\">" << convertToXML(cd->name()) << "</class>\n";
1054 }
1055 }
1056}
1057
1059{
1060 for (const auto &cd : m_concepts)
1061 {
1062 if (cd->isLinkableInProject())
1063 {
1064 tagFile << " <concept>" << convertToXML(cd->name()) << "</concept>\n";
1065 }
1066 }
1067}
1068
1070{
1071 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
1072 //bool outputJava = Config_getBool(OPTIMIZE_OUTPUT_JAVA);
1073 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
1074
1075 DString pageTitle = title();
1076 startFile(ol,getOutputFileBase(),false,name(),pageTitle,HighlightedItem::NamespaceVisible,!generateTreeView);
1077
1078 if (!generateTreeView)
1079 {
1081 {
1083 }
1084 ol.endQuickIndices();
1085 }
1086
1087 startTitle(ol,getOutputFileBase(),this);
1088 ol.parseText(pageTitle);
1089 addGroupListToTitle(ol,this);
1092 ol.startContents();
1093
1094 //---------------------------------------- start flexible part -------------------------------
1095
1096 SrcLangExt lang = getLanguage();
1097 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
1098 {
1099 const LayoutDocEntrySection *ls = dynamic_cast<const LayoutDocEntrySection*>(lde.get());
1100 switch (lde->kind())
1101 {
1102 case LayoutDocEntry::BriefDesc:
1104 break;
1105 case LayoutDocEntry::MemberDeclStart:
1107 break;
1108 case LayoutDocEntry::NamespaceClasses:
1109 {
1110 if (ls) writeClassDeclarations(ol,ls->title(lang),m_classes);
1111 }
1112 break;
1113 case LayoutDocEntry::NamespaceInterfaces:
1114 {
1115 if (ls) writeClassDeclarations(ol,ls->title(lang),m_interfaces);
1116 }
1117 break;
1118 case LayoutDocEntry::NamespaceStructs:
1119 {
1120 if (ls) writeClassDeclarations(ol,ls->title(lang),m_structs);
1121 }
1122 break;
1123 case LayoutDocEntry::NamespaceRecords:
1124 {
1125 if (ls) writeClassDeclarations(ol,ls->title(lang),m_records);
1126 }
1127 break;
1128 case LayoutDocEntry::NamespaceExceptions:
1129 {
1130 if (ls) writeClassDeclarations(ol,ls->title(lang),m_exceptions);
1131 }
1132 break;
1133 case LayoutDocEntry::NamespaceConcepts:
1134 {
1135 if (ls) writeConcepts(ol,ls->title(lang));
1136 }
1137 break;
1138 case LayoutDocEntry::NamespaceNestedNamespaces:
1139 {
1140 if (ls) writeNamespaceDeclarations(ol,ls->title(lang),false);
1141 }
1142 break;
1143 case LayoutDocEntry::NamespaceNestedConstantGroups:
1144 {
1145 if (ls) writeNamespaceDeclarations(ol,ls->title(lang),true);
1146 }
1147 break;
1148 case LayoutDocEntry::MemberGroups:
1150 break;
1151 case LayoutDocEntry::MemberDecl:
1152 {
1153 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
1154 if (lmd) writeMemberDeclarations(ol,lmd->type,lmd->title(lang));
1155 }
1156 break;
1157 case LayoutDocEntry::MemberDeclEnd:
1159 break;
1160 case LayoutDocEntry::DetailedDesc:
1161 {
1162 if (ls) writeDetailedDescription(ol,ls->title(lang));
1163 }
1164 break;
1165 case LayoutDocEntry::MemberDefStart:
1167 break;
1168 case LayoutDocEntry::NamespaceInlineClasses:
1170 break;
1171 case LayoutDocEntry::MemberDef:
1172 {
1173 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
1174 if (lmd) writeMemberDocumentation(ol,lmd->type,lmd->title(lang));
1175 }
1176 break;
1177 case LayoutDocEntry::MemberDefEnd:
1179 break;
1180 case LayoutDocEntry::AuthorSection:
1182 break;
1183 case LayoutDocEntry::Includes:
1185 break;
1186 case LayoutDocEntry::ClassInheritanceGraph:
1187 case LayoutDocEntry::ClassNestedClasses:
1188 case LayoutDocEntry::ClassCollaborationGraph:
1189 case LayoutDocEntry::ClassAllMembersLink:
1190 case LayoutDocEntry::ClassUsedFiles:
1191 case LayoutDocEntry::ClassInlineClasses:
1192 case LayoutDocEntry::ConceptDefinition:
1193 case LayoutDocEntry::FileClasses:
1194 case LayoutDocEntry::FileConcepts:
1195 case LayoutDocEntry::FileInterfaces:
1196 case LayoutDocEntry::FileStructs:
1197 case LayoutDocEntry::FileRecords:
1198 case LayoutDocEntry::FileExceptions:
1199 case LayoutDocEntry::FileNamespaces:
1200 case LayoutDocEntry::FileConstantGroups:
1201 case LayoutDocEntry::FileIncludeGraph:
1202 case LayoutDocEntry::FileIncludedByGraph:
1203 case LayoutDocEntry::FileSourceLink:
1204 case LayoutDocEntry::FileInlineClasses:
1205 case LayoutDocEntry::GroupClasses:
1206 case LayoutDocEntry::GroupConcepts:
1207 case LayoutDocEntry::GroupModules:
1208 case LayoutDocEntry::GroupInlineClasses:
1209 case LayoutDocEntry::GroupNamespaces:
1210 case LayoutDocEntry::GroupDirs:
1211 case LayoutDocEntry::GroupNestedGroups:
1212 case LayoutDocEntry::GroupFiles:
1213 case LayoutDocEntry::GroupGraph:
1214 case LayoutDocEntry::GroupPageDocs:
1215 case LayoutDocEntry::ModuleExports:
1216 case LayoutDocEntry::ModuleClasses:
1217 case LayoutDocEntry::ModuleConcepts:
1218 case LayoutDocEntry::ModuleUsedFiles:
1219 case LayoutDocEntry::DirSubDirs:
1220 case LayoutDocEntry::DirFiles:
1221 case LayoutDocEntry::DirGraph:
1222 err("Internal inconsistency: member '{}' should not be part of "
1223 "LayoutDocManager::Namespace entry list\n",lde->entryToString());
1224 break;
1225 }
1226 }
1227
1228 //---------------------------------------- end flexible part -------------------------------
1229
1230 ol.endContents();
1231
1232 endFileWithNavPath(ol,this);
1233
1234 if (Config_getBool(SEPARATE_MEMBER_PAGES))
1235 {
1236 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
1237 if (allMemberList) allMemberList->sort();
1238 writeMemberPages(ol);
1239 }
1240}
1241
1243{
1244 ol.pushGeneratorState();
1246
1247 for (const auto &ml : m_memberLists)
1248 {
1249 if (ml->listType().isDocumentation())
1250 {
1251 ml->writeDocumentationPage(ol,displayName(),this);
1252 }
1253 }
1254 ol.popGeneratorState();
1255}
1256
1258{
1259 bool createSubDirs=Config_getBool(CREATE_SUBDIRS);
1260
1261 ol.writeString(" <div class=\"navtab\">\n");
1262 ol.writeString(" <table>\n");
1263
1264 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
1265 if (allMemberList)
1266 {
1267 for (const auto &md : *allMemberList)
1268 {
1269 if (md->getNamespaceDef()==this && md->isLinkable() && !md->isEnumValue())
1270 {
1271 if (md->isLinkableInProject())
1272 {
1273 DString fn = md->getOutputFileBase();
1275 if (md==currentMd) // selected item => highlight
1276 {
1277 ol.writeString(" <tr><td class=\"navtabHL\">");
1278 }
1279 else
1280 {
1281 ol.writeString(" <tr><td class=\"navtab\">");
1282 }
1283 ol.writeString("<span class=\"label\"><a ");
1284 ol.writeString("href=\"");
1285 if (createSubDirs) ol.writeString("../../");
1286 ol.writeString(fn+"#"+md->anchor());
1287 ol.writeString("\">");
1288 ol.writeString(convertToHtml(md->localName()));
1289 ol.writeString("</a></span>");
1290 ol.writeString("</td></tr>\n");
1291 }
1292 }
1293 }
1294 }
1295
1296 ol.writeString(" </table>\n");
1297 ol.writeString(" </div>\n");
1298}
1299
1301{
1302 for (auto &ml : m_memberLists)
1303 {
1304 ml->countDecMembers();
1305 ml->countDocMembers();
1306 }
1307 for (const auto &mg : m_memberGroups)
1308 {
1309 mg->countDecMembers();
1310 mg->countDocMembers();
1311 }
1312}
1313
1315{
1316 MemberList *allMemberList = getMemberList(MemberListType::AllMembersList());
1317 return (allMemberList ? allMemberList->numDocMembers() : 0) + static_cast<int>(m_innerCompounds.size());
1318}
1319
1321{
1323 //printf("%s: NamespaceDefImpl::addUsingDirective: %s:%zu\n",qPrint(name()),qPrint(nd->qualifiedName()),m_usingDirList.size());
1324}
1325
1330
1335
1337{
1338 if (n==nullptr) return nullptr;
1339 const Definition *d = m_innerCompounds.find(n);
1340 if (d==nullptr)
1341 {
1342 if (!m_usingDirList.empty())
1343 {
1344 d = m_usingDirList.find(n);
1345 }
1346 if (d==nullptr && !m_usingDeclList.empty())
1347 {
1348 d = m_usingDeclList.find(n);
1349 }
1350 }
1351 return d;
1352}
1353
1355{
1357 qualifiedName(),
1358 getLanguage()==SrcLangExt::Fortran ?
1359 theTranslator->trModule(true,true) :
1360 theTranslator->trNamespace(true,true),
1362 DString(),
1363 this
1364 );
1365 for (const auto &mg : m_memberGroups)
1366 {
1367 mg->addListReferences(this);
1368 }
1369 for (auto &ml : m_memberLists)
1370 {
1371 if (ml->listType().isDocumentation())
1372 {
1373 ml->addListReferences(this);
1374 }
1375 }
1376}
1377
1379{
1381 for (const auto &mg : m_memberGroups)
1382 {
1383 mg->addRequirementReferences(this);
1384 }
1385 for (auto &ml : m_memberLists)
1386 {
1387 if (ml->listType().isDocumentation())
1388 {
1389 ml->addRequirementReferences(this);
1390 }
1391 }
1392}
1393
1395{
1396 return makeDisplayName(this,includeScope);
1397}
1398
1400{
1401 if (visitedNamespaces.find(this)!=visitedNamespaces.end()) return; // already processed
1402 visitedNamespaces.insert(this);
1403
1405 for (auto &nd : usingDirList)
1406 {
1408 if (ndm)
1409 {
1410 ndm->combineUsingRelations(visitedNamespaces);
1411 }
1412 }
1413
1414 for (auto &nd : usingDirList)
1415 {
1416 // add used namespaces of namespace nd to this namespace
1417 for (const auto &und : nd->getUsedNamespaces())
1418 {
1419 addUsingDirective(und);
1420 }
1421 // add used classes of namespace nd to this namespace
1422 for (const auto &ud : nd->getUsedDefinitions())
1423 {
1425 }
1426 }
1427}
1428
1430{
1431 int count=0;
1432 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
1433 {
1434 if (lde->kind()==LayoutDocEntry::MemberDef)
1435 {
1436 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
1437 if (lmd)
1438 {
1439 MemberList *ml = getMemberList(lmd->type);
1440 if (ml)
1441 {
1442 for (const auto &md : *ml)
1443 {
1444 if (md->visibleInIndex())
1445 {
1446 count++;
1447 }
1448 }
1449 }
1450 }
1451 }
1452 }
1453 return count;
1454}
1455
1456
1457
1458//-------------------------------------------------------------------------------
1459
1460bool NamespaceLinkedRefMap::declVisible(bool isConstantGroup) const
1461{
1462 bool found=false;
1463 for (const auto &nd : *this)
1464 {
1465 if (nd->isLinkable() && nd->hasDocumentation())
1466 {
1467 SrcLangExt lang = nd->getLanguage();
1468 if (SrcLangExt::IDL==lang)
1469 {
1470 if (isConstantGroup == nd->isConstantGroup())
1471 {
1472 found=true;
1473 break;
1474 }
1475 }
1476 else if (!isConstantGroup) // ensure we only get extra section in IDL
1477 {
1478 if (nd->isConstantGroup())
1479 {
1480 err("Internal inconsistency: constant group but not IDL?\n");
1481 }
1482 found=true;
1483 break;
1484 }
1485 }
1486 }
1487 return found;
1488}
1489
1491 bool const isConstantGroup,bool localName)
1492{
1493
1494
1495 if (empty()) return; // no namespaces in the list
1496
1497 if (Config_getBool(OPTIMIZE_OUTPUT_VHDL)) return;
1498
1499 if (!declVisible(isConstantGroup)) return;
1500
1501 // write list of namespaces
1502 ol.startMemberHeader(isConstantGroup ? "constantgroups" : "namespaces");
1503 //bool javaOpt = Config_getBool(OPTIMIZE_OUTPUT_JAVA);
1504 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
1505 ol.parseText(title);
1506 ol.endMemberHeader();
1507 ol.startMemberList();
1508 for (const auto &nd : *this)
1509 {
1510 if (nd->isLinkable() && nd->hasDocumentation())
1511 {
1512 SrcLangExt lang = nd->getLanguage();
1513 if (lang==SrcLangExt::IDL && (isConstantGroup != nd->isConstantGroup()))
1514 continue; // will be output in another pass, see layout_default.xml
1516 DString name = localName ? nd->localName() : nd->displayName();
1517 DString anc = nd->anchor();
1518 if (anc.empty()) anc=name; else anc.prepend(name+"_");
1520 if (nd->isInline())
1521 {
1522 ol.docify("inline ");
1523 }
1524 DString ct = nd->compoundTypeString();
1525 ol.docify(ct);
1526 ol.docify(" ");
1527 ol.insertMemberAlign();
1528 ol.writeObjectLink(nd->getReference(),nd->getOutputFileBase(),DString(),name);
1530 if (!nd->briefDescription().empty() && Config_getBool(BRIEF_MEMBER_DESC))
1531 {
1532 ol.startMemberDescription(nd->getOutputFileBase());
1533 ol.generateDoc(nd->briefFile(),
1534 nd->briefLine(),
1535 nd,
1536 nullptr,
1537 nd->briefDescription(),
1538 DocOptions()
1539 .setSingleLine(true));
1541 }
1543 }
1544 }
1545 ol.endMemberList();
1546}
1547
1548//-------------------------------------------------------------------------------
1549
1551{
1552 bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS);
1553 bool sortMemberDocs = Config_getBool(SORT_MEMBER_DOCS);
1555 ml->setNeedsSorting(
1556 (ml->listType().isDeclaration() && sortBriefDocs) ||
1557 (ml->listType().isDocumentation() && sortMemberDocs));
1558 ml->push_back(md);
1559
1560 if (ml->listType().isDeclaration())
1561 {
1563 if (mdm)
1564 {
1565 mdm->setSectionList(this,ml.get());
1566 }
1567 }
1568}
1569
1570template<class Container>
1571bool needsSorting(const Container &container)
1572{
1573 DString prev;
1574 bool allSame = true;
1575 for (const auto &c : container)
1576 {
1577 DString name = c->getDefFileName();
1578 if (!prev.empty() && prev!=name)
1579 {
1580 allSame = false;
1581 break;
1582 }
1583 prev = name;
1584 }
1585 return !allSame || Config_getBool(SORT_BRIEF_DOCS);
1586}
1587
1589{
1590 for (auto &ml : m_memberLists)
1591 {
1592 if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(false); }
1593 }
1594
1595 auto classComp = [](const ClassLinkedRefMap::Ptr &c1,const ClassLinkedRefMap::Ptr &c2)
1596 {
1597 return Config_getBool(SORT_BY_SCOPE_NAME) ?
1598 dstricmp_sort(c1->name(), c2->name())<0 :
1599 dstricmp_sort(c1->className(), c2->className())<0;
1600 };
1601
1602 if (needsSorting(m_classes)) std::stable_sort(m_classes.begin(), m_classes.end(), classComp);
1603 if (needsSorting(m_interfaces)) std::stable_sort(m_interfaces.begin(),m_interfaces.end(),classComp);
1604 if (needsSorting(m_structs)) std::stable_sort(m_structs.begin(), m_structs.end(), classComp);
1605 if (needsSorting(m_records)) std::stable_sort(m_records.begin(), m_records.end(), classComp);
1606 if (needsSorting(m_exceptions)) std::stable_sort(m_exceptions.begin(),m_exceptions.end(),classComp);
1607
1608 auto conceptComp = [](const ConceptLinkedRefMap::Ptr &c1,const ConceptLinkedRefMap::Ptr &c2)
1609 {
1610 return dstricmp_sort(c1->name(),c2->name())<0;
1611 };
1612
1613 if (needsSorting(m_concepts)) std::stable_sort(m_concepts.begin(), m_concepts.end(), conceptComp);
1614
1615 auto namespaceComp = [](const NamespaceLinkedRefMap::Ptr &n1,const NamespaceLinkedRefMap::Ptr &n2)
1616 {
1617 return dstricmp_sort(n1->name(),n2->name())<0;
1618 };
1619
1620 if (needsSorting(m_namespaces)) std::stable_sort(m_namespaces.begin(),m_namespaces.end(),namespaceComp);
1621
1622}
1623
1625{
1626 for (auto &ml : m_memberLists)
1627 {
1628 if (ml->listType()==lt)
1629 {
1630 return ml.get();
1631 }
1632 }
1633 return nullptr;
1634}
1635
1637{
1638 MemberList * ml = getMemberList(lt);
1639 if (ml) ml->writeDeclarations(ol,nullptr,this,nullptr,nullptr,nullptr,title,DString());
1640}
1641
1647
1648static bool hasNonReferenceNestedNamespaceRec(const NamespaceDef *nd,int level)
1649{
1650 if (level>30)
1651 {
1652 err("Possible recursive namespace relation while inside {}\n",nd->name());
1653 return false;
1654 }
1655 bool found=nd->isLinkableInProject();
1656 if (found)
1657 {
1658 return true;
1659 }
1660 else
1661 {
1662 for (const auto &ind : nd->getNamespaces())
1663 {
1664 found = found || hasNonReferenceNestedNamespaceRec(ind,level+1);
1665 if (found) break;
1666 }
1667 }
1668 return found;
1669}
1670
1672{
1673 bool allExternals = Config_getBool(ALLEXTERNALS);
1674 return allExternals || hasNonReferenceNestedNamespaceRec(this,0) || isLinkable();
1675}
1676
1678{
1679 size_t i = name().rfind("::");
1680 if (i==DString::npos) i=0; else i+=2;
1681 bool extractAnonNs = Config_getBool(EXTRACT_ANON_NSPACES);
1682 bool hideUndoc = Config_getBool(HIDE_UNDOC_NAMESPACES);
1683 if (extractAnonNs && // extract anonymous ns
1684 name().mid(i,20)=="anonymous_namespace{" // correct prefix
1685 ) // not disabled by config
1686 {
1687 return true;
1688 }
1689 return !name().empty() && name().at(i)!='@' && // not anonymous
1690 (hasDocumentation() || !hideUndoc || getLanguage()==SrcLangExt::CSharp) && // documented
1691 !isReference() && // not an external reference
1692 !isHidden() && // not hidden
1693 !isArtificial(); // or artificial
1694}
1695
1697{
1698 return isLinkableInProject() || isReference();
1699}
1700
1702{
1703 return m_allMembers.find(n);
1704}
1705
1707{
1708 DString pageTitle;
1709 SrcLangExt lang = getLanguage();
1710
1711 auto getReferenceTitle = [this](std::function<DString()> translateFunc) -> DString
1712 {
1713 return Config_getBool(HIDE_COMPOUND_REFERENCE) ? displayName() : translateFunc();
1714 };
1715
1716 if (lang==SrcLangExt::Java)
1717 {
1718 pageTitle = theTranslator->trPackage(displayName());
1719 }
1720 else if (lang==SrcLangExt::Fortran || lang==SrcLangExt::Slice)
1721 {
1722 pageTitle = getReferenceTitle([this](){
1724 });
1725 }
1726 else if (lang==SrcLangExt::IDL)
1727 {
1728 pageTitle = getReferenceTitle([this](){
1729 return isConstantGroup()
1732 });
1733 }
1734 else
1735 {
1736 if (isInline())
1737 {
1738 pageTitle = "inline ";
1739 }
1740 pageTitle += getReferenceTitle([this](){
1742 });
1743 }
1744 return pageTitle;
1745}
1746
1748{
1749 SrcLangExt lang = getLanguage();
1750 if (lang==SrcLangExt::Java)
1751 {
1752 return "package";
1753 }
1754 else if(lang==SrcLangExt::CSharp)
1755 {
1756 return "namespace";
1757 }
1758 else if (lang==SrcLangExt::Fortran)
1759 {
1760 return "module";
1761 }
1762 else if (lang==SrcLangExt::IDL)
1763 {
1764 if (isModule())
1765 {
1766 return "module";
1767 }
1768 else if (isConstantGroup())
1769 {
1770 return "constants";
1771 }
1772 else if (isLibrary())
1773 {
1774 return "library";
1775 }
1776 else
1777 {
1778 err_full(getDefFileName(),getDefLine(),"Internal inconsistency: namespace in IDL not module, library or constant group");
1779 }
1780 }
1781 return "namespace";
1782}
1783
1785{
1786 metaData = m;
1787}
1788
1789// --- Cast functions
1790//
1792{
1793 if (d && (typeid(*d)==typeid(NamespaceDefImpl) || typeid(*d)==typeid(NamespaceDefAliasImpl)))
1794 {
1795 return static_cast<NamespaceDef*>(d);
1796 }
1797 else
1798 {
1799 return nullptr;
1800 }
1801}
1802
1804{
1805 Definition *d = toDefinition(md);
1806 if (d && typeid(*d)==typeid(NamespaceDefImpl))
1807 {
1808 return static_cast<NamespaceDef*>(d);
1809 }
1810 else
1811 {
1812 return nullptr;
1813 }
1814}
1815
1816
1818{
1819 if (d && (typeid(*d)==typeid(NamespaceDefImpl) || typeid(*d)==typeid(NamespaceDefAliasImpl)))
1820 {
1821 return static_cast<const NamespaceDef*>(d);
1822 }
1823 else
1824 {
1825 return nullptr;
1826 }
1827}
1828
1830{
1831 if (d && typeid(*d)==typeid(NamespaceDefImpl))
1832 {
1833 return static_cast<NamespaceDefMutable*>(d);
1834 }
1835 else
1836 {
1837 return nullptr;
1838 }
1839}
1840
1841// --- Helpers
1842
1843static NamespaceDef *getResolvedNamespaceRec(StringSet &namespacesTried,const NamespaceAliasInfo &aliasInfo);
1844
1845static DString replaceNamespaceAliasesRec(StringSet &namespacesTried,const DString &name)
1846{
1847 DString result = name;
1848 //printf("> replaceNamespaceAliasesRec(%s)\n",qPrint(name));
1849 if (namespacesTried.find(name.str())==namespacesTried.end())
1850 {
1851 namespacesTried.insert(name.str());
1852 size_t p = 0;
1853 for (;;)
1854 {
1855 size_t i = name.str().find("::",p);
1856 if (i==std::string::npos)
1857 {
1858 auto it = Doxygen::namespaceAliasMap.find(name.str());
1859 if (it != Doxygen::namespaceAliasMap.end())
1860 {
1861 //printf("found map %s->%s\n",qPrint(name),qPrint(it->second.alias));
1862 auto ns = getResolvedNamespaceRec(namespacesTried,it->second);
1863 if (ns)
1864 {
1865 result = replaceNamespaceAliasesRec(namespacesTried,ns->qualifiedName());
1866 }
1867 }
1868 break;
1869 }
1870 else
1871 {
1872 auto it = Doxygen::namespaceAliasMap.find(name.left(i).str());
1873 if (it != Doxygen::namespaceAliasMap.end())
1874 {
1875 //printf("found map %s|%s->%s\n",qPrint(name.left(i)),qPrint(name.mid(i)),qPrint(it->second.alias));
1876 auto ns = getResolvedNamespaceRec(namespacesTried,it->second);
1877 if (ns)
1878 {
1879 result = replaceNamespaceAliasesRec(namespacesTried,ns->qualifiedName()+name.mid(i));
1880 break;
1881 }
1882 }
1883 }
1884 p = i+2;
1885 }
1886 }
1887 //printf("< replaceNamespaceAliasesRec(%s)=%s\n",qPrint(name),qPrint(result));
1888 return result;
1889}
1890
1891static NamespaceDef *getResolvedNamespaceRec(StringSet &namespacesTried,const NamespaceAliasInfo &aliasInfo)
1892{
1893 size_t j = aliasInfo.context.length();
1894 for (;;)
1895 {
1896 if (j>0)
1897 {
1898 //printf("candidate %s|::%s\n",qPrint(aliasInfo.context.substr(0,j)),qPrint(aliasInfo.alias));
1899 auto candidate = replaceNamespaceAliasesRec(namespacesTried,aliasInfo.context.substr(0,j)+"::"+aliasInfo.alias);
1900 auto nd = Doxygen::namespaceLinkedMap->find(candidate);
1901 if (nd)
1902 {
1903 return nd;
1904 }
1905 }
1906 if (j>0) // strip one level from context, i.e. given N1::N2::N3
1907 // j==10 -> j==6 (N1::N2::N3->N1::N2), and then
1908 // j==6 -> j==2 (N1::N2->N1), and then
1909 // j==2 -> j==std::string::npos (N1->"")
1910 {
1911 j = aliasInfo.context.rfind("::",j-1);
1912 }
1913 else
1914 {
1915 j = std::string::npos;
1916 }
1917 if (j==std::string::npos)
1918 {
1919 //printf("candidate %s\n",qPrint(aliasInfo.alias));
1920 auto candidate = replaceNamespaceAliasesRec(namespacesTried,aliasInfo.alias);
1921 auto nd = Doxygen::namespaceLinkedMap->find(candidate);
1922 if (nd)
1923 {
1924 return nd;
1925 }
1926 break;
1927 }
1928 }
1929 return nullptr;
1930}
1931
1933{
1934 //printf("> replaceNamespaceAliases(%s)\n",qPrint(name));
1935 StringSet namespacesTried;
1936 name = replaceNamespaceAliasesRec(namespacesTried,name);
1937 //printf("< replaceNamespaceAliases: result=%s\n",qPrint(name));
1938}
1939
1941{
1942 //printf("> getResolvedNamespace(%s)\n",qPrint(name));
1943 if (name.empty()) return nullptr;
1944 StringSet namespacesTried;
1945 auto ns = getResolvedNamespaceRec(namespacesTried,NamespaceAliasInfo(name.str()));
1946 //printf("< getResolvedNamespace(%s)=%s\n",qPrint(name),ns?qPrint(ns->qualifiedName()):"nullptr");
1947 return ns;
1948}
1949
1950//--------------------------------------------------------------------------------------
1951//
1953{
1954 for (const auto &cnd : nd->getNamespaces())
1955 {
1956 if (cnd->isLinkableInProject() && !cnd->isAnonymous())
1957 {
1958 return true;
1959 }
1960 }
1961 return false;
1962}
1963
1965{
1966 //printf(">namespaceHasNestedConcept(%s)\n",qPrint(nd->name()));
1967 for (const auto &cnd : nd->getNamespaces())
1968 {
1970 {
1971 //printf("<namespaceHasNestedConcept(%s): case1\n",qPrint(nd->name()));
1972 return true;
1973 }
1974 }
1975 for (const auto &cnd : nd->getConcepts())
1976 {
1977 //printf("candidate %s isLinkableInProject()=%d\n",qPrint(cnd->name()),cnd->isLinkableInProject());
1978 if (cnd->isLinkableInProject())
1979 {
1980 //printf("<namespaceHasNestedConcept(%s): case2\n",qPrint(nd->name()));
1981 return true;
1982 }
1983 }
1984 //printf("<namespaceHasNestedConcept(%s): case3\n",qPrint(nd->name()));
1985 return false;
1986}
1987
1989{
1990 //printf(">namespaceHasNestedClass(%s,filterClasses=%d)\n",qPrint(nd->name()),filterClasses);
1991 for (const auto &cnd : nd->getNamespaces())
1992 {
1993 if (namespaceHasNestedClass(cnd,filterClasses,ct))
1994 {
1995 //printf("<namespaceHasNestedClass(%s,filterClasses=%d): case1\n",qPrint(nd->name()),filterClasses);
1996 return true;
1997 }
1998 }
1999
2000 ClassLinkedRefMap list = nd->getClasses();
2001 if (filterClasses)
2002 {
2003 switch (ct)
2004 {
2006 list = nd->getInterfaces();
2007 break;
2008 case ClassDef::Struct:
2009 list = nd->getStructs();
2010 break;
2011 case ClassDef::Record:
2012 list = nd->getRecords();
2013 break;
2015 list = nd->getExceptions();
2016 break;
2017 default:
2018 break;
2019 }
2020 }
2021
2022 for (const auto &cd : list)
2023 {
2024 //printf("candidate %s isLinkableInProject()=%d\n",qPrint(cd->name()),cd->isLinkableInProject());
2025 if (cd->isLinkableInProject())
2026 {
2027 //printf("<namespaceHasNestedClass(%s,filterClasses=%d): case2\n",qPrint(nd->name()),filterClasses);
2028 return true;
2029 }
2030 }
2031 //printf("<namespaceHasNestedClass(%s,filterClasses=%d): case3\n",qPrint(nd->name()),filterClasses);
2032 return false;
2033}
2034
2035
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:109
@ Exception
Definition classdef.h:112
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:1476
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
ClassLinkedRefMap getRecords() 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 ClassLinkedRefMap getRecords() const =0
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
ClassLinkedRefMap m_records
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
ClassLinkedRefMap getRecords() 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:180
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:2054
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:404
void endFileWithNavPath(OutputList &ol, const DefinitionMutable *d, bool showPageNavigation)
Definition index.cpp:458
void startTitle(OutputList &ol, const DString &fileName, const DefinitionMutable *def)
Definition index.cpp:394
void startFile(OutputList &ol, const DString &name, bool isSource, const DString &manName, const DString &title, HighlightedItem hli, bool additionalIndices, const DString &altSidebarName, int hierarchyLevel, const DString &allMembersFile)
Definition index.cpp:411
@ NamespaceVisible
Definition index.h:94
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:112
MemberListType type
Definition layout.h:118
DString title(SrcLangExt lang) const
Definition layout.cpp:1827
Represents of a member definition list with configurable title.
Definition layout.h:132
MemberListType type
Definition layout.h:137
DString title(SrcLangExt lang) const
Definition layout.cpp:1839
Definition layout.h:102
DString title(SrcLangExt lang) const
Definition layout.cpp:1820
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:2995
void addGroupListToTitle(OutputList &ol, const Definition *d)
Definition util.cpp:4053
DString stripScope(const DString &name)
Definition util.cpp:3241
void createSubDirs(const Dir &d)
Definition util.cpp:3101
DString convertToHtml(const DString &s, bool keepEntities)
Definition util.cpp:3423
void addHtmlExtensionIfMissing(DString &fName)
Definition util.cpp:4063
DString convertToXML(const DString &s, bool keepEntities, const bool citeEntry)
Definition util.cpp:3364
DString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Definition util.cpp:4765
DString removeAnonymousScopes(const DString &str)
Definition util.cpp:98
A bunch of utility functions.