3 /// A simple XML parser (use callback on start, end and data block
7 Copyright (C) 2010, Nicolas VIVIEN
8 Copyright (C) 2005-2013, Net Direct Inc. (http://www.netdirect.ca/)
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 See the GNU General Public License in the COPYING file at the
20 root directory of this project for more details.
23 #ifndef __XMLPARSER_H__
24 #define __XMLPARSER_H__
37 class BXEXPORT XMLParser
: public xmlpp::SaxParser
40 XMLParser(std::istream
& input
, const char *charset
="UTF-8");
41 virtual ~XMLParser(void);
43 virtual bool Run(void);
44 virtual const unsigned long GetDepth(void) const;
51 // SaxParser overrides:
52 virtual void on_start_document();
53 virtual void on_end_document();
54 virtual void on_start_element(const Glib::ustring
& name
,
55 const xmlpp::SaxParser::AttributeList
& properties
);
56 virtual void on_end_element(const Glib::ustring
& name
);
57 virtual void on_characters(const Glib::ustring
& characters
);
58 virtual void on_comment(const Glib::ustring
& text
);
59 virtual void on_warning(const Glib::ustring
& text
);
60 virtual void on_error(const Glib::ustring
& text
);
61 virtual void on_fatal_error(const Glib::ustring
& text
);