#include <parser.h>
Static Public Member Functions |
static Tag * | parse (std::string &data) |
Detailed Description
This class implements an XML parser.
- Author
- Jakob Schroeter js@ca.nosp@m.maya.nosp@m..net
- Since
- 0.9
Definition at line 34 of file parser.h.
Constructor & Destructor Documentation
Constructs a new Parser object.
- Parameters
-
ph | The object to send incoming Tags to. |
deleteRoot | Indicates whether a parsed Tag should be deleted after pushing it upstream. Defaults to true . |
Definition at line 22 of file parser.cpp.
Virtual destructor.
Definition at line 30 of file parser.cpp.
Member Function Documentation
void cleanup |
( |
bool |
deleteRoot = true | ) |
|
Resets internal state.
- Parameters
-
deleteRoot | Whether to delete the m_root member. For internal use only. |
Definition at line 805 of file parser.cpp.
int feed |
( |
std::string & |
data | ) |
|
Use this function to feed the parser with more XML.
- Parameters
-
data | Raw xml to parse. It may be modified if backbuffering is necessary. |
- Returns
- Returns -1 if parsing was successful. If a parse error occured, the character position where the error occured is returned.
Definition at line 162 of file parser.cpp.
Tag * parse |
( |
std::string & |
data | ) |
|
|
static |
Parses the given data and returns a Tag if and only if data contains a string that represents a well-formed and complete XML element. Hence this function is not suited for stream parsing.
- Parameters
-
data | A string containing XML. |
- Returns
- A Tag, or 0. The caller is responsible for deleting the returned Tag.
- Since
- 1.0
Definition at line 845 of file parser.cpp.
The documentation for this class was generated from the following files: