summaryrefslogtreecommitdiffstats
path: root/addon/doxmlparser
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2003-02-15 20:00:58 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2003-02-15 20:00:58 (GMT)
commitb0cbd5971eb11555a9ea3ab5c23f2b0b97279b4d (patch)
treed5ea8d453754a1b971fadd965b8949a3a3d0de9a /addon/doxmlparser
parent8fda55cdfe71d9e23407169499e918478161328d (diff)
downloadDoxygen-b0cbd5971eb11555a9ea3ab5c23f2b0b97279b4d.zip
Doxygen-b0cbd5971eb11555a9ea3ab5c23f2b0b97279b4d.tar.gz
Doxygen-b0cbd5971eb11555a9ea3ab5c23f2b0b97279b4d.tar.bz2
Release-1.3-rc3-20020215
Diffstat (limited to 'addon/doxmlparser')
-rw-r--r--addon/doxmlparser/include/doxmlintf.h6
-rw-r--r--addon/doxmlparser/src/doxmlintf.h6
-rw-r--r--addon/doxmlparser/src/sectionhandler.cpp14
-rw-r--r--addon/doxmlparser/src/sectionhandler.h11
-rw-r--r--addon/doxmlparser/test/main.cpp5
5 files changed, 41 insertions, 1 deletions
diff --git a/addon/doxmlparser/include/doxmlintf.h b/addon/doxmlparser/include/doxmlintf.h
index 481cb2f..3f7762c 100644
--- a/addon/doxmlparser/include/doxmlintf.h
+++ b/addon/doxmlparser/include/doxmlintf.h
@@ -727,6 +727,12 @@ class ISection
virtual bool isProtected() const = 0;
};
+class IUserDefined : public ISection
+{
+ public:
+ virtual const IString * header() const = 0;
+};
+
class ISectionIterator
{
public:
diff --git a/addon/doxmlparser/src/doxmlintf.h b/addon/doxmlparser/src/doxmlintf.h
index 481cb2f..3f7762c 100644
--- a/addon/doxmlparser/src/doxmlintf.h
+++ b/addon/doxmlparser/src/doxmlintf.h
@@ -727,6 +727,12 @@ class ISection
virtual bool isProtected() const = 0;
};
+class IUserDefined : public ISection
+{
+ public:
+ virtual const IString * header() const = 0;
+};
+
class ISectionIterator
{
public:
diff --git a/addon/doxmlparser/src/sectionhandler.cpp b/addon/doxmlparser/src/sectionhandler.cpp
index 1bbdf3c..5da0006 100644
--- a/addon/doxmlparser/src/sectionhandler.cpp
+++ b/addon/doxmlparser/src/sectionhandler.cpp
@@ -88,6 +88,8 @@ SectionHandler::SectionHandler(IBaseHandler *parent) : m_parent(parent)
m_members.setAutoDelete(TRUE);
addEndHandler("sectiondef",this,&SectionHandler::endSection);
addStartHandler("memberdef",this,&SectionHandler::startMember);
+ addStartHandler("header",this,&SectionHandler::startHeader);
+ addEndHandler("header",this,&SectionHandler::endHeader);
}
SectionHandler::~SectionHandler()
@@ -115,6 +117,18 @@ void SectionHandler::startMember(const QXmlAttributes& attrib)
m_members.append(memHandler);
}
+void SectionHandler::startHeader(const QXmlAttributes&)
+{
+ m_header="";
+ m_curString="";
+}
+
+void SectionHandler::endHeader()
+{
+ m_header = m_curString.stripWhiteSpace();
+ debug(2,"member header=`%s'\n",m_header.data());
+}
+
void SectionHandler::initialize(CompoundHandler *ch)
{
QListIterator<MemberHandler> mli(m_members);
diff --git a/addon/doxmlparser/src/sectionhandler.h b/addon/doxmlparser/src/sectionhandler.h
index 42d3340..b6b674f 100644
--- a/addon/doxmlparser/src/sectionhandler.h
+++ b/addon/doxmlparser/src/sectionhandler.h
@@ -34,12 +34,14 @@ class SectionIterator :
};
-class SectionHandler : public ISection, public BaseHandler<SectionHandler>
+class SectionHandler : public IUserDefined, public BaseHandler<SectionHandler>
{
public:
virtual void startMember(const QXmlAttributes& attrib);
+ virtual void startHeader(const QXmlAttributes& attrib);
virtual void startSection(const QXmlAttributes& attrib);
virtual void endSection();
+ virtual void endHeader();
SectionHandler(IBaseHandler *parent);
virtual ~SectionHandler();
@@ -73,10 +75,17 @@ class SectionHandler : public ISection, public BaseHandler<SectionHandler>
void initialize(CompoundHandler *c);
+ // IUserDefined implementation
+ virtual const IString *header() const
+ {
+ return &m_header;
+ }
+
private:
IBaseHandler *m_parent;
SectionKind m_kind;
StringImpl m_kindString;
+ StringImpl m_header;
QList<MemberHandler> m_members;
};
diff --git a/addon/doxmlparser/test/main.cpp b/addon/doxmlparser/test/main.cpp
index 4b8425c..c066a24 100644
--- a/addon/doxmlparser/test/main.cpp
+++ b/addon/doxmlparser/test/main.cpp
@@ -565,6 +565,11 @@ int main(int argc,char **argv)
printf(" Section kind=%s\n",sec->kindString()->latin1());
IMemberIterator *mli = sec->members();
IMember *mem;
+ if( sec->kind() == ISection::UserDefined )
+ {
+ IUserDefined *group = dynamic_cast<IUserDefined*>(sec);
+ printf(" Title=%s\n", group->header()->latin1() );
+ }
for (mli->toFirst();(mem=mli->current());mli->toNext())
{
ILinkedTextIterator *lti = mem->type();