File indexing completed on 2024-12-08 04:18:14

0001 /*
0002     SPDX-FileCopyrightText: 2020 Volker Krause <vkrause@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef OSM_XMLPARSER_H
0008 #define OSM_XMLPARSER_H
0009 
0010 #include "abstractreader.h"
0011 
0012 #include <QString>
0013 
0014 class QIODevice;
0015 class QXmlStreamReader;
0016 
0017 namespace OSM {
0018 
0019 class DataSet;
0020 
0021 class XmlParser : public AbstractReader
0022 {
0023 public:
0024     explicit XmlParser(DataSet *dataSet);
0025 
0026 private:
0027     void readFromIODevice(QIODevice *io) override;
0028 
0029     void parseNode(QXmlStreamReader &reader);
0030     void parseWay(QXmlStreamReader &reader);
0031     void parseRelation(QXmlStreamReader &reader);
0032     template <typename T>
0033     void parseTag(QXmlStreamReader &reader, T &elem);
0034     template <typename T>
0035     void parseTagOrBounds(QXmlStreamReader &reader, T&elem);
0036     template <typename T>
0037     void parseBounds(QXmlStreamReader &reader, T &elem);
0038 };
0039 
0040 }
0041 
0042 #endif // OSM_XMLPARSER_P_H