#include <xmltextread.h>
Public Member Functions | |
virtual | ~xml_text_reader () |
xml_text_reader (input &deeper, bool validate=false) | |
void | parse () |
Protected Member Functions | |
virtual void | process_node ()=0 |
virtual void | process_node_end (bool empty) |
int | depth () |
xmlReaderTypes | node_type () |
const xmlChar * | name () |
int | is_empty_element () |
int | has_value () |
const xmlChar * | value () |
void | move_back_to_element () |
Static Protected Member Functions | |
static const char * | xmlReaderType_ename (xmlReaderTypes) |
Private Member Functions | |
int | read_deeper (char *buffer, int len) |
void | close () |
void | error (const char *msg, xmlParserSeverities severity, xmlTextReaderLocatorPtr locator) |
bool | read () |
xml_text_reader () | |
xml_text_reader (const xml_text_reader &) | |
xml_text_reader & | operator= (const xml_text_reader &) |
Static Private Member Functions | |
static int | read_callback (void *context, char *buffer, int len) |
static int | close_callback (void *context) |
static void | error_callback (void *context, const char *msg, xmlParserSeverities severity, xmlTextReaderLocatorPtr locator) |
Private Attributes | |
input | deeper |
xmlTextReaderPtr | reader |
int | number_of_errors |
bool | validate |
Static Private Attributes | |
static int | number_of_parsers |
Definition at line 56 of file xmltextread.h.
virtual xml_text_reader::~xml_text_reader | ( | ) | [virtual] |
The destructor.
xml_text_reader::xml_text_reader | ( | input & | deeper, | |
bool | validate = false | |||
) |
The constructor.
xml_text_reader::xml_text_reader | ( | ) | [private] |
The default constructor. Do not use.
xml_text_reader::xml_text_reader | ( | const xml_text_reader & | ) | [private] |
The copy constructor. Do not use.
void xml_text_reader::parse | ( | ) |
The parse method is used to parse the given file. Each element will cause the process_node() method to be called.
virtual void xml_text_reader::process_node | ( | ) | [protected, pure virtual] |
The process_node method is used to process each node as it is read from the input. Each derived class must supply its own process_node method.
Implemented in xml_text_reader_by_node.
virtual void xml_text_reader::process_node_end | ( | bool | empty | ) | [protected, virtual] |
The process_node_end method is only ever called for ELEMENT nodes, and only after all of the attributes have been given to the process_node method.
The default implimentation does nothing.
empty | Whether or not the original ELEMENT node was empty. |
Reimplemented in xml_text_reader_by_node.
int xml_text_reader::depth | ( | ) | [inline, protected] |
The depth method is used to obtain the depth of the current node in the tree.
Definition at line 102 of file xmltextread.h.
xmlReaderTypes xml_text_reader::node_type | ( | ) | [inline, protected] |
The node_type method is used to get the node type of the current node.
Definition at line 115 of file xmltextread.h.
static const char* xml_text_reader::xmlReaderType_ename | ( | xmlReaderTypes | ) | [static, protected] |
The xmlReaderType_ename class method is used to obtain the text equivalent of a node type.
const xmlChar* xml_text_reader::name | ( | ) | [inline, protected] |
The name method is used to determine the qualified name of the current node, equal to Prefix:LocalName.
Definition at line 133 of file xmltextread.h.
int xml_text_reader::is_empty_element | ( | ) | [inline, protected] |
The is_empty_element method is used to check if the current node is empty.
Definition at line 142 of file xmltextread.h.
int xml_text_reader::has_value | ( | ) | [inline, protected] |
The has_value method is used to determine whether or not the current node has a text value.
Definition at line 151 of file xmltextread.h.
const xmlChar* xml_text_reader::value | ( | ) | [inline, protected] |
The value method is used to provide the text value of the current node if present.
Definition at line 161 of file xmltextread.h.
void xml_text_reader::move_back_to_element | ( | ) | [inline, protected] |
The move_back_to_element method is used after parsing the element attributes to move the reader pointer back to the element node once again so that the name is again available.
Definition at line 168 of file xmltextread.h.
static int xml_text_reader::read_callback | ( | void * | context, | |
char * | buffer, | |||
int | len | |||
) | [static, private] |
The read_callback class method is used to handle callbacks by the parser. It calls the read_deeper method.
int xml_text_reader::read_deeper | ( | char * | buffer, | |
int | len | |||
) | [private] |
The read_deeper method is used by the read_callback class method is used to obtain the next block of input.
static int xml_text_reader::close_callback | ( | void * | context | ) | [static, private] |
The close_callback class method is used to handle callbacks by the parser when end of inpout is reached.
void xml_text_reader::close | ( | ) | [private] |
The close method is called by the parser when it gets to the end of the input.
static void xml_text_reader::error_callback | ( | void * | context, | |
const char * | msg, | |||
xmlParserSeverities | severity, | |||
xmlTextReaderLocatorPtr | locator | |||
) | [static, private] |
The error_callback class method is used to handle callbacks by the parser when an error is seen.
void xml_text_reader::error | ( | const char * | msg, | |
xmlParserSeverities | severity, | |||
xmlTextReaderLocatorPtr | locator | |||
) | [private] |
the error method is used to report errors and warnings detected during the parse.
bool xml_text_reader::read | ( | ) | [private] |
The read method is used to read one node from the input, and process it via the veirtual process_node method. If there is an error, it is reported in a fatal error message, and this function does not return.
xml_text_reader& xml_text_reader::operator= | ( | const xml_text_reader & | ) | [private] |
The assignment operator. Do not use.
input xml_text_reader::deeper [private] |
The deeper instance variable is used to remember the deeper input stream which the XML parser will use to obtain its input.
Definition at line 175 of file xmltextread.h.
xmlTextReaderPtr xml_text_reader::reader [private] |
The reader instance variable is used to remember the location of the opaque xml_text_reader data store.
Definition at line 181 of file xmltextread.h.
int xml_text_reader::number_of_errors [private] |
The number_of_errors instance variable is used to remember how many errors have been detected to date in the parsing of the input stream.
Definition at line 188 of file xmltextread.h.
int xml_text_reader::number_of_parsers [static, private] |
The number_of_parsers class variable is used to remember how many instances are currently active. This lets us initialise and clean up after the xml2 library.
Definition at line 195 of file xmltextread.h.
bool xml_text_reader::validate [private] |
The validate instance variable is used to remember whether or not we are validating the data against the DTD.
Definition at line 201 of file xmltextread.h.