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 118 of file wrapexpat.cpp.

References reset().

Referenced by parse().

00119 {
00120     stringstream err;
00121     err << "Expat parser error: " << errorMsg << " at "<< line;
00122     
00123     // try to keep object in sane state after throw
00124     reset();
00125 
00126     wxLogTrace(EXP_TRACE, MB2WX(err.str().c_str()));
00127 
00128     throw ParseFailure(err.str());
00129 }

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 101 of file wrapexpat.cpp.

Referenced by parse().

00102 {
00103     wxLogTrace(EXP_TRACE, MB2WX(string(n).c_str()));
00104 }

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 74 of file wrapexpat.cpp.

Referenced by parserError().

00075 {
00076     cleanup();
00077     init();
00078 }

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 113 of file wrapexpat.cpp.

00114 {
00115     wxLogTrace(EXP_TRACE, wxT("Root tag ended."));
00116 }


The documentation for this class was generated from the following files:
Generated on Fri Dec 17 01:53:06 2004 for GNU Messenger by  doxygen 1.3.9.1