Public Member Functions | Private Attributes | Friends | List of all members
GraphHandler Class Reference

#include <graphhandler.h>

Inheritance diagram for GraphHandler:
IGraph BaseHandler< GraphHandler > QXmlDefaultHandler ElementMapper< GraphHandler > LocatorContainer IBaseHandler QXmlContentHandler QXmlErrorHandler QXmlDTDHandler QXmlEntityResolver QXmlLexicalHandler QXmlDeclHandler

Public Member Functions

 GraphHandler (IBaseHandler *parent, const char *endTag)
 
virtual ~GraphHandler ()
 
void startGraph (const QXmlAttributes &attrib)
 
void endGraph ()
 
void startNode (const QXmlAttributes &attrib)
 
NodeHandlergetNodeById (const QString &id) const
 
virtual INodeIteratornodes () const
 
- Public Member Functions inherited from BaseHandler< GraphHandler >
 BaseHandler ()
 
virtual ~BaseHandler ()
 
virtual bool startDocument ()
 
virtual bool startElement (const QString &namespaceURI, const QString &localName, const QString &name, const QXmlAttributes &attrib)
 
virtual bool endElement (const QString &namespaceURI, const QString &localName, const QString &name)
 
bool skippedEntity (const QString &s)
 
virtual bool characters (const QString &ch)
 
void setDelegate (QXmlDefaultHandler *delegate)
 
QXmlDefaultHandlerdelegate () const
 
void setFallBackHandler (IFallBackHandler *h)
 
IFallBackHandlerfallBackHandler () const
 
void setDocumentLocator (QXmlLocator *locator)
 
- Public Member Functions inherited from QXmlDefaultHandler
 QXmlDefaultHandler ()
 
virtual ~QXmlDefaultHandler ()
 
bool endDocument ()
 
bool startPrefixMapping (const QString &prefix, const QString &uri)
 
bool endPrefixMapping (const QString &prefix)
 
bool ignorableWhitespace (const QString &ch)
 
bool processingInstruction (const QString &target, const QString &data)
 
bool warning (const QXmlParseException &exception)
 
bool error (const QXmlParseException &exception)
 
bool fatalError (const QXmlParseException &exception)
 
bool notationDecl (const QString &name, const QString &publicId, const QString &systemId)
 
bool unparsedEntityDecl (const QString &name, const QString &publicId, const QString &systemId, const QString &notationName)
 
bool resolveEntity (const QString &publicId, const QString &systemId, QXmlInputSource *&ret)
 
bool startDTD (const QString &name, const QString &publicId, const QString &systemId)
 
bool endDTD ()
 
bool startCDATA ()
 
bool endCDATA ()
 
bool comment (const QString &ch)
 
bool attributeDecl (const QString &eName, const QString &aName, const QString &type, const QString &valueDefault, const QString &value)
 
bool internalEntityDecl (const QString &name, const QString &value)
 
bool externalEntityDecl (const QString &name, const QString &publicId, const QString &systemId)
 
QString errorString ()
 
- Public Member Functions inherited from QXmlContentHandler
virtual ~QXmlContentHandler ()
 
- Public Member Functions inherited from QXmlErrorHandler
virtual ~QXmlErrorHandler ()
 
- Public Member Functions inherited from QXmlDTDHandler
virtual ~QXmlDTDHandler ()
 
- Public Member Functions inherited from QXmlEntityResolver
virtual ~QXmlEntityResolver ()
 
- Public Member Functions inherited from QXmlLexicalHandler
virtual ~QXmlLexicalHandler ()
 
- Public Member Functions inherited from QXmlDeclHandler
virtual ~QXmlDeclHandler ()
 
- Public Member Functions inherited from ElementMapper< GraphHandler >
 ElementMapper ()
 
virtual ~ElementMapper ()
 
void addStartHandler (const char *key)
 
void addStartHandler (const char *key, GraphHandler *obj, void(GraphHandler::*handler)(const QXmlAttributes &))
 
void addEndHandler (const char *key)
 
void addEndHandler (const char *key, GraphHandler *obj, void(GraphHandler::*handler)())
 
- Public Member Functions inherited from IBaseHandler
virtual ~IBaseHandler ()
 

Private Attributes

IBaseHandlerm_parent
 
QList< NodeHandlerm_nodes
 
QDict< NodeHandler > * m_nodeDict
 

Friends

class NodeIterator
 

Additional Inherited Members

- Public Types inherited from BaseHandler< GraphHandler >
typedef ElementMapper< GraphHandler >::StartElementHandlerT StartElementHandlerT
 
