namespacedef.h
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 #ifndef NAMESPACEDEF_H
19 #define NAMESPACEDEF_H
20 
21 #include <qstrlist.h>
22 #include <qdict.h>
23 #include "sortdict.h"
24 #include "definition.h"
25 #include "filedef.h"
26 
27 class MemberList;
28 class ClassDef;
29 class ClassList;
30 class OutputList;
31 class ClassSDict;
32 class MemberDef;
33 class NamespaceList;
34 class MemberGroupSDict;
35 class NamespaceSDict;
36 class FTextStream;
37 
38 /** A model of a namespace symbol. */
39 class NamespaceDef : public Definition
40 {
41  public:
42  NamespaceDef(const char *defFileName,int defLine,int defColumn,
43  const char *name,const char *ref=0,
44  const char *refFile=0,const char*type=0,
45  bool isPublished=false);
46  ~NamespaceDef();
47  DefType definitionType() const { return TypeNamespace; }
49  QCString anchor() const { return QCString(); }
50  void insertUsedFile(FileDef *fd);
51 
53  void writeMemberPages(OutputList &ol);
54  void writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const;
55  void writeTagFile(FTextStream &);
56 
57  void insertClass(ClassDef *cd);
58  void insertNamespace(NamespaceDef *nd);
59  void insertMember(MemberDef *md);
60 
61  void computeAnchors();
62  int countMembers();
67  void combineUsingRelations();
68  QCString displayName(bool=TRUE) const;
69  QCString localName() const;
70 
71  bool isConstantGroup() const { return CONSTANT_GROUP == m_type; }
72  bool isModule() const { return MODULE == m_type; }
73  bool isLibrary() const { return LIBRARY == m_type; }
74 
75  bool isLinkableInProject() const;
76  bool isLinkable() const;
77  bool hasDetailedDescription() const;
81  void sortMemberLists();
82 
83  virtual Definition *findInnerCompound(const char *name);
85  void addListReferences();
86  void setFileName(const QCString &fn);
87 
88  bool subGrouping() const { return m_subGrouping; }
89 
91  const QList<MemberList> &getMemberLists() const { return m_memberLists; }
92  MemberDef *getMemberByName(const QCString &) const;
93 
94  /*! Returns the user defined member groups */
96 
97  /*! Returns the classes contained in this namespace */
98  ClassSDict *getClassSDict() const { return classSDict; }
99 
100  /*! Returns the namespaces contained in this namespace */
102 
103  QCString title() const;
105 
106  bool visited;
107 
108  private:
111  void writeMemberDeclarations(OutputList &ol,MemberListType lt,const QCString &title);
113  void writeDetailedDescription(OutputList &ol,const QCString &title);
117  void writeClassDeclarations(OutputList &ol,const QCString &title);
118  void writeInlineClasses(OutputList &ol);
119  void writeNamespaceDeclarations(OutputList &ol,const QCString &title,
120  bool isConstantGroup=false);
121  void writeMemberGroups(OutputList &ol);
122  void writeAuthorSection(OutputList &ol);
125  void writeSummaryLinks(OutputList &ol);
127 
130 
134 
143 };
144 
145 /** A list of NamespaceDef objects. */
146 class NamespaceList : public QList<NamespaceDef>
147 {
148  public:
150  int compareValues(const NamespaceDef *nd1,const NamespaceDef *nd2) const
151  {
152  return qstricmp(nd1->name(), nd2->name());
153  }
154 };
155 
156 /** An iterator for NamespaceDef objects in a NamespaceList. */
157 class NamespaceListIterator : public QListIterator<NamespaceDef>
158 {
159  public:
162 };
163 
164 /** An unsorted dictionary of NamespaceDef objects. */
165 class NamespaceDict : public QDict<NamespaceDef>
166 {
167  public:
168  NamespaceDict(int size) : QDict<NamespaceDef>(size) {}
170 };
171 
172 /** A sorted dictionary of NamespaceDef objects. */
173 class NamespaceSDict : public SDict<NamespaceDef>
174 {
175  public:
178  void writeDeclaration(OutputList &ol,const char *title,
179  bool isConstantGroup=false, bool localName=FALSE);
180  bool declVisible() const;
181  private:
182  int compareValues(const NamespaceDef *item1,const NamespaceDef *item2) const
183  {
184  return qstricmp(item1->name(),item2->name());
185  }
186 };
187 
188 
189 
190 #endif
void endMemberDocumentation(OutputList &ol)
void writeTagFile(FTextStream &)
bool subGrouping() const
Definition: namespacedef.h:88
MemberDef * getMemberByName(const QCString &) const
void writeMemberDocumentation(OutputList &ol, MemberListType lt, const QCString &title)
void writeSummaryLinks(OutputList &ol)
QCString displayName(bool=TRUE) const
void writeBriefDescription(OutputList &ol)
QCString getOutputFileBase() const
void writeNamespaceDeclarations(OutputList &ol, const QCString &title, bool isConstantGroup=false)
void writeInlineClasses(OutputList &ol)
void computeAnchors()
const bool FALSE
Definition: qglobal.h:370
QCString compoundTypeString() const
void findSectionsInDocumentation()
const QList< MemberList > & getMemberLists() const
Definition: namespacedef.h:91
void addMemberToList(MemberListType lt, MemberDef *md)
DefType definitionType() const
Definition: namespacedef.h:47
MemberSDict * m_allMembersDict
Definition: namespacedef.h:135
NamespaceSDict(int size=17)
Definition: namespacedef.h:176
void writeDetailedDescription(OutputList &ol, const QCString &title)
Simplified and optimized version of QTextStream.
Definition: ftextstream.h:11
void startMemberDocumentation(OutputList &ol)
QCString anchor() const
Definition: namespacedef.h:49
NamespaceSDict * getUsedNamespaces() const
void writeMemberDeclarations(OutputList &ol, MemberListType lt, const QCString &title)
NamespaceSDict * namespaceSDict
Definition: namespacedef.h:139
static QStrList * l
Definition: config.cpp:1044
void writeAuthorSection(OutputList &ol)
int compareValues(const NamespaceDef *nd1, const NamespaceDef *nd2) const
Definition: namespacedef.h:150
void addNamespaceAttributes(OutputList &ol)
void writeMemberPages(OutputList &ol)
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
QAsciiDict< Entry > fn
int compareValues(const NamespaceDef *item1, const NamespaceDef *item2) const
Definition: namespacedef.h:182
const QCString & name() const
Definition: definition.h:114
void addMembersToMemberGroup()
int qstricmp(const char *str1, const char *str2)
Definition: qcstring.cpp:567
QCString title() const
QList< MemberList > m_memberLists
Definition: namespacedef.h:136
bool hasDetailedDescription() const
ClassSDict * classSDict
Definition: namespacedef.h:138
void insertNamespace(NamespaceDef *nd)
void addListReferences()
bool isLibrary() const
Definition: namespacedef.h:73
virtual Definition * findInnerCompound(const char *name)
bool m_subGrouping
Definition: namespacedef.h:140
QCString fileName
Definition: namespacedef.h:128
bool isLinkable() const
void setFileName(const QCString &fn)
void endMemberDeclarations(OutputList &ol)
MemberList * getMemberList(MemberListType lt) const
NamespaceSDict * usingDirList
Definition: namespacedef.h:131
void insertClass(ClassDef *cd)
void sortMemberLists()
SDict< Definition > * m_innerCompounds
Definition: namespacedef.h:133
bool m_isPublished
Definition: namespacedef.h:142
NamespaceSDict * getNamespaceSDict() const
Definition: namespacedef.h:101
bool isConstantGroup() const
Definition: namespacedef.h:71
void distributeMemberGroupDocumentation()
SDict< Definition > * getUsedClasses() const
Definition: namespacedef.h:66
NamespaceDict(int size)
Definition: namespacedef.h:168
QCString localName() const
void writeMemberGroups(OutputList &ol)
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)
enum NamespaceDef::@8 m_type
MemberGroupSDict * memberGroupSDict
Definition: namespacedef.h:137
MemberList * createMemberList(MemberListType lt)
MemberGroupSDict * getMemberGroupSDict() const
Definition: namespacedef.h:95
void writeClassDeclarations(OutputList &ol, const QCString &title)
void insertUsedFile(FileDef *fd)
void startMemberDeclarations(OutputList &ol)
MemberListType
Definition: types.h:104
void addUsingDeclaration(Definition *def)
void addUsingDirective(NamespaceDef *nd)
ClassSDict * getClassSDict() const
Definition: namespacedef.h:98
void writeQuickMemberLinks(OutputList &ol, MemberDef *currentMd) const
bool isLinkableInProject() const
NamespaceListIterator(const NamespaceList &l)
Definition: namespacedef.h:160
FileList files
Definition: namespacedef.h:129
SDict< Definition > * usingDeclList
Definition: namespacedef.h:132
const bool TRUE
Definition: qglobal.h:371
void addInnerCompound(Definition *d)
void combineUsingRelations()