namespacedef.cpp
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  *
4  *
5  * Copyright (C) 1997-2015 by Dimitri van Heesch.
6  *
7  * Permission to use, copy, modify, and distribute this software and its
8  * documentation under the terms of the GNU General Public License is hereby
9  * granted. No representations are made about the suitability of this software
10  * for any purpose. It is provided "as is" without express or implied warranty.
11  * See the GNU General Public License for more details.
12  *
13  * Documents produced by Doxygen are derivative works derived from the
14  * input used in their production; they are not affected by this license.
15  *
16  */
17 
18 #include "namespacedef.h"
19 #include "outputlist.h"
20 #include "util.h"
21 #include "language.h"
22 #include "classdef.h"
23 #include "classlist.h"
24 #include "memberlist.h"
25 #include "doxygen.h"
26 #include "message.h"
27 #include "docparser.h"
28 #include "searchindex.h"
29 #include "vhdldocgen.h"
30 #include "layout.h"
31 #include "membergroup.h"
32 #include "config.h"
33 
34 //------------------------------------------------------------------
35 
36 NamespaceDef::NamespaceDef(const char *df,int dl,int dc,
37  const char *name,const char *lref,
38  const char *fName, const char*type,
39  bool isPublished) :
40  Definition(df,dl,dc,name)
41  ,m_isPublished(isPublished)
42 {
43  if (fName)
44  {
45  fileName = stripExtension(fName);
46  }
47  else
48  {
49  setFileName(name);
50  }
51  classSDict = new ClassSDict(17);
54  usingDirList = 0;
55  usingDeclList = 0;
56  m_allMembersDict = 0;
57  setReference(lref);
60  visited=FALSE;
61  m_subGrouping=Config_getBool("SUBGROUPING");
62  if (type && !strcmp("module", type))
63  {
64  m_type = MODULE;
65  }
66  else if (type && !strcmp("constants", type))
67  {
69  }
70  else if (type && !strcmp("library", type))
71  {
72  m_type = LIBRARY;
73  }
74  else
75  {
76  m_type = NAMESPACE;
77  }
78 }
79 
81 {
82  delete classSDict;
83  delete namespaceSDict;
84  delete m_innerCompounds;
85  delete usingDirList;
86  delete usingDeclList;
87  delete memberGroupSDict;
88  delete m_allMembersDict;
89 }
90 
92 {
93  fileName="namespace";
94  fileName+=fn;
95 }
96 
98 {
100  MemberGroup *mg;
101  for (;(mg=mgli.current());++mgli)
102  {
104  }
105 }
106 
108 {
111  MemberGroup *mg;
112  for (;(mg=mgli.current());++mgli)
113  {
115  }
117  MemberList *ml;
118  for (mli.toFirst();(ml=mli.current());++mli)
119  {
121  {
123  }
124  }
125 }
126 
128 {
129  if (fd==0) return;
130  if (files.find(fd)==-1)
131  {
132  if (Config_getBool("SORT_MEMBER_DOCS"))
133  files.inSort(fd);
134  else
135  files.append(fd);
136  }
137 }
138 
140 {
143  {
145  }
146  else if (d->definitionType()==Definition::TypeClass)
147  {
148  insertClass((ClassDef *)d);
149  }
150 }
151 
153 {
154  if (classSDict->find(cd->name())==0)
155  {
156  if (Config_getBool("SORT_BRIEF_DOCS"))
157  classSDict->inSort(cd->name(),cd);
158  else
159  classSDict->append(cd->name(),cd);
160  }
161 }
162 
164 {
165  if (namespaceSDict->find(nd->name())==0)
166  {
167  if (Config_getBool("SORT_MEMBER_DOCS"))
168  namespaceSDict->inSort(nd->name(),nd);
169  else
170  namespaceSDict->append(nd->name(),nd);
171  }
172 }
173 
174 
176 {
178  MemberList *ml;
179  for (mli.toFirst();(ml=mli.current());++mli)
180  {
182  {
184  }
185  }
186 
187  // add members inside sections to their groups
188  if (memberGroupSDict)
189  {
191  MemberGroup *mg;
192  for (;(mg=mgli.current());++mgli)
193  {
195  {
196  //printf("----> addToDeclarationSection(%s)\n",mg->header().data());
198  }
199  }
200  }
201 }
202 
204 {
205  if (md->isHidden()) return;
207  if (allMemberList==0)
208  {
209  allMemberList = new MemberList(MemberListType_allMembersList);
210  m_memberLists.append(allMemberList);
211  }
212  allMemberList->append(md);
213  if (m_allMembersDict==0)
214  {
216  }
217  //printf("%s::m_allMembersDict->append(%s)\n",name().data(),md->localName().data());
219  //::addNamespaceMemberNameToIndex(md);
220  //static bool sortBriefDocs=Config_getBool("SORT_BRIEF_DOCS");
221  switch(md->memberType())
222  {
223  case MemberType_Variable:
226  break;
227  case MemberType_Function:
230  break;
231  case MemberType_Typedef:
234  break;
238  break;
239  case MemberType_EnumValue:
240  break;
241  case MemberType_Define:
244  break;
245  default:
246  err("NamespaceDef::insertMembers(): "
247  "member `%s' with class scope `%s' inserted in namespace scope `%s'!\n",
248  md->name().data(),
249  md->getClassDef() ? md->getClassDef()->name().data() : "",
250  name().data());
251  }
252 }
253 
255 {
257  if (allMemberList) setAnchors(allMemberList);
258 }
259 
261 {
262  static bool repeatBrief = Config_getBool("REPEAT_BRIEF");
263  return ((!briefDescription().isEmpty() && repeatBrief) ||
264  !documentation().isEmpty());
265 }
266 
268 {
269  tagFile << " <compound kind=\"namespace\">" << endl;
270  tagFile << " <name>" << convertToXML(name()) << "</name>" << endl;
271  tagFile << " <filename>" << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "</filename>" << endl;
272  QCString idStr = id();
273  if (!idStr.isEmpty())
274  {
275  tagFile << " <clangid>" << convertToXML(idStr) << "</clangid>" << endl;
276  }
279  LayoutDocEntry *lde;
280  for (eli.toFirst();(lde=eli.current());++eli)
281  {
282  switch (lde->kind())
283  {
285  {
286  if (namespaceSDict)
287  {
289  NamespaceDef *nd;
290  for (ni.toFirst();(nd=ni.current());++ni)
291  {
292  if (nd->isLinkableInProject())
293  {
294  tagFile << " <namespace>" << convertToXML(nd->name()) << "</namespace>" << endl;
295  }
296  }
297  }
298  }
299  break;
301  {
302  if (classSDict)
303  {
305  ClassDef *cd;
306  for (ci.toFirst();(cd=ci.current());++ci)
307  {
308  if (cd->isLinkableInProject())
309  {
310  tagFile << " <class kind=\"" << cd->compoundTypeString()
311  << "\">" << convertToXML(cd->name()) << "</class>" << endl;
312  }
313  }
314  }
315  }
317  {
319  MemberList * ml = getMemberList(lmd->type);
320  if (ml)
321  {
322  ml->writeTagFile(tagFile);
323  }
324  }
325  break;
327  {
328  if (memberGroupSDict)
329  {
331  MemberGroup *mg;
332  for (;(mg=mgli.current());++mgli)
333  {
334  mg->writeTagFile(tagFile);
335  }
336  }
337  }
338  break;
339  default:
340  break;
341  }
342  }
343  writeDocAnchorsToTagFile(tagFile);
344  tagFile << " </compound>" << endl;
345 }
346 
348 {
350  {
351  ol.pushGeneratorState();
353  ol.writeRuler();
354  ol.popGeneratorState();
355  ol.pushGeneratorState();
357  ol.writeAnchor(0,"details");
358  ol.popGeneratorState();
359  ol.startGroupHeader();
360  ol.parseText(title);
361  ol.endGroupHeader();
362 
363  ol.startTextBlock();
364  if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF"))
365  {
367  }
368  if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF") &&
369  !documentation().isEmpty())
370  {
371  ol.pushGeneratorState();
374  //ol.newParagraph(); // FIXME:PARA
375  ol.enableAll();
378  ol.writeString("\n\n");
379  ol.popGeneratorState();
380  }
381  if (!documentation().isEmpty())
382  {
383  ol.generateDoc(docFile(),docLine(),this,0,documentation()+"\n",TRUE,FALSE);
384  }
385  ol.endTextBlock();
386  }
387 }
388 
390 {
391  if (hasBriefDescription())
392  {
393  DocRoot *rootNode = validatingParseDoc(briefFile(),briefLine(),this,0,
395  if (rootNode && !rootNode->isEmpty())
396  {
397  ol.startParagraph();
398  ol.writeDoc(rootNode,this,0);
399  ol.pushGeneratorState();
401  ol.writeString(" \n");
403 
405  {
407  ol.startTextLink(0,"details");
409  ol.endTextLink();
410  }
411  ol.popGeneratorState();
412  ol.endParagraph();
413  }
414  delete rootNode;
415 
416  // FIXME:PARA
417  //ol.pushGeneratorState();
418  //ol.disable(OutputGenerator::RTF);
419  //ol.newParagraph();
420  //ol.popGeneratorState();
421  }
422  ol.writeSynopsis();
423 }
424 
426 {
427  ol.startMemberSections();
428 }
429 
431 {
432  ol.endMemberSections();
433 }
434 
436 {
437  if (Config_getBool("SEPARATE_MEMBER_PAGES"))
438  {
441  }
442 }
443 
445 {
446  if (Config_getBool("SEPARATE_MEMBER_PAGES"))
447  {
450  }
451 }
452 
454 {
455  if (classSDict) classSDict->writeDeclaration(ol,0,title,TRUE);
456 }
457 
459 {
461 }
462 
464  bool const isConstantGroup)
465 {
466  if (namespaceSDict) namespaceSDict->writeDeclaration(ol,title,isConstantGroup,TRUE);
467 }
468 
470 {
471  /* write user defined member groups */
472  if (memberGroupSDict)
473  {
476  MemberGroup *mg;
477  for (;(mg=mgli.current());++mgli)
478  {
479  if ((!mg->allMembersInSameSection() || !m_subGrouping)
480  && mg->header()!="[NOHEADER]")
481  {
482  mg->writeDeclarations(ol,0,this,0,0);
483  }
484  }
485  }
486 }
487 
489 {
490  // write Author section (Man only)
491  ol.pushGeneratorState();
493  ol.startGroupHeader();
495  ol.endGroupHeader();
497  ol.popGeneratorState();
498 }
499 
501 {
502  ol.pushGeneratorState();
506  LayoutDocEntry *lde;
507  bool first=TRUE;
508  SrcLangExt lang = getLanguage();
509  for (eli.toFirst();(lde=eli.current());++eli)
510  {
513  )
514  {
516  QCString label = lde->kind()==LayoutDocEntry::NamespaceClasses ? "nested-classes" : "namespaces";
517  ol.writeSummaryLink(0,label,ls->title(lang),first);
518  first=FALSE;
519  }
520  else if (lde->kind()== LayoutDocEntry::MemberDecl)
521  {
523  MemberList * ml = getMemberList(lmd->type);
524  if (ml && ml->declVisible())
525  {
526  ol.writeSummaryLink(0,MemberList::listTypeAsString(ml->listType()),lmd->title(lang),first);
527  first=FALSE;
528  }
529  }
530  }
531  if (!first)
532  {
533  ol.writeString(" </div>\n");
534  }
535  ol.popGeneratorState();
536 }
537 
539 {
540  // UNO IDL constant groups may be published
542  {
543  ol.pushGeneratorState();
545  ol.startLabels();
546  ol.writeLabel("published",false);
547  ol.endLabels();
548  ol.popGeneratorState();
549  }
550 }
551 
553 {
554  static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW");
555  //static bool outputJava = Config_getBool("OPTIMIZE_OUTPUT_JAVA");
556  //static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
557 
558  QCString pageTitle = title();
559  startFile(ol,getOutputFileBase(),name(),pageTitle,HLI_NamespaceVisible,!generateTreeView);
560 
561  if (!generateTreeView)
562  {
564  {
566  }
567  ol.endQuickIndices();
568  }
569 
570  startTitle(ol,getOutputFileBase(),this);
571  ol.parseText(pageTitle);
572  addGroupListToTitle(ol,this);
575  ol.startContents();
576 
578  {
581  }
582 
584 
585  //---------------------------------------- start flexible part -------------------------------
586 
587  SrcLangExt lang = getLanguage();
590  LayoutDocEntry *lde;
591  for (eli.toFirst();(lde=eli.current());++eli)
592  {
593  switch (lde->kind())
594  {
597  break;
600  break;
602  {
604  writeClassDeclarations(ol,ls->title(lang));
605  }
606  break;
608  {
610  writeNamespaceDeclarations(ol,ls->title(lang),false);
611  }
612  break;
614  {
616  writeNamespaceDeclarations(ol,ls->title(lang),true);
617  }
618  break;
620  writeMemberGroups(ol);
621  break;
623  {
625  writeMemberDeclarations(ol,lmd->type,lmd->title(lang));
626  }
627  break;
630  break;
632  {
634  writeDetailedDescription(ol,ls->title(lang));
635  }
636  break;
639  break;
641  writeInlineClasses(ol);
642  break;
644  {
646  writeMemberDocumentation(ol,lmd->type,lmd->title(lang));
647  }
648  break;
651  break;
653  writeAuthorSection(ol);
654  break;
681  err("Internal inconsistency: member %d should not be part of "
682  "LayoutDocManager::Namespace entry list\n",lde->kind());
683  break;
684  }
685  }
686 
687  //---------------------------------------- end flexible part -------------------------------
688 
689  ol.endContents();
690 
691  endFileWithNavPath(this,ol);
692 
693  if (Config_getBool("SEPARATE_MEMBER_PAGES"))
694  {
696  if (allMemberList) allMemberList->sort();
697  writeMemberPages(ol);
698  }
699 }
700 
702 {
703  ol.pushGeneratorState();
705 
707  MemberList *ml;
708  for (mli.toFirst();(ml=mli.current());++mli)
709  {
711  {
712  ml->writeDocumentationPage(ol,displayName(),this);
713  }
714  }
715  ol.popGeneratorState();
716 }
717 
719 {
720  static bool createSubDirs=Config_getBool("CREATE_SUBDIRS");
721 
722  ol.writeString(" <div class=\"navtab\">\n");
723  ol.writeString(" <table>\n");
724 
726  if (allMemberList)
727  {
728  MemberListIterator mli(*allMemberList);
729  MemberDef *md;
730  for (mli.toFirst();(md=mli.current());++mli)
731  {
732  if (md->getNamespaceDef()==this && md->isLinkable() && !md->isEnumValue())
733  {
734  ol.writeString(" <tr><td class=\"navtab\">");
735  if (md->isLinkableInProject())
736  {
737  if (md==currentMd) // selected item => highlight
738  {
739  ol.writeString("<a class=\"qindexHL\" ");
740  }
741  else
742  {
743  ol.writeString("<a class=\"qindex\" ");
744  }
745  ol.writeString("href=\"");
746  if (createSubDirs) ol.writeString("../../");
748  ol.writeString("\">");
750  ol.writeString("</a>");
751  }
752  ol.writeString("</td></tr>\n");
753  }
754  }
755  }
756 
757  ol.writeString(" </table>\n");
758  ol.writeString(" </div>\n");
759 }
760 
762 {
764  if (allMemberList) allMemberList->countDocMembers();
765  return (allMemberList ? allMemberList->numDocMembers() : 0)+classSDict->count();
766 }
767 
769 {
770  if (usingDirList==0)
771  {
773  }
774  if (usingDirList->find(nd->qualifiedName())==0)
775  {
776  usingDirList->append(nd->qualifiedName(),nd);
777  }
778  //printf("%p: NamespaceDef::addUsingDirective: %s:%d\n",this,name().data(),usingDirList->count());
779 }
780 
782 {
783  //printf("%p: NamespaceDef::getUsedNamespace: %s:%d\n",this,name().data(),usingDirList?usingDirList->count():0);
784  return usingDirList;
785 }
786 
788 {
789  if (usingDeclList==0)
790  {
792  }
793  if (usingDeclList->find(d->qualifiedName())==0)
794  {
796  }
797 }
798 
800 {
801  if (isReference())
802  {
803  return fileName;
804  }
805  else
806  {
807  return convertNameToFile(fileName);
808  }
809 }
810 
812 {
813  if (n==0) return 0;
815  if (d==0)
816  {
817  if (usingDirList)
818  {
819  d = usingDirList->find(n);
820  }
821  if (d==0 && usingDeclList)
822  {
823  d = usingDeclList->find(n);
824  }
825  }
826  return d;
827 }
828 
830 {
831  //bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
832  {
833  QList<ListItemInfo> *xrefItems = xrefListItems();
834  addRefItem(xrefItems,
835  qualifiedName(),
840  0,
841  this
842  );
843  }
845  MemberGroup *mg;
846  for (;(mg=mgli.current());++mgli)
847  {
848  mg->addListReferences(this);
849  }
851  MemberList *ml;
852  for (mli.toFirst();(ml=mli.current());++mli)
853  {
855  {
856  ml->addListReferences(this);
857  }
858  }
859 }
860 
861 QCString NamespaceDef::displayName(bool includeScope) const
862 {
863  QCString result=includeScope ? name() : localName();
864  SrcLangExt lang = getLanguage();
866  if (sep!="::")
867  {
868  result = substitute(result,"::",sep);
869  }
870  //printf("NamespaceDef::displayName() %s->%s lang=%d\n",name().data(),result.data(),lang);
871  return result;
872 }
873 
875 {
876  QCString result=name();
877  int i=result.findRev("::");
878  if (i!=-1)
879  {
880  result=result.mid(i+2);
881  }
882  return result;
883 }
884 
886 {
887  if (visited) return; // already done
888  visited=TRUE;
889  if (usingDirList)
890  {
892  NamespaceDef *nd;
893  for (nli.toFirst();(nd=nli.current());++nli)
894  {
895  nd->combineUsingRelations();
896  }
897  for (nli.toFirst();(nd=nli.current());++nli)
898  {
899  // add used namespaces of namespace nd to this namespace
900  if (nd->getUsedNamespaces())
901  {
903  NamespaceDef *und;
904  for (unli.toFirst();(und=unli.current());++unli)
905  {
906  //printf("Adding namespace %s to the using list of %s\n",und->qualifiedName().data(),qualifiedName().data());
907  addUsingDirective(und);
908  }
909  }
910  // add used classes of namespace nd to this namespace
911  if (nd->getUsedClasses())
912  {
914  Definition *ucd;
915  for (cli.toFirst();(ucd=cli.current());++cli)
916  {
917  //printf("Adding class %s to the using list of %s\n",cd->qualifiedName().data(),qualifiedName().data());
918  addUsingDeclaration(ucd);
919  }
920  }
921  }
922  }
923 }
924 
926 {
928  NamespaceDef *nd;
929  for (ni.toFirst();(nd=ni.current());++ni)
930  {
931  if (nd->isLinkable())
932  {
933  return TRUE;
934  }
935  }
936  return FALSE;
937 }
938 
940  bool const isConstantGroup,bool localName)
941 {
942 
943 
944  if (count()==0) return; // no namespaces in the list
945 
946  if (Config_getBool("OPTIMIZE_OUTPUT_VHDL")) return;
947 
948 
950  NamespaceDef *nd;
951  bool found=FALSE;
952  for (ni.toFirst();(nd=ni.current()) && !found;++ni)
953  {
954  if (nd->isLinkable())
955  {
956  SrcLangExt lang = nd->getLanguage();
957  if (SrcLangExt_IDL==lang)
958  {
959  if (isConstantGroup == nd->isConstantGroup())
960  {
961  found=TRUE;
962  break;
963  }
964  }
965  else if (!isConstantGroup) // ensure we only get extra section in IDL
966  {
967  if (nd->isConstantGroup())
968  {
969  err("Internal inconsistency: constant group but not IDL?\n");
970  }
971  found=TRUE;
972  break;
973  }
974  }
975  }
976  if (!found) return; // no linkable namespaces in the list
977 
978  // write list of namespaces
979  ol.startMemberHeader("namespaces");
980  //bool javaOpt = Config_getBool("OPTIMIZE_OUTPUT_JAVA");
981  //bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
982  ol.parseText(title);
983  ol.endMemberHeader();
984  ol.startMemberList();
985  for (ni.toFirst();(nd=ni.current());++ni)
986  {
987  if (nd->isLinkable() && nd->hasDocumentation())
988  {
989  SrcLangExt lang = nd->getLanguage();
990  if (lang==SrcLangExt_IDL && (isConstantGroup != nd->isConstantGroup()))
991  continue; // will be output in another pass, see layout_default.xml
994  QCString ct = nd->compoundTypeString();
995  ol.docify(ct);
996  ol.docify(" ");
997  ol.insertMemberAlign();
998  QCString name;
999  if (localName)
1000  {
1001  name = nd->localName();
1002  }
1003  else
1004  {
1005  name = nd->displayName();
1006  }
1008  ol.endMemberItem();
1009  if (!nd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
1010  {
1012  ol.generateDoc(nd->briefFile(),nd->briefLine(),nd,0,nd->briefDescription(),FALSE,FALSE,0,TRUE);
1013  ol.endMemberDescription();
1014  }
1015  ol.endMemberDeclaration(0,0);
1016  }
1017  }
1018  ol.endMemberList();
1019 }
1020 
1022 {
1025  MemberList *ml;
1026  for (mli.toFirst();(ml=mli.current());++mli)
1027  {
1028  if (ml->listType()==lt)
1029  {
1030  return ml;
1031  }
1032  }
1033  // not found, create a new member list
1034  ml = new MemberList(lt);
1035  m_memberLists.append(ml);
1036  return ml;
1037 }
1038 
1040 {
1041  static bool sortBriefDocs = Config_getBool("SORT_BRIEF_DOCS");
1042  static bool sortMemberDocs = Config_getBool("SORT_MEMBER_DOCS");
1043  MemberList *ml = createMemberList(lt);
1044  ml->setNeedsSorting(
1045  ((ml->listType()&MemberListType_declarationLists) && sortBriefDocs) ||
1046  ((ml->listType()&MemberListType_documentationLists) && sortMemberDocs));
1047  ml->append(md);
1048 
1049 #if 0
1050  if (ml->needsSorting())
1051  ml->inSort(md);
1052  else
1053  ml->append(md);
1054 #endif
1055 
1057 }
1058 
1060 {
1062  MemberList *ml;
1063  for (mli.toFirst();(ml=mli.current());++mli)
1064  {
1065  if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(FALSE); }
1066  }
1067  if (classSDict)
1068  {
1069  classSDict->sort();
1070  }
1071  if (namespaceSDict)
1072  {
1073  namespaceSDict->sort();
1074  }
1075 }
1076 
1077 
1078 
1080 {
1082  MemberList *ml;
1083  for (mli.toFirst();(ml=mli.current());++mli)
1084  {
1085  if (ml->listType()==lt)
1086  {
1087  return ml;
1088  }
1089  }
1090  return 0;
1091 }
1092 
1094 {
1095  MemberList * ml = getMemberList(lt);
1096  if (ml) ml->writeDeclarations(ol,0,this,0,0,title,0);
1097 }
1098 
1100 {
1101  MemberList * ml = getMemberList(lt);
1102  if (ml) ml->writeDocumentation(ol,displayName(),this,title);
1103 }
1104 
1105 
1107 {
1108  int i = name().findRev("::");
1109  if (i==-1) i=0; else i+=2;
1110  static bool extractAnonNs = Config_getBool("EXTRACT_ANON_NSPACES");
1111  if (extractAnonNs && // extract anonymous ns
1112  name().mid(i,20)=="anonymous_namespace{" // correct prefix
1113  ) // not disabled by config
1114  {
1115  return TRUE;
1116  }
1117  return !name().isEmpty() && name().at(i)!='@' && // not anonymous
1118  (hasDocumentation() || getLanguage()==SrcLangExt_CSharp) && // documented
1119  !isReference() && // not an external reference
1120  !isHidden() && // not hidden
1121  !isArtificial(); // or artificial
1122 }
1123 
1125 {
1126  return isLinkableInProject() || isReference();
1127 }
1128 
1130 {
1131  MemberDef *md = 0;
1132  if (m_allMembersDict && !n.isEmpty())
1133  {
1134  md = m_allMembersDict->find(n);
1135  //printf("%s::m_allMembersDict->find(%s)=%p\n",name().data(),n.data(),md);
1136  }
1137  return md;
1138 }
1139 
1141 {
1142  SrcLangExt lang = getLanguage();
1143  QCString pageTitle;
1144  if (lang==SrcLangExt_Java)
1145  {
1146  pageTitle = theTranslator->trPackage(displayName());
1147  }
1148  else if (lang==SrcLangExt_Fortran)
1149  {
1151  }
1152  else if (lang==SrcLangExt_IDL)
1153  {
1154  pageTitle = isConstantGroup()
1157  }
1158  else
1159  {
1161  }
1162  return pageTitle;
1163 }
1164 
1166 {
1167  SrcLangExt lang = getLanguage();
1168  if (lang==SrcLangExt_Java)
1169  {
1170  return "package";
1171  }
1172  else if(lang==SrcLangExt_CSharp)
1173  {
1174  return "namespace";
1175  }
1176  else if (lang==SrcLangExt_Fortran)
1177  {
1178  return "module";
1179  }
1180  else if (lang==SrcLangExt_IDL)
1181  {
1182  if (isModule())
1183  {
1184  return "module";
1185  }
1186  else if (isConstantGroup())
1187  {
1188  return "constants";
1189  }
1190  else if (isLibrary())
1191  {
1192  return "library";
1193  }
1194  else
1195  {
1196  err_full(getDefFileName(),getDefLine(),"Internal inconsistency: namespace in IDL not module, library or constant group");
1197  }
1198  }
1199  return "";
1200 }
1201 
static QCString name
Definition: declinfo.cpp:673
QCString convertToXML(const char *s)
Definition: util.cpp:5717
void startMemberItem(const char *anchor, int i1, const char *id=0)
Definition: outputlist.h:218
void writeRuler()
Definition: outputlist.h:240
void endMemberDeclaration(const char *anchor, const char *inheritId)
Definition: outputlist.h:314
MemberListType listType() const
Definition: memberlist.h:38
QCString docFile() const
void endMemberDocumentation(OutputList &ol)
void append(const MemberDef *md)
Definition: memberlist.cpp:246
QCString header() const
Definition: membergroup.h:47
void setAnchors(MemberList *ml)
Definition: util.cpp:2254
void writeTagFile(FTextStream &)
void endMemberItem()
Definition: outputlist.h:220
void endFileWithNavPath(Definition *d, OutputList &ol)
Definition: index.cpp:282
void endGroupHeader(int extraLevels=0)
Definition: outputlist.h:178
bool isLinkableInProject() const
Definition: classdef.cpp:2707
bool isArtificial() const
virtual QCString getReference() const
MemberDef * getMemberByName(const QCString &) const
void inSort(const char *key, const T *d)
Definition: sortdict.h:197
void writeMemberDocumentation(OutputList &ol, MemberListType lt, const QCString &title)
void writeSummaryLinks(OutputList &ol)
static QCString result
bool isEmpty() const
Definition: qcstring.h:189
void endLabels()
Definition: outputlist.h:471
void startFile(OutputList &ol, const char *name, const char *manName, const char *title, HighlightedItem hli, bool additionalIndices, const char *altSidebarName)
Definition: index.cpp:244
QCString convertNameToFile(const char *name, bool allowDots=FALSE) const
QCString displayName(bool=TRUE) const
void append(const type *d)
Definition: qlist.h:73
virtual QCString trModuleReference(const char *namespaceName)=0
void writeBriefDescription(OutputList &ol)
QCString getOutputFileBase() const
QList< ListItemInfo > * xrefListItems() const
static QCString htmlFileExtension
Definition: doxygen.h:130
void writeTagFile(FTextStream &)
void writeString(const char *text)
Definition: outputlist.h:119
MemberListType type
Definition: layout.h:96
bool generateDoc(const char *fileName, int startLine, Definition *ctx, MemberDef *md, const QCString &docStr, bool indexWords, bool isExample, const char *exampleName=0, bool singleLine=FALSE, bool linkFromIndex=FALSE)
Definition: outputlist.cpp:131
void writeNamespaceDeclarations(OutputList &ol, const QCString &title, bool isConstantGroup=false)
void disableAllBut(OutputGenerator::OutputType o)
Definition: outputlist.cpp:49
char & at(uint i) const
Definition: qcstring.h:326
void startParagraph()
Definition: outputlist.h:115
QCString compoundTypeString() const
Definition: classdef.cpp:3499
virtual bool hasDocumentation() const
void writeInlineClasses(OutputList &ol)
QCString title(SrcLangExt lang) const
Definition: layout.cpp:1459
void writeNavigationPath(OutputList &ol) const
void setAutoDelete(bool val)
Definition: sortdict.h:545
void computeAnchors()
void writeDocumentation(OutputList &ol, const char *scopeName, Definition *container, const char *title, bool showEnumValues=FALSE, bool showInline=FALSE)
Definition: memberlist.cpp:655
const bool FALSE
Definition: qglobal.h:370
friend class Iterator
Definition: sortdict.h:598
QCString compoundTypeString() const
void findSectionsInDocumentation()
static LayoutDocManager & instance()
Definition: layout.cpp:1359
void addMemberToList(MemberListType lt, MemberDef *md)
bool isLinkableInProject() const
Definition: memberdef.cpp:1150
void startMemberDescription(const char *anchor, const char *inheritId=0)
Definition: outputlist.h:308
bool declVisible(const ClassDef::CompoundType *filter=0) const
Definition: classlist.cpp:65
MemberSDict * m_allMembersDict
Definition: namespacedef.h:135
void startMemberSections()
Definition: outputlist.h:186
void writeDetailedDescription(OutputList &ol, const QCString &title)
DocRoot * validatingParseDoc(const char *fileName, int startLine, Definition *ctx, MemberDef *md, const char *input, bool indexWords, bool isExample, const char *exampleName, bool singleLine, bool linkFromIndex)
Definition: docparser.cpp:7179
void writeLabel(const char *l, bool isLast)
Definition: outputlist.h:469
void writeDeclarations(OutputList &ol, ClassDef *cd, NamespaceDef *nd, FileDef *fd, GroupDef *gd, bool showInline=FALSE)
static bool suppressDocWarnings
Definition: doxygen.h:142
int briefLine() const
void writeTagFile(FTextStream &)
Definition: memberlist.cpp:963
virtual bool isReference() const
Simplified and optimized version of QTextStream.
Definition: ftextstream.h:11
void startMemberDocumentation(OutputList &ol)
int count() const
Definition: sortdict.h:284
QCString anchor() const
Definition: namespacedef.h:49
NamespaceSDict * getUsedNamespaces() const
virtual QCString trNamespaceReference(const char *namespaceName)=0
int find(const type *d) const
Definition: qlist.h:88
void writeMemberDeclarations(OutputList &ol, MemberListType lt, const QCString &title)
void startMemberList()
Definition: outputlist.h:206
NamespaceSDict * namespaceSDict
Definition: namespacedef.h:139
void append(const char *key, const T *d)
Definition: sortdict.h:135
static constexpr double mg
Definition: Units.h:145
SrcLangExt
Definition: types.h:41
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:95
Represents of a member definition list with configurable title.
Definition: layout.h:105
void startTextLink(const char *file, const char *anchor)
Definition: outputlist.h:159
QCString title(SrcLangExt lang) const
Definition: layout.cpp:1440
virtual QCString trModule(bool first_capital, bool singular)=0
bool parseText(const QCString &textStr)
Definition: outputlist.cpp:175
void writeAuthorSection(OutputList &ol)
QCString getDefFileName() const
bool declVisible() const
Definition: memberlist.cpp:256
Represents of a member declaration list with configurable title and subtitle.
Definition: layout.h:89
void writeDocAnchorsToTagFile(FTextStream &)
Definition: definition.cpp:520
void addNamespaceAttributes(OutputList &ol)
void writeMemberPages(OutputList &ol)
void countDocMembers(bool countEnumValues=FALSE)
Definition: memberlist.cpp:208
static NamespaceDef * globalScope
Definition: doxygen.h:128
void popGeneratorState()
Definition: outputlist.cpp:121
void endMemberHeader()
Definition: outputlist.h:196
virtual DefType definitionType() const =0
def cli(ctx)
Definition: main.py:7
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Definition: util.cpp:8065
void addIndexItem(Definition *context, MemberDef *md, const char *sectionAnchor=0, const char *title=0)
Definition: index.h:142
QAsciiDict< Entry > fn
static SearchIndexIntf * searchIndex
Definition: doxygen.h:133
void endParagraph()
Definition: outputlist.h:117
const QCString & name() const
Definition: definition.h:114
int getDefLine() const
Definition: definition.h:188
void addMembersToMemberGroup()
bool isEnumValue() const
Definition: memberdef.cpp:4150
QCString title() const
void writeSummaryLink(const char *file, const char *anchor, const char *title, bool first)
Definition: outputlist.h:362
void inSort(const type *d)
Definition: qlist.h:71
QList< MemberList > m_memberLists
Definition: namespacedef.h:136
void findSectionsInDocumentation()
Definition: memberlist.cpp:818
bool hasDetailedDescription() const
bool allMembersInSameSection() const
Definition: membergroup.h:67
void pushGeneratorState()
Definition: outputlist.cpp:111
void startMemberDeclaration()
Definition: outputlist.h:312
ClassSDict * classSDict
Definition: namespacedef.h:138
bool hasBriefDescription() const
QCString convertToHtml(const char *s, bool keepEntities)
Definition: util.cpp:5746
int numDocMembers() const
Definition: memberlist.h:52
void inSort(const MemberDef *md)
Definition: memberlist.cpp:241
SrcLangExt getLanguage() const
std::void_t< T > n
void insertNamespace(NamespaceDef *nd)
virtual QCString trAuthor(bool first_capital, bool singular)=0
void addListReferences()
void sort()
Definition: qlist.h:85
virtual void addWord(const char *word, bool hiPriority)=0
bool isLibrary() const
Definition: namespacedef.h:73
virtual QCString trGeneratedAutomatically(const char *s)=0
virtual Definition * findInnerCompound(const char *name)
bool m_subGrouping
Definition: namespacedef.h:140
void disable(OutputGenerator::OutputType o)
Definition: outputlist.cpp:79
QCString fileName
Definition: namespacedef.h:128
bool isLinkable() const
void setFileName(const QCString &fn)
QCString id() const
Definition: definition.cpp:413
void setNeedsSorting(bool b)
Definition: memberlist.cpp:902
A bunch of utility functions.
const char * data() const
Definition: qcstring.h:207
void addGroupListToTitle(OutputList &ol, Definition *d)
Definition: util.cpp:6528
void addToDeclarationSection()
QCString anchor() const
Definition: memberdef.cpp:1031
#define Config_getString(val)
Definition: config.cpp:660
type * current() const
Definition: qlist.h:146
void writeSynopsis()
Definition: outputlist.h:340
void writeDoc(DocRoot *root, Definition *ctx, MemberDef *md)
Definition: outputlist.cpp:162
void enable(OutputGenerator::OutputType o)
Definition: outputlist.cpp:89
#define Config_getBool(val)
Definition: config.cpp:664
void setReference(const char *r)
ClassDef * getClassDef() const
Definition: memberdef.cpp:4070
void setSectionList(Definition *d, MemberList *sl)
Definition: memberdef.cpp:3548
void endMemberDeclarations(OutputList &ol)
QCString briefFile() const
MemberList * getMemberList(MemberListType lt) const
virtual QCString qualifiedName() const
void sort()
Definition: sortdict.h:522
NamespaceSDict * usingDirList
Definition: namespacedef.h:131
void err(const char *fmt,...)
Definition: message.cpp:226
void insertClass(ClassDef *cd)
void sortMemberLists()
MemberType memberType() const
Definition: memberdef.cpp:4125
virtual QCString trMore()=0
virtual QCString briefDescription(bool abbreviate=FALSE) const
SDict< Definition > * m_innerCompounds
Definition: namespacedef.h:133
void err_full(const char *file, int line, const char *fmt,...)
Definition: message.cpp:234
void startGroupHeader(int extraLevels=0)
Definition: outputlist.h:176
QCString mid(uint index, uint len=0xffffffff) const
Definition: qcstring.cpp:246
void endQuickIndices()
Definition: outputlist.h:352
void writeDocumentationPage(OutputList &ol, const char *scopeName, Definition *container)
Definition: memberlist.cpp:715
bool m_isPublished
Definition: namespacedef.h:142
void endContents()
Definition: outputlist.h:366
bool isConstantGroup() const
Definition: namespacedef.h:71
void distributeMemberGroupDocumentation()
SDict< Definition > * getUsedClasses() const
Definition: namespacedef.h:66
QCString localName() const
MemberListType type
Definition: layout.h:111
void writeMemberGroups(OutputList &ol)
virtual Definition * getOuterScope() const
bool isHidden() const
void writeDeclaration(OutputList &ol, const ClassDef::CompoundType *filter=0, const char *header=0, bool localNames=FALSE)
Definition: classlist.cpp:94
virtual QCString trPackage(const char *name)=0
void sort()
Definition: sortdict.h:188
void startTitle(OutputList &ol, const char *fileName, Definition *def)
Definition: index.cpp:228
int strcmp(const String &s1, const String &s2)
Definition: relates.cpp:14
bool isModule() const
Definition: namespacedef.h:72
NamespaceDef(const char *defFileName, int defLine, int defColumn, const char *name, const char *ref=0, const char *refFile=0, const char *type=0, bool isPublished=false)
void writeDocumentation(OutputList &ol)
void insertMember(MemberDef *md)
void startTextBlock(bool dense=FALSE)
Definition: outputlist.h:404
virtual QCString trNamespace(bool first_capital, bool singular)=0
virtual Kind kind() const =0
void enableAll()
Definition: outputlist.cpp:59
Base class representing a piece of a documentation page.
Definition: layout.h:30
enum NamespaceDef::@8 m_type
MemberGroupSDict * memberGroupSDict
Definition: namespacedef.h:137
virtual void setCurrentDoc(Definition *ctx, const char *anchor, bool isSourceFile)=0
QCString getOutputFileBase() const
Definition: memberdef.cpp:941
void writeAnchor(const char *fileName, const char *name)
Definition: outputlist.h:242
void endMemberDescription()
Definition: outputlist.h:310
MemberList * createMemberList(MemberListType lt)
void writeClassDeclarations(OutputList &ol, const QCString &title)
NamespaceDef * getNamespaceDef() const
Definition: memberdef.cpp:4080
void addRefItem(const QList< ListItemInfo > *sli, const char *key, const char *prefix, const char *name, const char *title, const char *args, Definition *scope)
Definition: util.cpp:6456
Translator * theTranslator
Definition: language.cpp:157
void writeDocumentation(OutputList &ol, Definition *container=0)
Definition: classlist.cpp:119
bool needsSorting() const
Definition: memberlist.h:53
void insertUsedFile(FileDef *fd)
static QCString listTypeAsString(MemberListType type)
Definition: memberlist.cpp:907
void startMemberDeclarations(OutputList &ol)
void endTextBlock(bool paraBreak=FALSE)
Definition: outputlist.h:406
MemberListType
Definition: types.h:104
void endTitle(OutputList &ol, const char *fileName, const char *name)
Definition: index.cpp:237
void writeDeclarations(OutputList &ol, ClassDef *cd, NamespaceDef *nd, FileDef *fd, GroupDef *gd, const char *title, const char *subtitle, bool showEnumValues=FALSE, bool showInline=FALSE, ClassDef *inheritedFrom=0, MemberListType lt=MemberListType_pubMethods)
Definition: memberlist.cpp:519
void endMemberSections()
Definition: outputlist.h:188
bool isEmpty() const
Definition: docparser.h:1409
void createSubDirs(QDir &d)
Definition: util.cpp:5458
friend class Iterator
Definition: sortdict.h:289
void distributeMemberGroupDocumentation()
void addUsingDeclaration(Definition *def)
void addUsingDirective(NamespaceDef *nd)
void writeQuickMemberLinks(OutputList &ol, MemberDef *currentMd) const
int docLine() const
void docFindSections(const char *input, Definition *d, MemberGroup *mg, const char *fileName)
Definition: docparser.cpp:7434
bool isLinkableInProject() const
void startMemberHeader(const char *anchor)
Definition: outputlist.h:194
void docify(const char *s)
Definition: outputlist.h:145
void insertMemberAlign(bool templ=FALSE)
Definition: outputlist.h:238
virtual QCString trConstantGroupReference(const char *namespaceName)=0
void findSectionsInDocumentation()
T * find(const char *key)
Definition: sortdict.h:232
virtual QCString documentation() const
void writeObjectLink(const char *ref, const char *file, const char *anchor, const char *name)
Definition: outputlist.h:149
void setAutoDelete(bool enable)
Definition: qlist.h:99
bool declVisible() const
bool isLinkable() const
Definition: memberdef.cpp:1161
void writeDeclaration(OutputList &ol, const char *title, bool isConstantGroup=false, bool localName=FALSE)
void endTextLink()
Definition: outputlist.h:161
void addListReferences(Definition *def)
Definition: memberlist.cpp:784
FileList files
Definition: namespacedef.h:129
QCString stripExtension(const char *fName)
Definition: util.cpp:6799
SDict< Definition > * usingDeclList
Definition: namespacedef.h:132
QCString localName() const
const bool TRUE
Definition: qglobal.h:371
static IndexList * indexList
Definition: doxygen.h:149
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition: util.cpp:5088
void endMemberList()
Definition: outputlist.h:208
void addInnerCompound(Definition *d)
QCString title(SrcLangExt lang) const
Definition: layout.cpp:1447
void combineUsingRelations()
QTextStream & endl(QTextStream &s)
void startContents()
Definition: outputlist.h:364
void startLabels()
Definition: outputlist.h:467
void addListReferences(Definition *d)
type * toFirst()
Definition: qlist.h:135