summaryrefslogtreecommitdiffstats
path: root/addon/doxmlparser/src/graphhandler.cpp
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2002-03-10 16:02:35 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2002-03-10 16:02:35 (GMT)
commit57a81b6ed2c1f626c57c20f143468730322856da (patch)
tree6db5f7392588f3b8c9d05ab7d2651803bc00c4c1 /addon/doxmlparser/src/graphhandler.cpp
parentc7bc295f92f56d1dea369663e058933f550a0187 (diff)
downloadDoxygen-57a81b6ed2c1f626c57c20f143468730322856da.zip
Doxygen-57a81b6ed2c1f626c57c20f143468730322856da.tar.gz
Doxygen-57a81b6ed2c1f626c57c20f143468730322856da.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;
+}
+
+
+
+
+