diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2001-11-25 18:56:18 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2001-11-25 18:56:18 (GMT) |
commit | cce8b9505201c95443798341d3d6176922db9253 (patch) | |
tree | 6643370adedf0cbaac88d674978bd44175ab1475 /addon | |
parent | c736b03f16a88b6654ff9c1ae680e46b86e50218 (diff) | |
download | Doxygen-cce8b9505201c95443798341d3d6176922db9253.zip Doxygen-cce8b9505201c95443798341d3d6176922db9253.tar.gz Doxygen-cce8b9505201c95443798341d3d6176922db9253.tar.bz2 |
Release-1.2.12-20011125
Diffstat (limited to 'addon')
-rw-r--r-- | addon/xmlparse/doxmlintf.h | 10 | ||||
-rw-r--r-- | addon/xmlparse/mainhandler.cpp | 14 | ||||
-rw-r--r-- | addon/xmlparse/memberhandler.cpp | 21 | ||||
-rw-r--r-- | addon/xmlparse/memberhandler.h | 18 |
4 files changed, 59 insertions, 4 deletions
diff --git a/addon/xmlparse/doxmlintf.h b/addon/xmlparse/doxmlintf.h index cfff948..1af6a60 100644 --- a/addon/xmlparse/doxmlintf.h +++ b/addon/xmlparse/doxmlintf.h @@ -4,6 +4,8 @@ #include <qlist.h> #include <qstring.h> +class IMember; + class IParam { public: @@ -15,6 +17,14 @@ class IParam virtual QString defaultValue() const = 0; }; +class IMemberReference +{ + public: + virtual IMember *getMember() const = 0; + virtual QString getMemberName() const = 0; + virtual int getLineNumber() const = 0; +}; + class IMember { public: diff --git a/addon/xmlparse/mainhandler.cpp b/addon/xmlparse/mainhandler.cpp index cb92df2..c32426f 100644 --- a/addon/xmlparse/mainhandler.cpp +++ b/addon/xmlparse/mainhandler.cpp @@ -67,6 +67,20 @@ void MainHandler::initialize() m_compoundNameDict.insert(compHandler->name(),compHandler); m_compoundDict.insert(compHandler->id(),compHandler); } + + // for each member + QDictIterator< QList<IMember> > mndi(m_memberNameDict); + QList<IMember> *ml; + for (;(ml=mndi.current());++mndi) + { + QListIterator<IMember> mli(*ml); + IMember *mem; + for (;(mem=mli.current());++mli) + { + ((MemberHandler*)mem)->initialize(this); + } + } + } class ErrorHandler : public QXmlErrorHandler diff --git a/addon/xmlparse/memberhandler.cpp b/addon/xmlparse/memberhandler.cpp index 54dd0f0..0fbf5c1 100644 --- a/addon/xmlparse/memberhandler.cpp +++ b/addon/xmlparse/memberhandler.cpp @@ -16,6 +16,7 @@ #include "memberhandler.h" #include "sectionhandler.h" #include "dochandler.h" +#include "mainhandler.h" MemberHandler::MemberHandler(IBaseHandler *parent) : m_parent(parent), m_brief(0), m_detailed(0) @@ -90,6 +91,7 @@ void MemberHandler::startReferences(const QXmlAttributes& attrib) { MemberReference *mr = new MemberReference; mr->m_memId = attrib.value("id"); + mr->m_line = attrib.value("line").toInt(); m_references.append(mr); m_curString=""; } @@ -103,6 +105,7 @@ void MemberHandler::startReferencedBy(const QXmlAttributes& attrib) { MemberReference *mr = new MemberReference; mr->m_memId = attrib.value("id"); + mr->m_line = attrib.value("line").toInt(); m_referencedBy.append(mr); m_curString=""; } @@ -136,4 +139,22 @@ void MemberHandler::startParam(const QXmlAttributes& attrib) m_params.append(paramHandler); } +void MemberHandler::initialize(MainHandler *mh) +{ + QListIterator<MemberReference> mli(m_references); + MemberReference *mr; + for (;(mr=mli.current());++mli) + { + mr->initialize(mh); + } +} +void MemberHandler::MemberReference::initialize(MainHandler *mh) +{ + m_mainHandler = mh; +} + +IMember *MemberHandler::MemberReference::getMember() const +{ + return m_mainHandler->getMemberById(m_memId); +} diff --git a/addon/xmlparse/memberhandler.h b/addon/xmlparse/memberhandler.h index e79835f..ccb4a57 100644 --- a/addon/xmlparse/memberhandler.h +++ b/addon/xmlparse/memberhandler.h @@ -25,6 +25,7 @@ #include "doxmlintf.h" class DocHandler; +class MainHandler; class MemberHandler : public IMember, public BaseHandler<MemberHandler> { @@ -54,12 +55,21 @@ class MemberHandler : public IMember, public BaseHandler<MemberHandler> virtual QString name() const { return m_name; } virtual QListIterator<IParam> getParamIterator() const { return m_params; } + void initialize(MainHandler *m); + private: - struct MemberReference + struct MemberReference : public IMemberReference { - QString m_memId; - QString m_name; - int line; + virtual ~MemberReference() {} + virtual IMember *getMember() const; + virtual QString getMemberName() const { return m_name; } + virtual int getLineNumber() const { return m_line; } + void initialize(MainHandler *m); + + QString m_memId; + QString m_name; + int m_line; + MainHandler *m_mainHandler; }; IBaseHandler *m_parent; |