typedef ElementMapper< GraphHandler >::EndElementHandlerT EndElementHandlerT
 
- Public Types inherited from ElementMapper< GraphHandler >
typedef StartElementHandler StartElementHandlerT
 
typedef EndElementHandler EndElementHandlerT
 
- Static Public Attributes inherited from LocatorContainer
static QXmlLocators_theLocator =0
 
- Protected Attributes inherited from BaseHandler< GraphHandler >
QString m_curString
 
QString m_skipUntil
 
int m_skipCount
 
QXmlDefaultHandlerm_delegateHandler
 
IFallBackHandlerm_fallBackHandler
 
- Protected Attributes inherited from ElementMapper< GraphHandler >
QDict< StartElementHandlerTm_startHandlers
 
QDict< EndElementHandlerTm_endHandlers
 

Detailed Description

Definition at line 28 of file graphhandler.h.

Constructor & Destructor Documentation

GraphHandler::GraphHandler ( IBaseHandler parent,
const char *  endTag 
)

Definition at line 36 of file graphhandler.cpp.

37  : m_parent(parent)
38 {
42  m_nodeDict = new QDict<NodeHandler>(1009);
43 }
void startNode(const QXmlAttributes &attrib)
QList< NodeHandler > m_nodes
Definition: graphhandler.h:45
QDict< NodeHandler > * m_nodeDict
Definition: graphhandler.h:46
void addStartHandler(const char *key)
Definition: basehandler.h:91
IBaseHandler * m_parent
Definition: graphhandler.h:44
void setAutoDelete(bool enable)
Definition: qlist.h:99
const bool TRUE
Definition: qglobal.h:371
void addEndHandler(const char *key)
Definition: basehandler.h:101
GraphHandler::~GraphHandler ( )
virtual

Definition at line 45 of file graphhandler.cpp.

46 {
47  delete m_nodeDict;
48 }
QDict< NodeHandler > * m_nodeDict
Definition: graphhandler.h:46

Member Function Documentation

void GraphHandler::endGraph ( )

Definition at line 56 of file graphhandler.cpp.

57 {
58  debug(2,"endGraph\n");
60 }
virtual void setDelegate(QXmlDefaultHandler *delegate)=0
IBaseHandler * m_parent
Definition: graphhandler.h:44
NodeHandler * GraphHandler::getNodeById ( const QString id) const

Definition at line 75 of file graphhandler.cpp.

76 {
77  return m_nodeDict->find(id.utf8());
78 }
QDict< NodeHandler > * m_nodeDict
Definition: graphhandler.h:46
INodeIterator * GraphHandler::nodes ( ) const
virtual

Implements IGraph.

Definition at line 70 of file graphhandler.cpp.

71 {
72  return new NodeIterator(*this);
73 }
friend class NodeIterator
Definition: graphhandler.h:30
void GraphHandler::startGraph ( const QXmlAttributes attrib)

Definition at line 50 of file graphhandler.cpp.

51 {
52  debug(2,"startGraph\n");
53  m_parent->setDelegate(this);
54 }
virtual void setDelegate(QXmlDefaultHandler *delegate)=0
IBaseHandler * m_parent
Definition: graphhandler.h:44
void GraphHandler::startNode ( const QXmlAttributes attrib)

Definition at line 62 of file graphhandler.cpp.

63 {
64  NodeHandler *n = new NodeHandler(this);
65  n->startNode(attrib);
66  m_nodes.append(n);
67  m_nodeDict->insert(attrib.value("id").utf8(),n);
68 }
void append(const type *d)
Definition: qlist.h:73
QString value(int index) const
Definition: qxml.cpp:664
std::void_t< T > n
QList< NodeHandler > m_nodes
Definition: graphhandler.h:45
void startNode(const QXmlAttributes &attrib)
QDict< NodeHandler > * m_nodeDict
Definition: graphhandler.h:46
QCString utf8() const
Definition: qstring.cpp:14507

Friends And Related Function Documentation

friend class NodeIterator
friend

Definition at line 30 of file graphhandler.h.

Member Data Documentation

QDict<NodeHandler>* GraphHandler::m_nodeDict
private

Definition at line 46 of file graphhandler.h.

QList<NodeHandler> GraphHandler::m_nodes
private

Definition at line 45 of file graphhandler.h.

IBaseHandler* GraphHandler::m_parent
private

Definition at line 44 of file graphhandler.h.


The documentation for this class was generated from the following files: