File indexing completed on 2024-05-12 15:31:20

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2009 Bastian Holst <bastianholst@gmx.de>
0004 //
0005 
0006 #ifndef STATIONLISTPARSER_H
0007 #define STATIONLISTPARSER_H
0008 
0009 // Qt
0010 #include <QList>
0011 #include <QThread>
0012 #include <QXmlStreamReader>
0013 
0014 class QString;
0015 
0016 namespace Marble
0017 {
0018 
0019 class BBCStation;
0020     
0021 class StationListParser : public QThread, public QXmlStreamReader
0022 {
0023     Q_OBJECT
0024 public:
0025     explicit StationListParser( QObject *parent );
0026     ~StationListParser() override;
0027 
0028     void read();
0029 
0030     QList<BBCStation> stationList() const;
0031 
0032     void setPath( const QString& path );
0033 
0034 protected:
0035     void run() override;
0036 
0037 private:
0038     void readUnknownElement();
0039     void readStationList();
0040     void readStation();
0041     QString readCharacters();
0042     void readPoint( BBCStation *station );
0043 
0044     QString m_path;
0045     QList<BBCStation> m_list;
0046 };
0047 
0048 } // Marble namespace
0049 
0050 #endif // STATIONLISTPARSER_H