Parser Class Reference

This class is an abstraction of libiksemel's XML parser. More...

#include <parser.h>

Collaboration diagram for Parser:

Collaboration graph
[legend]
List of all members.

Public Types

enum  ParserState { PARSER_OK, PARSER_NOMEM, PARSER_BADXML }

Public Member Functions

 Parser (ClientBase *parent)
virtual ~Parser ()
ParserState feed (const std::string &data)

Friends

int cdataHook (Parser *parser, char *data, size_t len)
int tagHook (Parser *parser, char *name, char **atts, int type)

Detailed Description

This class is an abstraction of libiksemel's XML parser.

Author:
Jakob Schroeter <js@camaya.net>
Since:
0.4

Definition at line 36 of file parser.h.


Member Enumeration Documentation

enum ParserState

Describes the return values of the parser.

Enumerator:
PARSER_OK  Everything's alright.
PARSER_NOMEM  Memory allcation error.
PARSER_BADXML  XML parse error.

Definition at line 42 of file parser.h.


Constructor & Destructor Documentation

Parser ( ClientBase parent  ) 

Constructs a new Parser object.

Parameters:
parent The object to send incoming Tags to.

Definition at line 24 of file parser.cpp.

~Parser (  )  [virtual]

Virtual destructor.

Definition at line 30 of file parser.cpp.


Member Function Documentation

Parser::ParserState feed ( const std::string &  data  ) 

Use this function to feed the parser with more XML.

Parameters:
data Raw xml to parse.
Returns:
The return value indicates success or failure of the parsing.

Definition at line 36 of file parser.cpp.

Referenced by Connection::recv().


Friends And Related Function Documentation

int cdataHook ( Parser parser,
char *  data,
size_t  len 
) [friend]

Called by iksemel's parser with cdata for the current node.

Parameters:
parser The current Parser.
data The cdata.
len The length of the data.

Definition at line 126 of file parser.cpp.

Referenced by Parser::Parser().

int tagHook ( Parser parser,
char *  name,
char **  atts,
int  type 
) [friend]

Called by iksemel's parser for every new element.

Parameters:
parser The current Parser.
name The element's name.
atts The element's list of attributes.
type The type of the element.

Definition at line 70 of file parser.cpp.

Referenced by Parser::Parser().


The documentation for this class was generated from the following files:
Generated on Tue May 1 14:20:25 2007 for gloox by  doxygen 1.5.1