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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
|
/******************************************************************************
*
* $Id$
*
*
* Copyright (C) 1997-2002 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.
*
*/
#ifndef _MEMBERHANDLER_H
#define _MEMBERHANDLER_H
#include <qstring.h>
#include <qlist.h>
#include <qxml.h>
#include <doxmlintf.h>
#include "basehandler.h"
#include "baseiterator.h"
#include "paramhandler.h"
#include "linkedtexthandler.h"
#include "dochandler.h"
class MainHandler;
class CompoundHandler;
class SectionHandler;
struct MemberReference : public IMemberReference
{
virtual ~MemberReference() {}
virtual IMember *member() const;
virtual const IString *memberName() const { return &m_name; }
void initialize(MainHandler *m);
QString m_memId;
StringImpl m_name;
MainHandler *m_mainHandler;
};
class MemberReferenceIterator : public BaseIterator<IMemberReferenceIterator,IMemberReference,MemberReference>
{
public:
MemberReferenceIterator(const QList<MemberReference> &list) :
BaseIterator<IMemberReferenceIterator,IMemberReference,MemberReference>(list) {}
};
class EnumValueHandler : public IEnumValue, public BaseHandler<EnumValueHandler>
{
public:
virtual void startName(const QXmlAttributes& attrib);
virtual void endName();
virtual void startInitializer(const QXmlAttributes& attrib);
virtual void endInitializer();
virtual void startEnumValue(const QXmlAttributes& attrib);
virtual void endEnumValue();
// IEnumValue
virtual const IString *name() const { return &m_name; }
virtual const IString *initializer() const { return &m_initializer; }
void setName(const QString &name) { m_name=name; }
void setInitializer(const QString &init) { m_initializer=init; }
virtual ~EnumValueHandler() {}
EnumValueHandler(IBaseHandler *parent);
private:
StringImpl m_name;
StringImpl m_initializer;
IBaseHandler *m_parent;
};
class EnumValueIterator : public BaseIterator<IEnumValueIterator,IEnumValue,EnumValueHandler>
{
public:
EnumValueIterator(const QList<EnumValueHandler> &list) :
BaseIterator<IEnumValueIterator,IEnumValue,EnumValueHandler>(list) {}
};
class MemberHandler : public IMember, public BaseHandler<MemberHandler>
{
public:
virtual void startMember(const QXmlAttributes& attrib);
virtual void endMember();
virtual void startParam(const QXmlAttributes& attrib);
virtual void startType(const QXmlAttributes& attrib);
virtual void endName();
virtual void startBriefDesc(const QXmlAttributes& attrib);
virtual void startDetailedDesc(const QXmlAttributes& attrib);
virtual void startLocation(const QXmlAttributes& attrib);
virtual void startReferences(const QXmlAttributes& attrib);
virtual void endReferences();
virtual void startReferencedBy(const QXmlAttributes& attrib);
virtual void endReferencedBy();
virtual void startReimplements(const QXmlAttributes& attrib);
virtual void endReimplements();
virtual void startReimplementedBy(const QXmlAttributes& attrib);
virtual void endReimplementedBy();
virtual void startInitializer(const QXmlAttributes& attrib);
virtual void startException(const QXmlAttributes& attrib);
virtual void startEnumValue(const QXmlAttributes& attrib);
virtual void startTemplateParamList(const QXmlAttributes &attrib);
virtual void endTemplateParamList();
MemberHandler(IBaseHandler *parent);
virtual ~MemberHandler();
// IMember implementation
virtual ICompound *compound() const;
virtual ISection *section() const;
virtual MemberKind kind() const
{ return m_kind; }
virtual const IString *kindString() const
{ return &m_kindString; }
virtual const IString *id() const
{ return &m_id; }
virtual const IString *protection() const
{ return &m_protection; }
virtual const IString *virtualness() const
{ return &m_virtualness; }
virtual const IString *name() const
{ return &m_name; }
virtual bool isConst() const
{ return m_isConst; }
virtual bool isVolatile() const
{ return m_isVolatile; }
virtual ILinkedTextIterator *type() const
{ return new LinkedTextIterator(m_type); }
virtual const IString *typeString() const
{ MemberHandler *that = (MemberHandler *)this;
that->m_typeString = LinkedTextHandler::toString(m_type);
return &m_typeString;
}
virtual IParamIterator *parameters() const
{ return new ParamIterator(m_params); }
virtual IParamIterator *templateParameters() const
{ return m_hasTemplateParamList ? new ParamIterator(m_templateParams) : 0; }
virtual IMemberReferenceIterator *references() const
{ return new MemberReferenceIterator(m_references); }
virtual IMemberReferenceIterator *referencedBy() const
{ return new MemberReferenceIterator(m_referencedBy); }
virtual ILinkedTextIterator *initializer() const
{ return new LinkedTextIterator(m_initializer); }
virtual ILinkedTextIterator *exceptions() const
{ return new LinkedTextIterator(m_exception); }
virtual int bodyStart() const
{ return m_bodyStart; }
virtual int bodyEnd() const
{ return m_bodyEnd; }
virtual const IString *definitionFile() const
{ return &m_defFile; }
virtual int definitionLine() const
{ return m_defLine; }
virtual IMemberReference *reimplements() const
{ return m_reimplements; }
virtual IMemberReferenceIterator *reimplementedBy() const
{ return new MemberReferenceIterator(m_reimplementedBy); }
virtual IEnumValueIterator *enumValues() const
{ return new EnumValueIterator(m_enumValues); }
virtual IDocRoot *briefDescription() const
{ return m_brief; }
virtual IDocRoot *detailedDescription() const
{ return m_detailed; }
void initialize(MainHandler *m);
void setCompoundHandler(CompoundHandler *c);
void setSectionHandler(SectionHandler *s);
private:
IBaseHandler *m_parent;
CompoundHandler *m_compound;
SectionHandler *m_section;
MemberKind m_kind;
StringImpl m_kindString;
StringImpl m_id;
StringImpl m_protection;
StringImpl m_virtualness;
StringImpl m_typeString;
QList<LinkedTextImpl> m_type;
QList<LinkedTextImpl> m_initializer;
QList<LinkedTextImpl> m_exception;
StringImpl m_name;
DocHandler *m_brief;
DocHandler *m_detailed;
QList<ParamHandler> m_params;
QList<ParamHandler> m_templateParams;
QList<MemberReference> m_references;
QList<MemberReference> m_referencedBy;
MemberReference *m_reimplements;
QList<MemberReference> m_reimplementedBy;
StringImpl m_defFile;
int m_defLine;
int m_bodyStart;
int m_bodyEnd;
bool m_isConst;
bool m_isVolatile;
LinkedTextHandler *m_linkedTextHandler;
QList<EnumValueHandler> m_enumValues;
bool m_insideTemplateParamList;
bool m_hasTemplateParamList;
};
class MemberIterator : public BaseIterator<IMemberIterator,IMember,MemberHandler>
{
public:
MemberIterator(const QList<MemberHandler> &list) :
BaseIterator<IMemberIterator,IMember,MemberHandler>(list) {}
};
void memberhandler_init();
void memberhandler_exit();
#endif
|