Chameleon

Chameleon Svn Source Tree

Root/branches/xZenu/src/util/doxygen/src/dirdef.h

Source at commit 1322 created 9 years 5 months ago.
By meklort, Add doxygen to utils folder
1/******************************************************************************
2 *
3 * $Id: $
4 *
5 * Copyright (C) 1997-2011 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 DIRDEF_H
19#define DIRDEF_H
20
21#include "qtbc.h"
22#include "sortdict.h"
23#include "definition.h"
24
25#include <qlist.h>
26
27class FileList;
28class ClassSDict;
29class QStrList;
30class FileDef;
31class OutputList;
32class UsedDir;
33class FTextStream;
34
35class DirDef;
36
37/** A list of directories */
38class DirList : public QList<DirDef>
39{
40 public:
41 int compareItems(GCI item1,GCI item2);
42};
43
44/** A directory */
45class DirDef : public Definition
46{
47 public:
48 DirDef(const char *path);
49 virtual ~DirDef();
50
51 // accessors
52 virtual DefType definitionType() const { return TypeDir; }
53 virtual QCString getOutputFileBase() const;
54 virtual bool isLinkableInProject() const;
55 virtual bool isLinkable() const;
56 QCString displayName() const { return m_dispName; }
57 QCString shortName() const { return m_shortName; }
58 void addSubDir(DirDef *subdir);
59 FileList * getFiles() const { return m_fileList; }
60 void addFile(FileDef *fd);
61 const DirList &subDirs() const { return m_subdirs; }
62 bool isCluster() const { return m_subdirs.count()>0; }
63 int level() const { return m_level; }
64 DirDef *parent() const { return m_parent; }
65 int dirCount() const { return m_dirCount; }
66 const QDict<UsedDir> *usedDirs() const { return m_usedDirs; }
67 bool isParentOf(DirDef *dir) const;
68 bool depGraphIsTrivial() const;
69
70 // generate output
71 void writeDocumentation(OutputList &ol);
72 void writeDepGraph(FTextStream &t);
73
74 static DirDef *mergeDirectoryInTree(const QCString &path);
75 bool visited;
76
77 private:
78 friend void computeDirDependencies();
79
80 void writeDetailedDescription(OutputList &ol,const QCString &title);
81 void writeBriefDescription(OutputList &ol);
82 void writeDirectoryGraph(OutputList &ol);
83 void writeSubDirList(OutputList &ol);
84 void writeFileList(OutputList &ol);
85 void startMemberDeclarations(OutputList &ol);
86 void endMemberDeclarations(OutputList &ol);
87
88 void setLevel();
89 static DirDef *createNewDir(const char *path);
90 static bool matchPath(const QCString &path,QStrList &l);
91 void addUsesDependency(DirDef *usedDir,FileDef *srcFd,
92 FileDef *dstFd,bool inherited);
93 void computeDependencies();
94
95 DirList m_subdirs;
96 QCString m_dispName;
97 QCString m_shortName;
98 FileList *m_fileList; // list of files in the group
99 int m_dirCount;
100 int m_level;
101 DirDef *m_parent;
102 QDict<UsedDir> *m_usedDirs;
103};
104
105class FilePair
106{
107 public:
108 FilePair(FileDef *src,FileDef *dst) : m_src(src), m_dst(dst) {}
109 const FileDef *source() const { return m_src; }
110 const FileDef *destination() const { return m_dst; }
111 private:
112 FileDef *m_src;
113 FileDef *m_dst;
114};
115
116class FilePairDict : public SDict<FilePair>
117{
118 public:
119 FilePairDict(int size) : SDict<FilePair>(size) {}
120 int compareItems(GCI item1,GCI item2);
121};
122
123/** Usage information of a directory . */
124class UsedDir
125{
126 public:
127 UsedDir(DirDef *dir,bool inherited);
128 virtual ~UsedDir();
129 void addFileDep(FileDef *srcFd,FileDef *dstFd);
130 FilePair *findFilePair(const char *name);
131 const FilePairDict &filePairs() const { return m_filePairs; }
132 const DirDef *dir() const { return m_dir; }
133 bool inherited() const { return m_inherited; }
134
135 private:
136 DirDef *m_dir;
137 FilePairDict m_filePairs;
138 bool m_inherited;
139};
140
141/** A usage relation between two direction. */
142class DirRelation
143{
144 public:
145 DirRelation(const QCString &name,DirDef *src,UsedDir *dst)
146 : m_name(name), m_src(src), m_dst(dst) {}
147 DirDef *source() const { return m_src; }
148 UsedDir *destination() const { return m_dst; }
149 void writeDocumentation(OutputList &ol);
150 QCString getOutputFileBase() const { return m_name; }
151
152 private:
153 QCString m_name;
154 DirDef *m_src;
155 UsedDir *m_dst;
156};
157
158inline int DirList::compareItems(GCI item1,GCI item2)
159{
160 return stricmp(((DirDef *)item1)->shortName(),((DirDef *)item2)->shortName());
161}
162
163class DirSDict : public SDict<DirDef>
164{
165 public:
166 DirSDict(int size) : SDict<DirDef>(size) {}
167 int compareItems(GCI item1,GCI item2)
168 {
169 return stricmp(((DirDef *)item1)->shortName(),((DirDef *)item2)->shortName());
170 }
171};
172
173
174void buildDirectories();
175void generateDirDocs(OutputList &ol);
176void computeDirDependencies();
177void writeDirDependencyGraph(const char *file);
178
179#endif
180

Archive Download this file

Revision: 1322