39#ifndef _xmlwrapp_event_parser_h_
40#define _xmlwrapp_event_parser_h_
44#include "xmlwrapp/export.h"
53XMLWRAPP_MSVC_SUPPRESS_DLL_MEMBER_WARN
156 virtual bool text(
const std::string& contents) = 0;
170 virtual bool cdata(
const std::string& contents);
198 virtual bool comment(
const std::string& contents);
208 virtual bool warning(
const std::string& message);
221 friend struct impl::epimpl;
222 std::unique_ptr<impl::epimpl> pimpl_;
233XMLWRAPP_MSVC_RESTORE_DLL_MEMBER_WARN
The xml::event_parser is used to parse an XML document by calling member functions when certain thing...
Definition event_parser.h:70
void set_error_message(const char *message)
Set the error message that will be returned from the get_error_message() member function.
std::size_t size_type
size type
Definition event_parser.h:75
event_parser()
Default constructor.
bool parse_chunk(const char *chunk, size_type length)
Call this function to parse a chunk of xml data.
virtual bool cdata(const std::string &contents)
Override this member function to receive the cdata message.
virtual bool processing_instruction(const std::string &target, const std::string &data)
Override this member function to receive the processing_instruction message.
bool parse_stream(std::istream &stream)
Parse what ever data that can be read from the given stream.
virtual bool text(const std::string &contents)=0
Override this member function to receive the text message.
bool parse_finish()
Finish parsing chunked data.
std::map< std::string, std::string > attrs_type
a type for holding XML node attributes
Definition event_parser.h:73
virtual bool comment(const std::string &contents)
Override this member function to receive the comment message.
virtual bool end_element(const std::string &name)=0
Override this member function to receive the end_element message.
virtual bool start_element(const std::string &name, const attrs_type &attrs)=0
Override this member function to receive the start_element message.
bool parse_file(const char *filename)
Call this member function to parse the given file.
virtual bool warning(const std::string &message)
Override this member function to receive parser warnings.
const std::string & get_error_message() const
If there was an error parsing the XML data, (indicated by one of the parsing functions returning fals...
XML library namespace.
Definition attributes.h:55
This file contains the definition of the xml::init class.