xmlwrapp
Lightweight C++ XML parsing library
|
Go to the documentation of this file.
39 #ifndef _xmlwrapp_event_parser_h_
40 #define _xmlwrapp_event_parser_h_
44 #include "xmlwrapp/export.h"
153 virtual bool text(
const std::string& contents) = 0;
167 virtual bool cdata(
const std::string& contents);
195 virtual bool comment(
const std::string& contents);
205 virtual bool warning(
const std::string& message);
218 friend struct impl::epimpl;
219 impl::epimpl *pimpl_;
230 #endif // _xmlwrapp_event_parser_h_
virtual bool cdata(const std::string &contents)
Override this member function to receive the cdata message.
virtual bool text(const std::string &contents)=0
Override this member function to receive the text message.
void set_error_message(const char *message)
Set the error message that will be returned from the get_error_message() member function.
bool parse_file(const char *filename)
Call this member function to parse the given file.
virtual bool processing_instruction(const std::string &target, const std::string &data)
Override this member function to receive the processing_instruction message.
event_parser()
Default constructor.
bool parse_stream(std::istream &stream)
Parse what ever data that can be read from the given stream.
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.
XML library namespace.
Definition: attributes.h:52
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...
std::map< std::string, std::string > attrs_type
a type for holding XML node attributes
Definition: event_parser.h:70
bool parse_chunk(const char *chunk, size_type length)
Call this function to parse a chunk of xml data.
std::size_t size_type
size type
Definition: event_parser.h:72
virtual bool warning(const std::string &message)
Override this member function to receive parser warnings.
virtual bool start_element(const std::string &name, const attrs_type &attrs)=0
Override this member function to receive the start_element message.
The xml::event_parser is used to parse an XML document by calling member functions when certain thing...
Definition: event_parser.h:67
bool parse_finish()
Finish parsing chunked data.