1*ed2f6d3bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*ed2f6d3bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*ed2f6d3bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*ed2f6d3bSAndrew Rist  * distributed with this work for additional information
6*ed2f6d3bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*ed2f6d3bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*ed2f6d3bSAndrew Rist  * "License"); you may not use this file except in compliance
9*ed2f6d3bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*ed2f6d3bSAndrew Rist  *
11*ed2f6d3bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*ed2f6d3bSAndrew Rist  *
13*ed2f6d3bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*ed2f6d3bSAndrew Rist  * software distributed under the License is distributed on an
15*ed2f6d3bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*ed2f6d3bSAndrew Rist  * KIND, either express or implied.  See the License for the
17*ed2f6d3bSAndrew Rist  * specific language governing permissions and limitations
18*ed2f6d3bSAndrew Rist  * under the License.
19*ed2f6d3bSAndrew Rist  *
20*ed2f6d3bSAndrew Rist  *************************************************************/
21*ed2f6d3bSAndrew Rist 
22*ed2f6d3bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef I_XML_PARSER_EVENT_HANDLER_HXX_INCLUDED
25cdf0e10cSrcweir #define I_XML_PARSER_EVENT_HANDLER_HXX_INCLUDED
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <string>
28cdf0e10cSrcweir #include <map>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #if defined(XML_UNICODE) || defined(XML_UNICODE_WCHAR_T)
31cdf0e10cSrcweir 	typedef std::wstring string_t;
32cdf0e10cSrcweir 	typedef wchar_t char_t;
33cdf0e10cSrcweir #else
34cdf0e10cSrcweir 	typedef std::string string_t;
35cdf0e10cSrcweir 	typedef char char_t;
36cdf0e10cSrcweir #endif
37cdf0e10cSrcweir 
38cdf0e10cSrcweir // name-value container
39cdf0e10cSrcweir typedef std::map<string_t, string_t> xml_tag_attribute_container_t;
40cdf0e10cSrcweir 
41cdf0e10cSrcweir 
42cdf0e10cSrcweir //#########################################
43cdf0e10cSrcweir class i_xml_parser_event_handler
44cdf0e10cSrcweir {
45cdf0e10cSrcweir public:
~i_xml_parser_event_handler()46cdf0e10cSrcweir 	virtual ~i_xml_parser_event_handler() {};
47cdf0e10cSrcweir 
48cdf0e10cSrcweir 	virtual void start_document() = 0;
49cdf0e10cSrcweir 
50cdf0e10cSrcweir 	virtual void end_document() = 0;
51cdf0e10cSrcweir 
52cdf0e10cSrcweir 	virtual void start_element(
53cdf0e10cSrcweir 		const string_t& raw_name,
54cdf0e10cSrcweir 		const string_t& local_name,
55cdf0e10cSrcweir 		const xml_tag_attribute_container_t& attributes) = 0;
56cdf0e10cSrcweir 
57cdf0e10cSrcweir 	virtual void end_element(
58cdf0e10cSrcweir 		const string_t& raw_name,
59cdf0e10cSrcweir 		const string_t& local_name) = 0;
60cdf0e10cSrcweir 
61cdf0e10cSrcweir 	virtual void characters(
62cdf0e10cSrcweir 		const string_t& character) = 0;
63cdf0e10cSrcweir 
64cdf0e10cSrcweir 	virtual void ignore_whitespace(
65cdf0e10cSrcweir 		const string_t& whitespaces) = 0;
66cdf0e10cSrcweir 
67cdf0e10cSrcweir 	virtual void processing_instruction(
68cdf0e10cSrcweir 		const string_t& target, const string_t& data) = 0;
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 	virtual void comment(const string_t& comment) = 0;
71cdf0e10cSrcweir };
72cdf0e10cSrcweir 
73cdf0e10cSrcweir #endif
74cdf0e10cSrcweir 
75