mainhandler.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 _MAINHANDLER_H
17 #define _MAINHANDLER_H
18 
19 #include <qlist.h>
20 
21 #include <doxmlintf.h>
22 #include "basehandler.h"
23 
24 class CompoundHandler;
25 struct CompoundEntry;
26 
27 struct IndexEntry
28 {
31 };
32 
33 struct MemberEntry : public IndexEntry
34 {
36 };
37 
38 struct CompoundEntry : public IndexEntry
39 {
40  CompoundEntry(int size) : memberDict(size)
41  { memberDict.setAutoDelete(TRUE); }
42  QDict<MemberEntry> memberDict;
43 };
44 
45 class MainHandler : public IDoxygen, public BaseHandler<MainHandler>
46 {
47  public:
48  virtual void startCompound(const QXmlAttributes& attrib);
49  virtual void startMember(const QXmlAttributes& attrib);
50  virtual void endMember();
51  virtual void startName(const QXmlAttributes& attrib);
52  virtual void endName();
53  MainHandler();
54  virtual ~MainHandler();
55 
56  // IDoxygen
57  ICompoundIterator *compounds() const;
58  ICompound *compoundById(const char *id) const;
59  virtual ICompound *compoundByName(const char *name) const;
60  virtual ICompound *memberById(const char *id) const;
61  virtual ICompoundIterator *memberByName(const char *name) const;
62 
63  virtual void release();
64  void setDebugLevel(int level);
65  bool readXMLDir(const char *dirName);
66  void dump();
67  void unloadCompound(CompoundHandler *ch);
68 
69  private:
73  QDict<CompoundEntry> m_compoundDict;
74  QDict<CompoundEntry> m_compoundNameDict;
75  QDict<MemberEntry> m_memberDict;
76  QDict<QList<CompoundEntry> > m_memberNameDict;
78  QDict<CompoundHandler> m_compoundsLoaded;
80 };
81 
82 #endif
CompoundEntry * m_curCompound
Definition: mainhandler.h:70
QDict< MemberEntry > memberDict
Definition: mainhandler.h:42
void setDebugLevel(int level)
Definition: debug.cpp:20
The QString class provides an abstraction of Unicode text and the classic C null-terminated char arra...
Definition: qstring.h:350
CompoundEntry * compound
Definition: mainhandler.h:35
QDict< MemberEntry > m_memberDict
Definition: mainhandler.h:75
bool m_insideMember
Definition: mainhandler.h:79
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
MemberEntry * m_curMember
Definition: mainhandler.h:71
QString name
Definition: mainhandler.h:30
def dump(input_file, output_file)
Definition: dumpTree.py:102
CompoundEntry(int size)
Definition: mainhandler.h:40
QDict< CompoundEntry > m_compoundNameDict
Definition: mainhandler.h:74
The interface to a compound in the object model.
Definition: doxmlintf.h:868
string release
Definition: conf.py:24
QList< CompoundEntry > m_compounds
Definition: mainhandler.h:72
QDict< CompoundHandler > m_compoundsLoaded
Definition: mainhandler.h:78
QDict< CompoundEntry > m_compoundDict
Definition: mainhandler.h:73
The QXmlAttributes class provides XML attributes.
Definition: qxml.h:128
QString id
Definition: mainhandler.h:29
QDict< QList< CompoundEntry > > m_memberNameDict
Definition: mainhandler.h:76
QString m_xmlDirName
Definition: mainhandler.h:77
const bool TRUE
Definition: qglobal.h:371
The interface to the object model provided by the XML parser library.