summaryrefslogtreecommitdiffstats
path: root/addon
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2001-11-18 14:52:40 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2001-11-18 14:52:40 (GMT)
commitb89fdced7a88c9222faa0d646923bd09fb1765f8 (patch)
tree066b0bffed86445dbe3d494eaf31515f5b743e8c /addon
parentf11235dce05843401bccaae6dfcee8f65ac9da1d (diff)
downloadDoxygen-b89fdced7a88c9222faa0d646923bd09fb1765f8.zip
Doxygen-b89fdced7a88c9222faa0d646923bd09fb1765f8.tar.gz
Doxygen-b89fdced7a88c9222faa0d646923bd09fb1765f8.tar.bz2
Release-1.2.12
Diffstat (limited to 'addon')
-rw-r--r--addon/xmlparse/compoundhandler.cpp10
-rw-r--r--addon/xmlparse/compoundhandler.h24
-rw-r--r--addon/xmlparse/dochandler.cpp186
-rw-r--r--addon/xmlparse/dochandler.h102
-rw-r--r--addon/xmlparse/doxmlintf.h14
-rw-r--r--addon/xmlparse/mainhandler.cpp49
-rw-r--r--addon/xmlparse/mainhandler.h24
-rw-r--r--addon/xmlparse/memberhandler.cpp34
-rw-r--r--addon/xmlparse/memberhandler.h13
-rw-r--r--addon/xmlparse/sectionhandler.cpp12
-rw-r--r--addon/xmlparse/sectionhandler.h4
11 files changed, 359 insertions, 113 deletions
diff --git a/addon/xmlparse/compoundhandler.cpp b/addon/xmlparse/compoundhandler.cpp
index 0b22ef2..0b420bf 100644
--- a/addon/xmlparse/compoundhandler.cpp
+++ b/addon/xmlparse/compoundhandler.cpp
@@ -136,3 +136,13 @@ void CompoundHandler::addSubClass(const QXmlAttributes& attrib)
m_subClasses.append(sc);
}
+void CompoundHandler::initialize(MainHandler *m)
+{
+ QListIterator<ISection> msi(m_sections);
+ SectionHandler *sec;
+ for (;(sec=(SectionHandler *)msi.current());++msi)
+ {
+ sec->initialize(m);
+ }
+}
+
diff --git a/addon/xmlparse/compoundhandler.h b/addon/xmlparse/compoundhandler.h
index 5191a2f..51508aa 100644
--- a/addon/xmlparse/compoundhandler.h
+++ b/addon/xmlparse/compoundhandler.h
@@ -23,6 +23,7 @@
#include "sectionhandler.h"
#include "doxmlintf.h"
+class MainHandler;
class DocHandler;
class ProgramListingHandler;
@@ -48,6 +49,7 @@ class CompoundHandler : public ICompound, public BaseHandler<CompoundHandler>
QString id() const { return m_id; }
QString kind() const { return m_kind; }
QListIterator<ISection> getSectionIterator() const { return m_sections; }
+ void initialize(MainHandler *m);
private:
struct SuperClass
@@ -68,18 +70,18 @@ class CompoundHandler : public ICompound, public BaseHandler<CompoundHandler>
QString m_protection;
QString m_virtualness;
};
- QList<SuperClass> m_superClasses;
- QList<SubClass> m_subClasses;
- QList<ISection> m_sections;
- IBaseHandler *m_parent;
- DocHandler *m_brief;
- DocHandler *m_detailed;
+ QList<SuperClass> m_superClasses;
+ QList<SubClass> m_subClasses;
+ QList<ISection> m_sections;
+ IBaseHandler *m_parent;
+ DocHandler *m_brief;
+ DocHandler *m_detailed;
ProgramListingHandler *m_programListing;
- QString m_id;
- QString m_kind;
- QString m_name;
- QString m_defFile;
- int m_defLine;
+ QString m_id;
+ QString m_kind;
+ QString m_name;
+ QString m_defFile;
+ int m_defLine;
};
#endif
diff --git a/addon/xmlparse/dochandler.cpp b/addon/xmlparse/dochandler.cpp
index 5dff81a..80df132 100644
--- a/addon/xmlparse/dochandler.cpp
+++ b/addon/xmlparse/dochandler.cpp
@@ -745,55 +745,6 @@ void VariableListHandler::startListItem(const QXmlAttributes& attrib)
}
//----------------------------------------------------------------------
-// AnchorHandler
-//----------------------------------------------------------------------
-
-AnchorHandler::AnchorHandler(IBaseHandler *parent)
- : DocNode(Anchor), m_parent(parent)
-{
- m_children.setAutoDelete(TRUE);
- addEndHandler("anchor",this,&AnchorHandler::endAnchor);
- addStartHandler("ref",this,&AnchorHandler::startRef);
-}
-
-AnchorHandler::~AnchorHandler()
-{
-}
-
-void AnchorHandler::startAnchor(const QXmlAttributes& attrib)
-{
- m_id = attrib.value("id");
- m_curString="";
- m_parent->setDelegate(this);
-}
-
-void AnchorHandler::endAnchor()
-{
- addTextNode();
- printf("anchor id=`%s'\n",m_id.data());
- m_parent->setDelegate(0);
-}
-
-void AnchorHandler::startRef(const QXmlAttributes& attrib)
-{
- addTextNode();
- RefHandler *rh = new RefHandler(this);
- m_children.append(rh);
- rh->startRef(attrib);
-}
-
-void AnchorHandler::addTextNode()
-{
- if (!m_curString.isEmpty())
- {
- m_children.append(new TextNode(m_curString,DocNode::Normal));
- printf("addTextNode() text=\"%s\"\n",
- m_curString.data());
- m_curString="";
- }
-}
-
-//----------------------------------------------------------------------
// HighlightHandler
//----------------------------------------------------------------------
@@ -833,7 +784,7 @@ CodeLineHandler::CodeLineHandler(IBaseHandler *parent)
addEndHandler("linenumber",this,&CodeLineHandler::endLineNumber);
addStartHandler("highlight",this,&CodeLineHandler::startHighlight);
addStartHandler("ref",this,&CodeLineHandler::startRef);
- addStartHandler("anchor",this,&CodeLineHandler::startAnchor);
+ m_lineNumber = 0;
}
CodeLineHandler::~CodeLineHandler()
@@ -853,16 +804,16 @@ void CodeLineHandler::endCodeLine()
m_parent->setDelegate(0);
}
-void CodeLineHandler::startLineNumber(const QXmlAttributes& /*attrib*/)
+void CodeLineHandler::startLineNumber(const QXmlAttributes& attrib)
{
m_parent->setDelegate(this);
printf("start linenumber\n");
+ m_lineNumber = attrib.value("line").toInt();
+ m_refId = attrib.value("refid");
}
void CodeLineHandler::endLineNumber()
{
- addTextNode();
- printf("end linenumber\n");
m_parent->setDelegate(0);
}
@@ -874,14 +825,6 @@ void CodeLineHandler::startHighlight(const QXmlAttributes& attrib)
hlh->startHighlight(attrib);
}
-void CodeLineHandler::startAnchor(const QXmlAttributes& attrib)
-{
- addTextNode();
- AnchorHandler *ah = new AnchorHandler(this);
- m_children.append(ah);
- ah->startAnchor(attrib);
-}
-
void CodeLineHandler::startRef(const QXmlAttributes& attrib)
{
addTextNode();
@@ -1092,6 +1035,106 @@ void IndexEntryHandler::endSecondaryIE()
m_secondary = m_curString;
}
+//----------------------------------------------------------------------
+// EntryHandler
+//----------------------------------------------------------------------
+
+EntryHandler::EntryHandler(IBaseHandler *parent)
+ : DocNode(Entry), m_parent(parent)
+{
+ m_children.setAutoDelete(TRUE);
+ addEndHandler("entry",this,&EntryHandler::endEntry);
+ addStartHandler("para",this,&EntryHandler::startParagraph);
+}
+
+EntryHandler::~EntryHandler()
+{
+}
+
+void EntryHandler::startEntry(const QXmlAttributes&)
+{
+ m_parent->setDelegate(this);
+}
+
+void EntryHandler::endEntry()
+{
+ m_parent->setDelegate(0);
+}
+
+void EntryHandler::startParagraph(const QXmlAttributes& attrib)
+{
+ ParagraphHandler *ph = new ParagraphHandler(this);
+ ph->startParagraph(attrib);
+ m_children.append(ph);
+}
+
+//----------------------------------------------------------------------
+// RowHandler
+//----------------------------------------------------------------------
+
+RowHandler::RowHandler(IBaseHandler *parent)
+ : DocNode(Row), m_parent(parent)
+{
+ m_children.setAutoDelete(TRUE);
+ addEndHandler("row",this,&RowHandler::endRow);
+ addStartHandler("entry",this,&RowHandler::startEntry);
+}
+
+RowHandler::~RowHandler()
+{
+}
+
+void RowHandler::startRow(const QXmlAttributes&)
+{
+ m_parent->setDelegate(this);
+}
+
+void RowHandler::endRow()
+{
+ m_parent->setDelegate(0);
+}
+
+void RowHandler::startEntry(const QXmlAttributes& attrib)
+{
+ EntryHandler *eh = new EntryHandler(this);
+ eh->startEntry(attrib);
+ m_children.append(eh);
+}
+
+//----------------------------------------------------------------------
+// TableHandler
+//----------------------------------------------------------------------
+
+TableHandler::TableHandler(IBaseHandler *parent)
+ : DocNode(Table), m_parent(parent)
+{
+ m_children.setAutoDelete(TRUE);
+ addEndHandler("table",this,&TableHandler::endTable);
+ addStartHandler("row",this,&TableHandler::startRow);
+}
+
+TableHandler::~TableHandler()
+{
+}
+
+void TableHandler::startTable(const QXmlAttributes& attrib)
+{
+ m_parent->setDelegate(this);
+ m_numColumns = attrib.value("cols").toInt();
+ printf("table cols=%d\n",m_numColumns);
+}
+
+void TableHandler::endTable()
+{
+ m_parent->setDelegate(0);
+}
+
+void TableHandler::startRow(const QXmlAttributes& attrib)
+{
+ RowHandler *rh = new RowHandler(this);
+ rh->startRow(attrib);
+ m_children.append(rh);
+}
//----------------------------------------------------------------------
// ParagraphHandler
@@ -1123,6 +1166,7 @@ ParagraphHandler::ParagraphHandler(IBaseHandler *parent)
addStartHandler("image",this,&ParagraphHandler::startImage);
addStartHandler("dotfile",this,&ParagraphHandler::startDotFile);
addStartHandler("indexentry",this,&ParagraphHandler::startIndexEntry);
+ addStartHandler("table",this,&ParagraphHandler::startTable);
}
ParagraphHandler::~ParagraphHandler()
@@ -1177,6 +1221,7 @@ void ParagraphHandler::startSimpleSect(const QXmlAttributes& attrib)
void ParagraphHandler::startRef(const QXmlAttributes& attrib)
{
+ addTextNode();
RefHandler *ref = new RefHandler(this);
ref->startRef(attrib);
m_children.append(ref);
@@ -1184,6 +1229,7 @@ void ParagraphHandler::startRef(const QXmlAttributes& attrib)
void ParagraphHandler::startVariableList(const QXmlAttributes& attrib)
{
+ addTextNode();
VariableListHandler *vl = new VariableListHandler(this);
vl->startVariableList(attrib);
m_children.append(vl);
@@ -1191,6 +1237,7 @@ void ParagraphHandler::startVariableList(const QXmlAttributes& attrib)
void ParagraphHandler::startHRuler(const QXmlAttributes& attrib)
{
+ addTextNode();
HRulerHandler *hr = new HRulerHandler(this);
hr->startHRuler(attrib);
m_children.append(hr);
@@ -1198,6 +1245,7 @@ void ParagraphHandler::startHRuler(const QXmlAttributes& attrib)
void ParagraphHandler::startLineBreak(const QXmlAttributes& attrib)
{
+ addTextNode();
LineBreakHandler *lb = new LineBreakHandler(this);
lb->startLineBreak(attrib);
m_children.append(lb);
@@ -1205,6 +1253,7 @@ void ParagraphHandler::startLineBreak(const QXmlAttributes& attrib)
void ParagraphHandler::startULink(const QXmlAttributes& attrib)
{
+ addTextNode();
ULinkHandler *uh = new ULinkHandler(this);
uh->startULink(attrib);
m_children.append(uh);
@@ -1212,6 +1261,7 @@ void ParagraphHandler::startULink(const QXmlAttributes& attrib)
void ParagraphHandler::startEMail(const QXmlAttributes& attrib)
{
+ addTextNode();
EMailHandler *eh = new EMailHandler(this);
eh->startEMail(attrib);
m_children.append(eh);
@@ -1219,6 +1269,7 @@ void ParagraphHandler::startEMail(const QXmlAttributes& attrib)
void ParagraphHandler::startLink(const QXmlAttributes& attrib)
{
+ addTextNode();
LinkHandler *lh = new LinkHandler(this);
lh->startLink(attrib);
m_children.append(lh);
@@ -1226,6 +1277,7 @@ void ParagraphHandler::startLink(const QXmlAttributes& attrib)
void ParagraphHandler::startProgramListing(const QXmlAttributes& attrib)
{
+ addTextNode();
ProgramListingHandler *pl = new ProgramListingHandler(this);
pl->startProgramListing(attrib);
m_children.append(pl);
@@ -1233,6 +1285,7 @@ void ParagraphHandler::startProgramListing(const QXmlAttributes& attrib)
void ParagraphHandler::startFormula(const QXmlAttributes& attrib)
{
+ addTextNode();
FormulaHandler *fh = new FormulaHandler(this);
fh->startFormula(attrib);
m_children.append(fh);
@@ -1240,6 +1293,7 @@ void ParagraphHandler::startFormula(const QXmlAttributes& attrib)
void ParagraphHandler::startImage(const QXmlAttributes& attrib)
{
+ addTextNode();
ImageHandler *ih = new ImageHandler(this);
ih->startImage(attrib);
m_children.append(ih);
@@ -1247,6 +1301,7 @@ void ParagraphHandler::startImage(const QXmlAttributes& attrib)
void ParagraphHandler::startDotFile(const QXmlAttributes& attrib)
{
+ addTextNode();
DotFileHandler *df = new DotFileHandler(this);
df->startDotFile(attrib);
m_children.append(df);
@@ -1254,11 +1309,20 @@ void ParagraphHandler::startDotFile(const QXmlAttributes& attrib)
void ParagraphHandler::startIndexEntry(const QXmlAttributes& attrib)
{
+ addTextNode();
IndexEntryHandler *df = new IndexEntryHandler(this);
df->startIndexEntry(attrib);
m_children.append(df);
}
+void ParagraphHandler::startTable(const QXmlAttributes& attrib)
+{
+ addTextNode();
+ TableHandler *th = new TableHandler(this);
+ th->startTable(attrib);
+ m_children.append(th);
+}
+
void ParagraphHandler::addTextNode()
{
if (!m_curString.isEmpty())
diff --git a/addon/xmlparse/dochandler.h b/addon/xmlparse/dochandler.h
index a5b7b8c..1c599ca 100644
--- a/addon/xmlparse/dochandler.h
+++ b/addon/xmlparse/dochandler.h
@@ -70,7 +70,10 @@ class DocNode
Formula,
Image,
DotFile,
- IndexEntry
+ IndexEntry,
+ Table,
+ Row,
+ Entry
};
DocNode(NodeKind k) : m_kind(k) {}
virtual ~DocNode() {}
@@ -412,6 +415,9 @@ class SimpleSectHandler : public DocNode,
//-----------------------------------------------------------------------------
+/* \brief Node representing an named item of a VariableList.
+ *
+ */
class VariableListEntryHandler : public DocNode, public BaseHandler<VariableListEntryHandler>
{
public:
@@ -457,28 +463,6 @@ class VariableListHandler : public DocNode, public BaseHandler<VariableListHandl
//-----------------------------------------------------------------------------
-/*! \brief Node representing a text anchor
- *
- */
-// children: ref
-class AnchorHandler : public DocNode, public BaseHandler<AnchorHandler>
-{
- public:
- AnchorHandler(IBaseHandler *parent);
- virtual ~AnchorHandler();
- void startAnchor(const QXmlAttributes& attrib);
- void endAnchor();
- void startRef(const QXmlAttributes& attrib);
-
- private:
- void addTextNode();
- IBaseHandler *m_parent;
- QList<DocNode> m_children;
- QString m_id;
-};
-
-//-----------------------------------------------------------------------------
-
/*! \brief Node representing a highlighted text fragment.
*
*/
@@ -512,7 +496,6 @@ class CodeLineHandler : public DocNode, public BaseHandler<CodeLineHandler>
virtual void startLineNumber(const QXmlAttributes&);
virtual void endLineNumber();
virtual void startHighlight(const QXmlAttributes&);
- virtual void startAnchor(const QXmlAttributes&);
virtual void startRef(const QXmlAttributes&);
CodeLineHandler(IBaseHandler *parent);
@@ -523,8 +506,7 @@ class CodeLineHandler : public DocNode, public BaseHandler<CodeLineHandler>
IBaseHandler *m_parent;
int m_lineNumber;
- QString m_anchor;
- QString m_ref;
+ QString m_refId;
QList<DocNode> m_children;
};
@@ -636,18 +618,79 @@ class IndexEntryHandler : public DocNode, public BaseHandler<IndexEntryHandler>
//-----------------------------------------------------------------------------
+/*! \brief Node representing an entry in the table entry.
+ *
+ */
+// children: para
+class EntryHandler : public DocNode, public BaseHandler<EntryHandler>
+{
+ public:
+ EntryHandler(IBaseHandler *parent);
+ virtual ~EntryHandler();
+ void startEntry(const QXmlAttributes& attrib);
+ void endEntry();
+ void startParagraph(const QXmlAttributes& attrib);
+
+ private:
+ IBaseHandler *m_parent;
+ QList<DocNode> m_children;
+};
+
+//-----------------------------------------------------------------------------
+
+/*! \brief Node representing an entry in the table row.
+ *
+ */
+// children: entry
+class RowHandler : public DocNode, public BaseHandler<RowHandler>
+{
+ public:
+ RowHandler(IBaseHandler *parent);
+ virtual ~RowHandler();
+ void startRow(const QXmlAttributes& attrib);
+ void endRow();
+ void startEntry(const QXmlAttributes& attrib);
+
+ private:
+ IBaseHandler *m_parent;
+ QList<EntryHandler> m_children;
+};
+
+//-----------------------------------------------------------------------------
+
+/*! \brief Node representing an entry in the table.
+ *
+ */
+// children: row
+class TableHandler : public DocNode, public BaseHandler<TableHandler>
+{
+ public:
+ TableHandler(IBaseHandler *parent);
+ virtual ~TableHandler();
+ void startTable(const QXmlAttributes& attrib);
+ void endTable();
+ void startRow(const QXmlAttributes& attrib);
+
+ private:
+ IBaseHandler *m_parent;
+ QList<RowHandler> m_children;
+ int m_numColumns;
+};
+
+//-----------------------------------------------------------------------------
+
/*! \brief Node representing a paragraph of text and commands.
*
*/
// children: itemizedlist, orderedlist, parameterlist, simplesect, ref,
// variablelist, hruler, linebreak, ulink, email, link
-// programlisting, formula, image, dotfile, indexentry
+// programlisting, formula, image, dotfile, indexentry,
+// table
//
// children handled by MarkupHandler:
// bold, computeroutput, emphasis, center,
// small, subscript, superscript.
-// TODO:
-// table
+//
class ParagraphHandler : public DocNode, public BaseHandler<ParagraphHandler>
{
public:
@@ -669,6 +712,7 @@ class ParagraphHandler : public DocNode, public BaseHandler<ParagraphHandler>
virtual void startImage(const QXmlAttributes& attrib);
virtual void startDotFile(const QXmlAttributes& attrib);
virtual void startIndexEntry(const QXmlAttributes& attrib);
+ virtual void startTable(const QXmlAttributes& attrib);
ParagraphHandler(IBaseHandler *parent);
virtual ~ParagraphHandler();
diff --git a/addon/xmlparse/doxmlintf.h b/addon/xmlparse/doxmlintf.h
index 50acb79..cfff948 100644
--- a/addon/xmlparse/doxmlintf.h
+++ b/addon/xmlparse/doxmlintf.h
@@ -51,6 +51,20 @@ class IDoxygen
* of compounds found in the project.
*/
virtual QListIterator<ICompound> getCompoundIterator() const = 0;
+
+ /*! Returns a compound given its unique \a id. If you have a
+ * compound id this function is much more efficient than iterating
+ * over the compound list. Returns 0 if the id is not valid.
+ */
+ virtual ICompound *getCompoundById(const QString &id) const = 0;
+
+ /*! Returns a compound given its name (including the scope).
+ * Returns 0 if the name is not found in the project.
+ */
+ virtual ICompound *getCompoundByName(const QString &name) const = 0;
+
+ virtual IMember *getMemberById(const QString &id) const = 0;
+ virtual QList<IMember> *getMemberByName(const QString &name) const = 0;
};
/*! Factory method that creates an object model given an XML file generated
diff --git a/addon/xmlparse/mainhandler.cpp b/addon/xmlparse/mainhandler.cpp
index 21185e6..cb92df2 100644
--- a/addon/xmlparse/mainhandler.cpp
+++ b/addon/xmlparse/mainhandler.cpp
@@ -16,15 +16,7 @@
#include <qxml.h>
#include "mainhandler.h"
-void MainHandler::startCompound(const QXmlAttributes& attrib)
-{
- CompoundHandler *compHandler = new CompoundHandler(this);
- compHandler->startCompound(attrib);
- m_compounds.append(compHandler);
- m_compoundDict.insert(compHandler->id(),compHandler);
-}
-
-MainHandler::MainHandler() : m_compoundDict(10007)
+MainHandler::MainHandler() : m_compoundDict(10007), m_compoundNameDict(10007)
{
m_compounds.setAutoDelete(TRUE);
addStartHandler("doxygen");
@@ -38,6 +30,44 @@ MainHandler::~MainHandler()
printf("MainHandler::~MainHandler()\n");
}
+void MainHandler::startCompound(const QXmlAttributes& attrib)
+{
+ CompoundHandler *compHandler = new CompoundHandler(this);
+ compHandler->startCompound(attrib);
+ m_compounds.append(compHandler);
+}
+
+void MainHandler::insertMemberById(const QString &id,IMember *h)
+{
+ m_memberDict.insert(id,h);
+}
+
+void MainHandler::insertMemberByName(const QString &name,IMember *h)
+{
+ QList<IMember> *ml = m_memberNameDict[name];
+ if (ml)
+ {
+ ml->append(h);
+ }
+ else
+ {
+ ml = new QList<IMember>;
+ ml->append(h);
+ m_memberNameDict.insert(name,ml);
+ }
+}
+
+void MainHandler::initialize()
+{
+ QListIterator<ICompound> mci(m_compounds);
+ CompoundHandler *compHandler;
+ for (;(compHandler=(CompoundHandler *)mci.current());++mci)
+ {
+ compHandler->initialize(this);
+ m_compoundNameDict.insert(compHandler->name(),compHandler);
+ m_compoundDict.insert(compHandler->id(),compHandler);
+ }
+}
class ErrorHandler : public QXmlErrorHandler
{
@@ -74,6 +104,7 @@ IDoxygen *createObjectModelFromXML(const char * xmlFileName)
reader.setContentHandler( handler );
reader.setErrorHandler( &errorHandler );
reader.parse( source );
+ handler->initialize();
return handler;
}
diff --git a/addon/xmlparse/mainhandler.h b/addon/xmlparse/mainhandler.h
index 0d69f25..c5f945f 100644
--- a/addon/xmlparse/mainhandler.h
+++ b/addon/xmlparse/mainhandler.h
@@ -28,7 +28,6 @@ class MainHandler : public IDoxygen, public BaseHandler<MainHandler>
MainHandler();
virtual ~MainHandler();
- // IDoxygen
QListIterator<ICompound> getCompoundIterator() const
{
return m_compounds;
@@ -37,10 +36,29 @@ class MainHandler : public IDoxygen, public BaseHandler<MainHandler>
{
return m_compoundDict[id];
}
+ virtual ICompound *getCompoundByName(const QString &name) const
+ {
+ return name.isEmpty() ? 0 : m_compoundNameDict[name];
+ }
+ virtual IMember *getMemberById(const QString &id) const
+ {
+ return m_memberDict[id];
+ }
+ virtual QList<IMember> *getMemberByName(const QString &name) const
+ {
+ return m_memberNameDict[name];
+ }
+ void insertMemberById(const QString &id,IMember *h);
+ void insertMemberByName(const QString &name,IMember *h);
+
+ void initialize();
private:
- QList<ICompound> m_compounds;
- QDict<ICompound> m_compoundDict;
+ QList<ICompound> m_compounds;
+ QDict<ICompound> m_compoundDict;
+ QDict<ICompound> m_compoundNameDict;
+ QDict<IMember> m_memberDict;
+ QDict<QList<IMember> > m_memberNameDict;
};
#endif
diff --git a/addon/xmlparse/memberhandler.cpp b/addon/xmlparse/memberhandler.cpp
index cf29e05..54dd0f0 100644
--- a/addon/xmlparse/memberhandler.cpp
+++ b/addon/xmlparse/memberhandler.cpp
@@ -37,7 +37,15 @@ MemberHandler::MemberHandler(IBaseHandler *parent)
addStartHandler("location",this,&MemberHandler::startLocation);
addEndHandler("location");
+ addStartHandler("references",this,&MemberHandler::startReferences);
+ addEndHandler("references",this,&MemberHandler::endReferences);
+
+ addStartHandler("referencedby",this,&MemberHandler::startReferencedBy);
+ addEndHandler("referencedby",this,&MemberHandler::endReferencedBy);
+
m_params.setAutoDelete(TRUE);
+ m_references.setAutoDelete(TRUE);
+ m_referencedBy.setAutoDelete(TRUE);
}
@@ -78,6 +86,32 @@ void MemberHandler::startLocation(const QXmlAttributes& attrib)
m_defLine = attrib.value("line").toInt();
}
+void MemberHandler::startReferences(const QXmlAttributes& attrib)
+{
+ MemberReference *mr = new MemberReference;
+ mr->m_memId = attrib.value("id");
+ m_references.append(mr);
+ m_curString="";
+}
+
+void MemberHandler::endReferences()
+{
+ m_references.getLast()->m_name = m_curString;
+}
+
+void MemberHandler::startReferencedBy(const QXmlAttributes& attrib)
+{
+ MemberReference *mr = new MemberReference;
+ mr->m_memId = attrib.value("id");
+ m_referencedBy.append(mr);
+ m_curString="";
+}
+
+void MemberHandler::endReferencedBy()
+{
+ m_referencedBy.getLast()->m_name = m_curString;
+}
+
void MemberHandler::endMember()
{
m_parent->setDelegate(0);
diff --git a/addon/xmlparse/memberhandler.h b/addon/xmlparse/memberhandler.h
index 0b017e5..e79835f 100644
--- a/addon/xmlparse/memberhandler.h
+++ b/addon/xmlparse/memberhandler.h
@@ -37,6 +37,10 @@ class MemberHandler : public IMember, public BaseHandler<MemberHandler>
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();
MemberHandler(IBaseHandler *parent);
virtual ~MemberHandler();
@@ -51,6 +55,13 @@ class MemberHandler : public IMember, public BaseHandler<MemberHandler>
virtual QListIterator<IParam> getParamIterator() const { return m_params; }
private:
+ struct MemberReference
+ {
+ QString m_memId;
+ QString m_name;
+ int line;
+ };
+
IBaseHandler *m_parent;
QString m_kind;
QString m_id;
@@ -61,6 +72,8 @@ class MemberHandler : public IMember, public BaseHandler<MemberHandler>
DocHandler *m_brief;
DocHandler *m_detailed;
QList<IParam> m_params;
+ QList<MemberReference> m_references;
+ QList<MemberReference> m_referencedBy;
QString m_defFile;
int m_defLine;
};
diff --git a/addon/xmlparse/sectionhandler.cpp b/addon/xmlparse/sectionhandler.cpp
index 80db178..0fc3446 100644
--- a/addon/xmlparse/sectionhandler.cpp
+++ b/addon/xmlparse/sectionhandler.cpp
@@ -13,6 +13,7 @@
*
*/
+#include "mainhandler.h"
#include "compoundhandler.h"
#include "sectionhandler.h"
@@ -46,4 +47,15 @@ void SectionHandler::startMember(const QXmlAttributes& attrib)
m_members.append(memHandler);
}
+void SectionHandler::initialize(MainHandler *m)
+{
+ QListIterator<IMember> mli(m_members);
+ MemberHandler *mh;
+ for (;(mh=(MemberHandler *)mli.current());++mli)
+ {
+ m->insertMemberById(mh->name(),mh);
+ m->insertMemberByName(mh->name(),mh);
+ }
+}
+
diff --git a/addon/xmlparse/sectionhandler.h b/addon/xmlparse/sectionhandler.h
index 1231214..46cb422 100644
--- a/addon/xmlparse/sectionhandler.h
+++ b/addon/xmlparse/sectionhandler.h
@@ -24,6 +24,8 @@
#include "memberhandler.h"
#include "doxmlintf.h"
+class MainHandler;
+
class SectionHandler : public ISection, public BaseHandler<SectionHandler>
{
public:
@@ -38,6 +40,8 @@ class SectionHandler : public ISection, public BaseHandler<SectionHandler>
virtual QString kind() const { return m_kind; }
virtual QListIterator<IMember> getMemberIterator() const { return m_members; }
+ void initialize(MainHandler *m);
+
private:
IBaseHandler *m_parent;
QString m_kind;