2016-10-23 11:09:20 +02:00
|
|
|
#ifndef GPXPARSER_H
|
|
|
|
#define GPXPARSER_H
|
|
|
|
|
|
|
|
#include <QXmlStreamReader>
|
|
|
|
#include "parser.h"
|
|
|
|
|
|
|
|
class GPXParser : public Parser
|
|
|
|
{
|
|
|
|
public:
|
2019-01-31 01:46:53 +01:00
|
|
|
bool parse(QFile *file, QList<TrackData> &tracks, QList<RouteData> &routes,
|
2019-02-01 00:26:27 +01:00
|
|
|
QList<Area> &areas, QVector<Waypoint> &waypoints);
|
2016-10-23 11:09:20 +02:00
|
|
|
QString errorString() const {return _reader.errorString();}
|
|
|
|
int errorLine() const {return _reader.lineNumber();}
|
|
|
|
|
|
|
|
private:
|
2017-07-27 19:47:46 +02:00
|
|
|
void gpx(QList<TrackData> &tracks, QList<RouteData> &routes,
|
2019-02-01 00:26:27 +01:00
|
|
|
QList<Area> &areas, QVector<Waypoint> &waypoints);
|
2016-10-28 14:33:36 +02:00
|
|
|
void track(TrackData &track);
|
2019-02-11 23:28:08 +01:00
|
|
|
void trackpoints(SegmentData &segment);
|
2018-05-16 21:53:06 +02:00
|
|
|
void routepoints(RouteData &route, QList<TrackData> &tracks);
|
2019-02-11 23:28:08 +01:00
|
|
|
void rpExtension(SegmentData *autoRoute);
|
2016-10-27 08:09:12 +02:00
|
|
|
void tpExtension(Trackpoint &trackpoint);
|
2018-05-16 21:53:06 +02:00
|
|
|
void trkptExtensions(Trackpoint &trackpoint);
|
2019-11-08 21:00:59 +01:00
|
|
|
void wpExtension(Waypoint &waypoint);
|
|
|
|
void waypointExtensions(Waypoint &waypoint, SegmentData *autoRoute);
|
2019-02-01 00:26:27 +01:00
|
|
|
void area(Area &area);
|
|
|
|
void gpxExtensions(QList<Area> &areas);
|
2022-09-23 02:34:18 +02:00
|
|
|
void trackExtensions(TrackData &track);
|
|
|
|
void trackExtension(TrackData &track);
|
|
|
|
void routeExtensions(RouteData &route);
|
|
|
|
void routeExtension(RouteData &route);
|
2016-10-27 08:09:12 +02:00
|
|
|
void trackpointData(Trackpoint &trackpoint);
|
2019-02-11 23:28:08 +01:00
|
|
|
void waypointData(Waypoint &waypoint, SegmentData *autoRoute = 0);
|
2019-11-08 21:00:59 +01:00
|
|
|
void address(Waypoint &waypoint);
|
2016-10-27 00:20:00 +02:00
|
|
|
qreal number();
|
|
|
|
QDateTime time();
|
|
|
|
Coordinates coordinates();
|
2019-10-14 01:16:38 +02:00
|
|
|
Link link();
|
2016-10-23 11:09:20 +02:00
|
|
|
|
|
|
|
QXmlStreamReader _reader;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // GPXPARSER_H
|