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