1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
/******************************************************************************
*
* $Id$
*
* Copyright (C) 1997-1999 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
* granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
* All output generated with Doxygen is not covered by this license.
*
*/
#include <ctype.h>
#include "groupdef.h"
#include "classdef.h"
#include "filedef.h"
#include "classlist.h"
#include "outputlist.h"
#include "scanner.h"
#include "namespacedef.h"
#include "language.h"
#include "util.h"
GroupDef::GroupDef(const char *na,const char *t) : Definition(na)
{
fileList = new FileList;
classList = new ClassList;
// groupList = new GroupList;
// name = n;
if (t)
title = t;
else
{
title = na;
title.at(0)=toupper(title.at(0));
}
fileName = "group_"+nameToFile(na);
}
GroupDef::~GroupDef()
{
delete fileList;
delete classList;
// delete groupList;
}
void GroupDef::addFile(const FileDef *def)
{
fileList->append(def);
}
void GroupDef::addClass(const ClassDef *def)
{
classList->append(def);
}
void GroupDef::addNamespace(const NamespaceDef *def)
{
namespaceList->append(def);
}
//void GroupDef::addGroup(const GroupDef *def)
//{
// groupList->append(def);
//}
int GroupDef::countMembers() const
{
return fileList->count()+classList->count();
}
void GroupDef::writeDocumentation(OutputList &ol)
{
ol.disable(OutputGenerator::Man);
startFile(ol,fileName,title);
startTitle(ol);
ol.docify(title);
endTitle(ol,name());
//brief=brief.stripWhiteSpace();
//int bl=brief.length();
OutputList briefOutput(&ol);
if (!briefDescription().isEmpty())
{
parseDoc(briefOutput,name(),0,briefDescription());
ol+=briefOutput;
ol.writeString(" \n");
ol.disable(OutputGenerator::Latex);
ol.startTextLink(0,"details");
parseDoc(ol,0,0,theTranslator->trMore());
ol.enable(OutputGenerator::Latex);
}
if (fileList->count()>0)
{
ol.startMemberHeader();
parseDoc(ol,0,0,theTranslator->trFiles());
ol.endMemberHeader();
ol.startIndexList();
FileDef *fd=fileList->first();
while (fd)
{
ol.writeStartAnnoItem("file ",fd->diskName(),0,fd->name());
ol.writeEndAnnoItem(fd->name());
fd=fileList->next();
}
ol.endIndexList();
}
if (classList->count()>0)
{
ol.startMemberHeader();
parseDoc(ol,0,0,theTranslator->trCompounds());
ol.endMemberHeader();
ol.startIndexList();
ClassDef *cd=classList->first();
while (cd)
{
QString type;
switch (cd->compoundType())
{
case ClassDef::Class: type="class"; break;
case ClassDef::Struct: type="struct"; break;
case ClassDef::Union: type="union"; break;
}
ol.writeStartAnnoItem(type,cd->classFile(),0,cd->name());
ol.writeEndAnnoItem(cd->name());
cd=classList->next();
}
ol.endIndexList();
}
//int dl=doc.length();
//doc=doc.stripWhiteSpace();
if (!briefDescription().isEmpty() || !documentation().isEmpty())
{
ol.writeRuler();
ol.writeAnchor("details");
ol.startGroupHeader();
parseDoc(ol,0,0,theTranslator->trDetailedDescription());
ol.endGroupHeader();
// repeat brief description
if (!briefDescription().isEmpty())
{
ol+=briefOutput;
ol.newParagraph();
}
// write documentation
if (!documentation().isEmpty())
{
parseDoc(ol,name(),0,documentation()+"\n");
}
}
endFile(ol);
ol.enable(OutputGenerator::Man);
}
|