2016-10-23 11:09:20 +02:00
|
|
|
#ifndef GPXPARSER_H
|
|
|
|
#define GPXPARSER_H
|
|
|
|
|
|
|
|
#include <QXmlStreamReader>
|
|
|
|
#include "parser.h"
|
|
|
|
|
|
|
|
|
|
|
|
class GPXParser : public Parser
|
|
|
|
{
|
|
|
|
public:
|
2017-07-27 19:47:46 +02:00
|
|
|
bool parse(QFile *file, QList<TrackData> &tracks,
|
|
|
|
QList<RouteData> &routes, QList<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,
|
|
|
|
QList<Waypoint> &waypoints);
|
2016-10-28 14:33:36 +02:00
|
|
|
void track(TrackData &track);
|
|
|
|
void trackpoints(TrackData &track);
|
2018-05-16 21:53:06 +02:00
|
|
|
void routepoints(RouteData &route, QList<TrackData> &tracks);
|
|
|
|
void rpExtension(TrackData *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);
|
|
|
|
void rteptExtensions(TrackData *autoRoute);
|
2016-10-27 08:09:12 +02:00
|
|
|
void trackpointData(Trackpoint &trackpoint);
|
2018-05-16 21:53:06 +02:00
|
|
|
void waypointData(Waypoint &waypoint, TrackData *autoRoute = 0);
|
2016-10-27 00:20:00 +02:00
|
|
|
qreal number();
|
|
|
|
QDateTime time();
|
|
|
|
Coordinates coordinates();
|
2016-10-23 11:09:20 +02:00
|
|
|
|
|
|
|
QXmlStreamReader _reader;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // GPXPARSER_H
|