summaryrefslogtreecommitdiffstats
path: root/addon/doxmlparser/src/graphhandler.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2002-03-10 16:02:35 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2002-03-10 16:02:35 (GMT)
commit5e4af367aa86722cd1545657727247d9008e9a16 (patch)
tree6db5f7392588f3b8c9d05ab7d2651803bc00c4c1 /addon/doxmlparser/src/graphhandler.cpp
parent837e4e86e7d2735cd7106efec6e4512db82d5e7a (diff)
downloadDoxygen-5e4af367aa86722cd1545657727247d9008e9a16.zip
Doxygen-5e4af367aa86722cd1545657727247d9008e9a16.tar.gz
Doxygen-5e4af367aa86722cd1545657727247d9008e9a16.tar.bz2
Release-1.2.14-20020310
Diffstat (limited to 'addon/doxmlparser/src/graphhandler.cpp')
-rw-r--r--addon/doxmlparser/src/graphhandler.cpp86
1 files changed, 86 insertions, 0 deletions
diff --git a/addon/doxmlparser/src/graphhandler.cpp b/addon/doxmlparser/src/graphhandler.cpp
new file mode 100644
index 0000000..9c822de
--- /dev/null
+++ b/addon/doxmlparser/src/graphhandler.cpp
@@ -0,0 +1,86 @@
+#include "graphhandler.h"
+
+GraphHandler::GraphHandler(IBaseHandler *parent,const char *endTag)
+ : m_parent(parent)
+{
+ addEndHandler(endTag,this,&GraphHandler::endGraph);
+ addStartHandler("node",this,&GraphHandler::startNode);
+ m_nodes.setAutoDelete(TRUE);
+}
+
+GraphHandler::~GraphHandler()
+{
+}
+
+void GraphHandler::startGraph(const QXmlAttributes &)
+{
+ m_parent->setDelegate(this);
+}
+
+void GraphHandler::endGraph()
+{
+ m_parent->setDelegate(0);
+}
+
+void GraphHandler::startNode(const QXmlAttributes &attrib)
+{
+ NodeHandler *n = new NodeHandler(this);
+ n->startNode(attrib);
+ m_nodes.append(n);
+}
+
+INodeIterator *GraphHandler::nodes() const
+{
+ return new NodeIterator(*this);
+}
+
+//------------------------------------------------------------------------
+
+NodeHandler::NodeHandler(IBaseHandler *parent)
+ : m_parent(parent)
+{
+ addEndHandler("node",this,&NodeHandler::endNode);
+ addStartHandler("link",this,&NodeHandler::startLink);
+ addEndHandler("link",this,&NodeHandler::endLink);
+ addStartHandler("label",this,&NodeHandler::startLabel);
+ addEndHandler("label",this,&NodeHandler::endLabel);
+}
+
+NodeHandler::~NodeHandler()
+{
+}
+
+void NodeHandler::startNode(const QXmlAttributes &attrib)
+{
+ m_parent->setDelegate(this);
+ m_id = attrib.value("id");
+}
+
+void NodeHandler::endNode()
+{
+ m_parent->setDelegate(0);
+}
+
+void NodeHandler::startLink(const QXmlAttributes &attrib)
+{
+ m_link = attrib.value("id");
+}
+
+void NodeHandler::endLink()
+{
+}
+
+void NodeHandler::startLabel(const QXmlAttributes &/*attrib*/)
+{
+ m_curString="";
+}
+
+void NodeHandler::endLabel()
+{
+ m_label = m_curString;
+}
+
+
+
+
+