1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-10-07 07:13:21 +02:00
GPXSee/src/gpx.h

38 lines
870 B
C
Raw Normal View History

2015-10-05 01:43:48 +02:00
#ifndef GPX_H
#define GPX_H
#include <QVector>
#include <QList>
2015-10-05 01:43:48 +02:00
#include <QPointF>
#include <QString>
#include "waypoint.h"
#include "track.h"
2016-08-09 01:16:19 +02:00
#include "route.h"
2015-10-05 01:43:48 +02:00
#include "parser.h"
class GPX
{
public:
2016-08-09 01:16:19 +02:00
GPX() : _parser(_tracks, _routes, _waypoints), _errorLine(0) {}
2015-10-05 01:43:48 +02:00
bool loadFile(const QString &fileName);
const QString &errorString() const {return _error;}
int errorLine() const {return _errorLine;}
2015-10-12 01:12:12 +02:00
int trackCount() const {return _tracks.count();}
Track track(int i) const {return Track(_tracks.at(i));}
2016-08-09 01:16:19 +02:00
int routeCount() const {return _routes.count();}
Route route(int i) const {return Route(_routes.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;
int _errorLine;
2016-02-19 21:42:54 +01:00
QList<QVector<Trackpoint> > _tracks;
2016-08-09 01:16:19 +02:00
QList<QVector<Waypoint> > _routes;
2016-02-19 21:42:54 +01:00
QList<Waypoint> _waypoints;
2015-10-05 01:43:48 +02:00
};
#endif // GPX_H