1 | /***************************************************************************
|
---|
2 | * Copyright (C) 2008 by Daniel Wendt *
|
---|
3 | * gentoo.murray@gmail.com *
|
---|
4 | * *
|
---|
5 | * This program is free software; you can redistribute it and/or modify *
|
---|
6 | * it under the terms of the GNU General Public License as published by *
|
---|
7 | * the Free Software Foundation; either version 2 of the License, or *
|
---|
8 | * (at your option) any later version. *
|
---|
9 | * *
|
---|
10 | * This program is distributed in the hope that it will be useful, *
|
---|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
---|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
---|
13 | * GNU General Public License for more details. *
|
---|
14 | * *
|
---|
15 | * You should have received a copy of the GNU General Public License *
|
---|
16 | * along with this program; if not, write to the *
|
---|
17 | * Free Software Foundation, Inc., *
|
---|
18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
---|
19 | ***************************************************************************/
|
---|
20 |
|
---|
21 | #ifndef OSMDOCUMENTPARSERCALLBACK_H
|
---|
22 | #define OSMDOCUMENTPARSERCALLBACK_H
|
---|
23 |
|
---|
24 | #include "XMLParser.h"
|
---|
25 |
|
---|
26 | namespace osm
|
---|
27 | {
|
---|
28 |
|
---|
29 | class OSMDocument;
|
---|
30 | class Way;
|
---|
31 |
|
---|
32 | /**
|
---|
33 | Parser callback for OSMDocument files
|
---|
34 | */
|
---|
35 | class OSMDocumentParserCallback : public xml::XMLParserCallback
|
---|
36 | {
|
---|
37 | //! reference to a OSMDocument object
|
---|
38 | OSMDocument& m_rDocument;
|
---|
39 | //! current way, which will be parsed
|
---|
40 | Way* m_pActWay;
|
---|
41 |
|
---|
42 | virtual void StartElement( const char *name, const char** atts );
|
---|
43 |
|
---|
44 | virtual void EndElement( const char* name );
|
---|
45 |
|
---|
46 | virtual void SetContent( const char* ch, int len)
|
---|
47 | {
|
---|
48 | }
|
---|
49 |
|
---|
50 | virtual void ProcessingInstruction( const char* target, const char* data )
|
---|
51 | {
|
---|
52 | }
|
---|
53 |
|
---|
54 | virtual void CDataBlockInternal(const char *value, int len)
|
---|
55 | {
|
---|
56 | }
|
---|
57 |
|
---|
58 |
|
---|
59 | public:
|
---|
60 | /**
|
---|
61 | * Constructor
|
---|
62 | */
|
---|
63 | OSMDocumentParserCallback( OSMDocument& doc )
|
---|
64 | :
|
---|
65 | m_rDocument( doc ),
|
---|
66 | m_pActWay( 0 )
|
---|
67 | {
|
---|
68 | }
|
---|
69 |
|
---|
70 | }; // class OSMDocumentParserCallback
|
---|
71 |
|
---|
72 | }; // end namespace osm
|
---|
73 |
|
---|
74 | #endif
|
---|