Fixed error line reporting in CSV-based files
[GPXSee.git] / src / data / fitparser.h
blob22df58ede07a6c6b201f280fea466a00ce568724
1 #ifndef FITPARSER_H
2 #define FITPARSER_H
4 #include "parser.h"
6 class QFile;
8 class FITParser : public Parser
10 public:
11 bool parse(QFile *file, QList<TrackData> &tracks, QList<RouteData> &routes,
12 QList<Area> &polygons, QVector<Waypoint> &waypoints);
13 QString errorString() const {return _errorString;}
14 int errorLine() const {return 0;}
16 private:
17 struct Field;
18 class MessageDefinition;
19 class CTX;
21 bool readData(QFile *file, char *data, size_t size);
22 template<class T> bool readValue(CTX &ctx, T &val);
23 bool skipValue(CTX &ctx, quint8 size);
24 bool readField(CTX &ctx, Field *field, QVariant &val, bool &valid);
26 bool parseHeader(CTX &ctx);
27 bool parseRecord(CTX &ctx);
28 bool parseDefinitionMessage(CTX &ctx, quint8 header);
29 bool parseCompressedMessage(CTX &ctx, quint8 header);
30 bool parseDataMessage(CTX &ctx, quint8 header);
31 bool parseData(CTX &ctx, const MessageDefinition *def);
33 QString _errorString;
36 #endif // FITPARSER_H