GNUMessenger::Expat Class Reference

This class helps us interface with expat. Expat interface. More...

#include <wrapexpat.h>

Inheritance diagram for GNUMessenger::Expat:

Inheritance graph
[legend]
Collaboration diagram for GNUMessenger::Expat:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void parse (string data)
 This feeds more data into the parser.
void reset ()
 Deletes the expat datastructures and prepares a new one.

Static Public Member Functions

string trim_right (const string &source, const string &t=" ")
string trim_left (const string &source, const string &t=" ")
string trim (const string &source, const string &t=" ")

Protected Member Functions

virtual void recievedTag (XMLNode &n)
 This method is called whenever a new tag is recieved.
virtual void rootTagRecieved (XMLNode &root)
 This method is called when the first complete tag is recieved.
virtual void rootTagEnded ()
 This method is called when first tag recieved is ended.
virtual void parserError (string errorMsg, int line)
 This is any errors that expat produces.

Detailed Description

This class helps us interface with expat. Expat interface.

This is the coolest class in the whole project. This class creates a nice clean interface between expat (which is C) and C++.

Author:
Seth Hartbecke (gandalf@netins.net)

Definition at line 24 of file wrapexpat.h.


Member Function Documentation

void GNUMessenger::Expat::parserError string  errorMsg,
int  line
[protected, virtual]
 

This is any errors that expat produces.

The class will not work anymore after an error has been encountered unless you call reset. Definition at line 114 of file wrapexpat.cpp.

References reset().

Referenced by parse().

00115 { 00116 stringstream err; 00117 err << "Expat parser error: " << errorMsg << " at "<< line; 00118 00119 // try to keep object in sane state after throw 00120 reset(); 00121 LOG_THROW(err.str(), ParseFailure); 00122 }

Here is the call graph for this function:

void GNUMessenger::Expat::recievedTag XMLNode n  )  [protected, virtual]
 

This method is called whenever a new tag is recieved.

You should ovveride this.

Reimplemented in GNUMessenger::XMLParser.

Definition at line 97 of file wrapexpat.cpp.

Referenced by parse().

00098 { 00099 LOG_DEBUG(string(n)); 00100 }

void GNUMessenger::Expat::reset  ) 
 

Deletes the expat datastructures and prepares a new one.

Nice for soft resets. Used by XMLStream

Reimplemented in GNUMessenger::KitProtocol.

Definition at line 70 of file wrapexpat.cpp.

Referenced by parserError().

00071 { 00072 cleanup(); 00073 init(); 00074 }

void GNUMessenger::Expat::rootTagEnded  )  [protected, virtual]
 

This method is called when first tag recieved is ended.

This usually means that the document is EOF. Definition at line 109 of file wrapexpat.cpp.

00110 { 00111 LOG_DEBUG("Root tag ended."); 00112 }


The documentation for this class was generated from the following files:
Generated on Tue Oct 5 14:41:58 2004 for GNU Messenger by doxygen 1.3.8