File indexing completed on 2024-05-12 04:42:36

0001 /*
0002     SPDX-FileCopyrightText: 2018 Volker Krause <vkrause@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef KPUBLICTRANSPORT_HAFASQUERYPARSER_H
0008 #define KPUBLICTRANSPORT_HAFASQUERYPARSER_H
0009 
0010 #include "kpublictransport_export.h"
0011 #include "hafasparser.h"
0012 
0013 #include <KPublicTransport/Line>
0014 
0015 #include <QString>
0016 
0017 #include <unordered_map>
0018 #include <vector>
0019 
0020 class QByteArray;
0021 
0022 namespace KPublicTransport {
0023 
0024 class Journey;
0025 class Location;
0026 class Stopover;
0027 
0028 /** Parse for Hafas "query.exe" variant XML responses.
0029  *  @internal only exported for unit tests.
0030  */
0031 class KPUBLICTRANSPORT_EXPORT HafasQueryParser : public HafasParser
0032 {
0033 public:
0034     HafasQueryParser();
0035     ~HafasQueryParser();
0036 
0037     std::vector<Stopover> parseStationBoardResponse(const QByteArray &data, bool isArrival);
0038     std::vector<Location> parseGetStopResponse(const QByteArray &data);
0039     std::vector<Location> parseQueryLocationResponse(const QByteArray &data);
0040     std::vector<Journey> parseQueryJourneyResponse(const QByteArray &data);
0041 };
0042 
0043 }
0044 
0045 #endif // KPUBLICTRANSPORT_HAFASQUERYPARSER_H