Chameleon

Chameleon Svn Source Tree

Root/branches/xZenu/src/util/doxygen/addon/doxmlparser/src/paramhandler.cpp

Source at commit 1322 created 9 years 5 months ago.
By meklort, Add doxygen to utils folder
1/******************************************************************************
2 *
3 * $Id: $
4 *
5 *
6 * Copyright (C) 1997-2006 by Dimitri van Heesch.
7 *
8 * Permission to use, copy, modify, and distribute this software and its
9 * documentation under the terms of the GNU General Public License is hereby
10 * granted. No representations are made about the suitability of this software
11 * for any purpose. It is provided "as is" without express or implied warranty.
12 * See the GNU General Public License for more details.
13 *
14 */
15
16#include "paramhandler.h"
17#include "memberhandler.h"
18#include "linkedtexthandler.h"
19#include "debug.h"
20#include "dochandler.h"
21
22TemplateParamListHandler::TemplateParamListHandler(IBaseHandler *parent) : m_parent(parent)
23{
24 addStartHandler("param",this,&TemplateParamListHandler::startParam);
25
26 addEndHandler("templateparamlist",this,&TemplateParamListHandler::endTemplateParamList);
27}
28
29void TemplateParamListHandler::startParam(const QXmlAttributes& attrib)
30{
31 ParamHandler *ph = new ParamHandler(this);
32 ph->startParam(attrib);
33 m_templateParams.append(ph);
34}
35
36void TemplateParamListHandler::endParam()
37{
38}
39
40void TemplateParamListHandler::startTemplateParamList(const QXmlAttributes& /*attrib*/)
41{
42 m_parent->setDelegate(this);
43 debug(2,"templateparamlist\n");
44}
45
46void TemplateParamListHandler::endTemplateParamList()
47{
48 m_parent->setDelegate(0);
49}
50
51///////////////////////////////////////////////////////////////////////////////////////////////////////
52
53ParamHandler::ParamHandler(IBaseHandler *parent) : m_brief(0), m_parent(parent)
54{
55 addEndHandler("param",this,&ParamHandler::endParam);
56
57 addStartHandler("type",this,&ParamHandler::startType);
58
59 addStartHandler("declname");
60 addEndHandler("declname",this,&ParamHandler::endDeclName);
61
62 addStartHandler("defname");
63 addEndHandler("defname",this,&ParamHandler::endDefName);
64
65 addStartHandler("array");
66 addEndHandler("array",this,&ParamHandler::endArray);
67
68 addStartHandler("attribute");
69 addEndHandler("attribute",this,&ParamHandler::endAttrib);
70
71 addStartHandler("briefdescription",this,&ParamHandler::startBriefDesc);
72
73 addStartHandler("defval",this,&ParamHandler::startDefVal);
74
75 m_linkedTextHandler = 0;
76}
77
78ParamHandler::~ParamHandler()
79{
80 delete m_brief;
81 delete m_linkedTextHandler;
82}
83
84void ParamHandler::startParam(const QXmlAttributes& /*attrib*/)
85{
86 m_parent->setDelegate(this);
87 debug(2,"param\n");
88}
89
90void ParamHandler::endParam()
91{
92 m_parent->setDelegate(0);
93}
94
95void ParamHandler::startType(const QXmlAttributes& /*attrib*/)
96{
97 delete m_linkedTextHandler;
98 m_linkedTextHandler = new LinkedTextHandler(this,m_type);
99 m_linkedTextHandler->start("type");
100 debug(2,"param type\n");
101}
102
103void ParamHandler::endDeclName()
104{
105 m_declName = m_curString.stripWhiteSpace();
106 debug(2,"member declName=`%s'\n",m_declName.data());
107}
108
109void ParamHandler::endDefName()
110{
111 m_defName = m_curString.stripWhiteSpace();
112 debug(2,"member defName=`%s'\n",m_defName.data());
113}
114
115void ParamHandler::endAttrib()
116{
117 m_attrib = m_curString.stripWhiteSpace();
118 debug(2,"member attrib=`%s'\n",m_attrib.data());
119}
120
121void ParamHandler::endArray()
122{
123 m_array = m_curString.stripWhiteSpace();
124 debug(2,"member array=`%s'\n",m_array.data());
125}
126
127void ParamHandler::startDefVal(const QXmlAttributes& /*attrib*/)
128{
129 delete m_linkedTextHandler;
130 m_linkedTextHandler = new LinkedTextHandler(this,m_defVal);
131 m_linkedTextHandler->start("defval");
132 debug(2,"member defVal\n");
133}
134
135void ParamHandler::startBriefDesc(const QXmlAttributes& attrib)
136{
137 DocHandler *docHandler = new DocHandler(this);
138 docHandler->startDoc(attrib);
139 m_brief = docHandler;
140}
141
142ILinkedTextIterator *ParamHandler::type() const
143{
144 return new LinkedTextIterator(m_type);
145}
146
147ILinkedTextIterator *ParamHandler::defaultValue() const
148{
149 return new LinkedTextIterator(m_defVal);
150}
151
152IDocRoot *ParamHandler::briefDescription() const
153{
154 return m_brief;
155}
156
157
158
159

Archive Download this file

Revision: 1322