File indexing completed on 2024-12-01 12:29:10
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2011 Dennis Nienhüser <nienhueser@kde.org> 0004 // 0005 0006 #ifndef MARBLE_XMLPARSER_H 0007 #define MARBLE_XMLPARSER_H 0008 0009 #include "../OsmParser.h" 0010 0011 #include "Writer.h" 0012 #include "OsmRegion.h" 0013 #include "OsmPlacemark.h" 0014 #include "OsmRegionTree.h" 0015 0016 #include <QFileInfo> 0017 #include <QXmlDefaultHandler> 0018 0019 namespace Marble 0020 { 0021 0022 class XmlParser : public OsmParser, private QXmlDefaultHandler 0023 { 0024 Q_OBJECT 0025 public: 0026 explicit XmlParser( QObject *parent = nullptr ); 0027 0028 protected: 0029 bool parse( const QFileInfo &file, int pass, bool &needAnotherPass ) override; 0030 0031 private: 0032 bool startElement ( const QString & namespaceURI, const QString & localName, const QString & qName, const QXmlAttributes & atts ) override; 0033 0034 bool endElement ( const QString & namespaceURI, const QString & localName, const QString & qName ) override; 0035 0036 Node m_node; 0037 0038 Way m_way; 0039 0040 Relation m_relation; 0041 0042 int m_id; 0043 0044 ElementType m_element; 0045 0046 }; 0047 0048 } 0049 0050 #endif // MARBLE_XMLPARSER_H