2015-10-05 01:43:48 +02:00
|
|
|
#ifndef GPX_H
|
|
|
|
#define GPX_H
|
|
|
|
|
|
|
|
#include <QVector>
|
2016-02-08 17:53:09 +01:00
|
|
|
#include <QList>
|
2015-10-05 01:43:48 +02:00
|
|
|
#include <QPointF>
|
|
|
|
#include <QString>
|
2016-02-11 20:58:52 +01:00
|
|
|
#include "waypoint.h"
|
|
|
|
#include "track.h"
|
2015-10-05 01:43:48 +02:00
|
|
|
#include "parser.h"
|
|
|
|
|
|
|
|
class GPX
|
|
|
|
{
|
|
|
|
public:
|
2016-03-02 09:15:03 +01:00
|
|
|
GPX() : _parser(_tracks, _waypoints), _errorLine(0) {}
|
2015-10-05 01:43:48 +02:00
|
|
|
bool loadFile(const QString &fileName);
|
|
|
|
const QString &errorString() const {return _error;}
|
2015-11-26 19:13:59 +01:00
|
|
|
int errorLine() const {return _errorLine;}
|
2015-10-12 01:12:12 +02:00
|
|
|
|
2016-02-11 20:58:52 +01:00
|
|
|
int trackCount() const {return _tracks.count();}
|
|
|
|
Track track(int i) const {return Track(_tracks.at(i));}
|
2016-02-19 21:42:54 +01:00
|
|
|
const QList<Waypoint> &waypoints() const {return _waypoints;}
|
2015-10-05 01:43:48 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
Parser _parser;
|
|
|
|
QString _error;
|
2015-11-26 19:13:59 +01:00
|
|
|
int _errorLine;
|
2016-02-11 20:58:52 +01:00
|
|
|
|
2016-02-19 21:42:54 +01:00
|
|
|
QList<QVector<Trackpoint> > _tracks;
|
|
|
|
QList<Waypoint> _waypoints;
|
2015-10-05 01:43:48 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // GPX_H
|