| 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 <string.h> |
|---|
| 25 | #include "XMLParser.h"
|
|---|
| 26 |
|
|---|
| 27 | namespace osm
|
|---|
| 28 | {
|
|---|
| 29 |
|
|---|
| 30 | class OSMDocument;
|
|---|
| 31 | class Way;
|
|---|
| 32 |
|
|---|
| 33 | /**
|
|---|
| 34 | Parser callback for OSMDocument files
|
|---|
| 35 | */
|
|---|
| 36 | class OSMDocumentParserCallback : public xml::XMLParserCallback
|
|---|
| 37 | {
|
|---|
| 38 | //! reference to a OSMDocument object
|
|---|
| 39 | OSMDocument& m_rDocument;
|
|---|
| 40 | //! current way, which will be parsed
|
|---|
| 41 | Way* m_pActWay;
|
|---|
| 42 |
|
|---|
| 43 | virtual void StartElement( const char *name, const char** atts );
|
|---|
| 44 |
|
|---|
| 45 | virtual void EndElement( const char* name );
|
|---|
| 46 |
|
|---|
| 47 | virtual void SetContent( const char* ch, int len)
|
|---|
| 48 | {
|
|---|
| 49 | }
|
|---|
| 50 |
|
|---|
| 51 | virtual void ProcessingInstruction( const char* target, const char* data )
|
|---|
| 52 | {
|
|---|
| 53 | }
|
|---|
| 54 |
|
|---|
| 55 | virtual void CDataBlockInternal(const char *value, int len)
|
|---|
| 56 | {
|
|---|
| 57 | }
|
|---|
| 58 |
|
|---|
| 59 |
|
|---|
| 60 | public:
|
|---|
| 61 | /**
|
|---|
| 62 | * Constructor
|
|---|
| 63 | */
|
|---|
| 64 | OSMDocumentParserCallback( OSMDocument& doc )
|
|---|
| 65 | :
|
|---|
| 66 | m_rDocument( doc ),
|
|---|
| 67 | m_pActWay( 0 )
|
|---|
| 68 | {
|
|---|
| 69 | }
|
|---|
| 70 |
|
|---|
| 71 | }; // class OSMDocumentParserCallback
|
|---|
| 72 |
|
|---|
| 73 | }; // end namespace osm
|
|---|
| 74 |
|
|---|
| 75 | #endif
|
|---|