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