doxygen
filedef.h
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 FILEDEF_H
19 #define FILEDEF_H
20 
21 #include <set>
22 
23 #include "definition.h"
24 #include "memberlist.h"
25 #include "containers.h"
26 
27 class MemberList;
28 class FileDef;
29 class FileList;
30 class ClassDef;
31 class ConceptDef;
32 class MemberDef;
33 class OutputList;
34 class NamespaceDef;
37 class ClassLinkedRefMap;
38 class PackageDef;
39 class DirDef;
40 class ClangTUParser;
41 
42 // --- Set of files
43 
44 using FileDefSet = std::set<const FileDef*>;
45 
48 {
49  IncludeInfo() {}
50  IncludeInfo(const FileDef *fd,const QCString &in,bool loc,bool imp)
51  : fileDef(fd), includeName(in), local(loc), imported(imp) {}
52  const FileDef *fileDef = 0;
53  QCString includeName;
54  bool local = false;
55  bool imported = false;
56 };
57 
58 class IncludeInfoList : public std::vector<IncludeInfo>
59 {
60 };
61 
62 bool compareFileDefs(const FileDef *fd1, const FileDef *fd2);
63 
72 class FileDef : public DefinitionMutable, public Definition
73 {
74  public:
75  // ----------------------------------------------------------------------
76 
77  virtual DefType definitionType() const = 0;
78 
80  virtual QCString name() const = 0;
81  virtual QCString displayName(bool=TRUE) const = 0;
82  virtual QCString fileName() const = 0;
83 
84  virtual QCString getOutputFileBase() const = 0;
85 
86  virtual QCString anchor() const = 0;
87 
88  virtual QCString getSourceFileBase() const = 0;
89 
91  virtual QCString includeName() const = 0;
92 
93  virtual QCString includeDependencyGraphFileName() const = 0;
94 
95  virtual QCString includedByDependencyGraphFileName() const = 0;
96 
98  virtual QCString absFilePath() const = 0;
99 
101  virtual const QCString &docName() const = 0;
102 
104  virtual bool isSource() const = 0;
105 
106  virtual bool isDocumentationFile() const = 0;
107 
108  virtual const Definition *getSourceDefinition(int lineNr) const = 0;
109  virtual const MemberDef *getSourceMember(int lineNr) const = 0;
110 
112  virtual QCString getPath() const = 0;
113 
115  virtual QCString getVersion() const = 0;
116 
117  virtual bool isLinkableInProject() const = 0;
118 
119  virtual bool isLinkable() const = 0;
120  virtual bool isIncluded(const QCString &name) const = 0;
121 
122  virtual PackageDef *packageDef() const = 0;
123  virtual DirDef *getDirDef() const = 0;
124  virtual const LinkedRefMap<const NamespaceDef> &getUsedNamespaces() const = 0;
125  virtual const LinkedRefMap<const ClassDef> &getUsedClasses() const = 0;
126  virtual const IncludeInfoList &includeFileList() const = 0;
127  virtual const IncludeInfoList &includedByFileList() const = 0;
128  virtual void getAllIncludeFilesRecursively(StringVector &incFiles) const = 0;
129 
130  virtual MemberList *getMemberList(MemberListType lt) const = 0;
131  virtual const MemberLists &getMemberLists() const = 0;
132 
133  /* user defined member groups */
134  virtual const MemberGroupList &getMemberGroups() const = 0;
135  virtual const NamespaceLinkedRefMap &getNamespaces() const = 0;
136  virtual const ConceptLinkedRefMap &getConcepts() const = 0;
137  virtual const ClassLinkedRefMap &getClasses() const = 0;
138 
139  virtual QCString title() const = 0;
140  virtual bool hasDetailedDescription() const = 0;
141  virtual QCString fileVersion() const = 0;
142 
143  virtual bool subGrouping() const = 0;
144 
145  virtual void countMembers() = 0;
146  virtual int numDocMembers() const = 0;
147  virtual int numDecMembers() const = 0;
148 
149  //---------------------------------
150 
151  virtual void addSourceRef(int line,const Definition *d,const MemberDef *md) = 0;
152 
153  virtual void writeDocumentation(OutputList &ol) = 0;
154  virtual void writeMemberPages(OutputList &ol) = 0;
155  virtual void writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const = 0;
156  virtual void writeSummaryLinks(OutputList &ol) const = 0;
157  virtual void writeTagFile(TextStream &t) = 0;
158 
159  virtual void writeSourceHeader(OutputList &ol) = 0;
160  virtual void writeSourceBody(OutputList &ol,ClangTUParser *clangParser) = 0;
161  virtual void writeSourceFooter(OutputList &ol) = 0;
162  virtual void parseSource(ClangTUParser *clangParser) = 0;
163  virtual void setDiskName(const QCString &name) = 0;
164 
165  virtual void insertMember(MemberDef *md) = 0;
166  virtual void insertClass(const ClassDef *cd) = 0;
167  virtual void insertConcept(const ConceptDef *cd) = 0;
168  virtual void insertNamespace(const NamespaceDef *nd) = 0;
169  virtual void computeAnchors() = 0;
170 
171  virtual void setPackageDef(PackageDef *pd) = 0;
172  virtual void setDirDef(DirDef *dd) = 0;
173 
174  virtual void addUsingDirective(const NamespaceDef *nd) = 0;
175  virtual void addUsingDeclaration(const ClassDef *cd) = 0;
176  virtual void combineUsingRelations() = 0;
177 
178  virtual bool generateSourceFile() const = 0;
179  virtual void sortMemberLists() = 0;
180 
181  virtual void addIncludeDependency(const FileDef *fd,const QCString &incName,bool local,bool imported) = 0;
182  virtual void addIncludedByDependency(const FileDef *fd,const QCString &incName,bool local,bool imported) = 0;
183 
184  virtual void addMembersToMemberGroup() = 0;
185  virtual void distributeMemberGroupDocumentation() = 0;
186  virtual void findSectionsInDocumentation() = 0;
187  virtual void addIncludedUsingDirectives(FileDefSet &visitedFiles) = 0;
188 
189  virtual void addListReferences() = 0;
190 };
191 
192 FileDef *createFileDef(const QCString &p,const QCString &n,const QCString &ref=QCString(),const QCString &dn=QCString());
193 
194 
195 // --- Cast functions
196 
197 FileDef *toFileDef(Definition *d);
198 const FileDef *toFileDef(const Definition *d);
199 
200 // ------------------
201 
202 class FileList : public std::vector<const FileDef *>
203 {
204 };
205 
207 {
208  FilesInDir(const QCString &p) : path(p) {}
209  QCString path;
210  std::vector<const FileDef *> files;
211 };
212 
213 #endif
214 
The common base class of all entity definitions found in the sources.
Definition: definition.h:76
An abstract interface of a namespace symbol.
Definition: namespacedef.h:54
A model of a class/file/namespace member symbol.
Definition: memberdef.h:45
Text streaming class that buffers data.
Definition: textstream.h:34
A model of a file symbol.
Definition: filedef.h:72
Definition: conceptdef.h:69
Definition: namespacedef.h:45
Definition: filedef.h:206
Definition: membergroup.h:108
Definition: memberlist.h:138
Definition: definition.h:303
Definition: conceptdef.h:22
A model of a directory symbol.
Definition: dirdef.h:110
A list of MemberDef objects as shown in documentation sections.
Definition: memberlist.h:81
Definition: filedef.h:202
Class representing the data associated with a #include statement.
Definition: filedef.h:47
Class representing a list of output generators that are written to in parallel.
Definition: outputlist.h:37
DefType
Definition: definition.h:80
Definition: filedef.h:58
This is an alternative implementation of QCString.
Definition: qcstring.h:108
Definition: classlist.h:30
A abstract class representing of a compound symbol.
Definition: classdef.h:103
Clang parser object for a single translation unit, which consists of a source file and the directly o...
Definition: clangparser.h:21