paramhandler.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * $Id$
4  *
5  *
6  * Copyright (C) 1997-2015 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 #ifndef _PARAMHANDLER_H
17 #define _PARAMHANDLER_H
18 
19 #include <qstring.h>
20 #include <qlist.h>
21 #include <qxml.h>
22 #include <doxmlintf.h>
23 
24 #include "stringimpl.h"
25 #include "basehandler.h"
26 #include "baseiterator.h"
27 
28 class LinkedTextImpl;
29 class LinkedTextHandler;
30 class DocHandler;
31 
32 
33 class ParamHandler : public IParam, public BaseHandler<ParamHandler>
34 {
35  public:
36  virtual void startParam(const QXmlAttributes& attrib);
37  virtual void endParam();
38  virtual void startType(const QXmlAttributes& attrib);
39  virtual void endDeclName();
40  virtual void endDefName();
41  virtual void endAttrib();
42  virtual void endArray();
43  virtual void startDefVal(const QXmlAttributes& attrib);
44  virtual void startBriefDesc(const QXmlAttributes& attrib);
45 
47  virtual ~ParamHandler();
48 
49  // IParam
50  virtual ILinkedTextIterator *type() const;
51  virtual const IString * declarationName() const { return &m_declName; }
52  virtual const IString * definitionName() const { return &m_defName; }
53  virtual const IString * attrib() const { return &m_attrib; }
54  virtual const IString * arraySpecifier() const { return &m_array; }
55  virtual ILinkedTextIterator *defaultValue() const;
56  virtual IDocRoot *briefDescription() const;
57 
58  private:
59 
60  // XML elements:
61  // -------------
63  StringImpl m_declName; // declname
64  StringImpl m_defName; // defname
65  StringImpl m_array; // array
67  DocHandler *m_brief; // briefdescription
68 
69  StringImpl m_attrib; // TODO: not yet in XML output
70 
73 };
74 
75 class ParamIterator : public BaseIterator<IParamIterator,IParam,ParamHandler>
76 {
77  public:
80 };
81 
82 class TemplateParamListHandler : public BaseHandler<TemplateParamListHandler>
83 {
84  public:
85 
86  virtual void startParam(const QXmlAttributes& attrib);
87  virtual void endParam();
88 
89  virtual void startTemplateParamList(const QXmlAttributes& attrib);
90  virtual void endTemplateParamList();
91 
94 
95  ParamIterator* templateParams() { return new ParamIterator(m_templateParams); }
96 
97  protected:
100 };
101 
102 
103 #endif
virtual ILinkedTextIterator * defaultValue() const
Read only interface to a string.
Definition: doxmlintf.h:42
virtual void endArray()
LinkedTextHandler * m_linkedTextHandler
Definition: paramhandler.h:72
virtual void endDeclName()
virtual ~ParamHandler()
IBaseHandler * m_parent
Definition: paramhandler.h:71
virtual void endParam()
IBaseHandler * m_parent
Definition: paramhandler.h:98
virtual const IString * declarationName() const
Definition: paramhandler.h:51
StringImpl m_attrib
Definition: paramhandler.h:69
ParamIterator * templateParams()
Definition: paramhandler.h:95
DocHandler * m_brief
Definition: paramhandler.h:67
virtual void endDefName()
virtual ILinkedTextIterator * type() const
Node representing a documentation block.
Definition: dochandler.h:1315
virtual IDocRoot * briefDescription() const
StringImpl m_defName
Definition: paramhandler.h:64
virtual void startDefVal(const QXmlAttributes &attrib)
virtual void startBriefDesc(const QXmlAttributes &attrib)
virtual const IString * definitionName() const
Definition: paramhandler.h:52
StringImpl m_declName
Definition: paramhandler.h:63
Iterates over a list of ILinkedText fragments.
Definition: doxmlintf.h:97
virtual void startParam(const QXmlAttributes &attrib)
QList< LinkedTextImpl > m_type
Definition: paramhandler.h:62
virtual void endAttrib()
virtual void startType(const QXmlAttributes &attrib)
QList< LinkedTextImpl > m_defVal
Definition: paramhandler.h:66
QList< ParamHandler > m_templateParams
Definition: paramhandler.h:99
ParamHandler(IBaseHandler *parent)
Representation of a parameter of a function.
Definition: doxmlintf.h:110
The QXmlAttributes class provides XML attributes.
Definition: qxml.h:128
ParamIterator(const QList< ParamHandler > &list)
Definition: paramhandler.h:78
virtual const IString * attrib() const
Definition: paramhandler.h:53
virtual ~TemplateParamListHandler()
Definition: paramhandler.h:93
virtual const IString * arraySpecifier() const
Definition: paramhandler.h:54
StringImpl m_array
Definition: paramhandler.h:65
def parent(G, child, parent_type)
Definition: graph.py:67
The interface to the object model provided by the XML parser library.