25 #ifndef FITSTREAMREADER_P_H
26 #define FITSTREAMREADER_P_H
33 #include <QVersionNumber>
43 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
63 template<
class T> quint8
peekByte(
const int pos=0)
const;
64 template<
class T> QByteArray
readBytes(
const size_t size);
#define QTFIT_END_NAMESPACE
Macro for ending the QtFit library's top-most namespace (if one is defined).
#define QTFIT_BEGIN_NAMESPACE
Macro for starting the QtFit library's top-most namespace (if one is defined).
The AbstractDataMessage class is the polymorphic base class for all FIT Data Message classes.
Provides private implementation for FitStreamReader.
quint32 expectedDataSize
Total size, in bytes, expected to comprise the FIT file.
AbstractDataMessage * readNextDataMessage()
Reads up to, and including, the next FIT Data Message.
QIODevice * device
FIT File IO stream (alternative to data and dataOffset).
static bool isDefinitionMessage(const quint8 recordHeader)
Returns true if recordHeader indicates a Definition Message, otherwise false.
bool parseDefinitionMessage()
Reads and parses a FIT Definition Message.
QByteArray data
FIT File data (alternative to device).
quint8 peekByte(const int pos=0) const
Peeks the next pos'th byte in the FIT stream.
FitStreamReader *const q_ptr
Internal q-pointer.
static quint16 fitChecksum(const QByteArray &data)
Calculates a checksum, as per the algorithm used by FIT file headers.
AbstractDataMessage * parseDataMessage()
Reads and parses a FIT Data Message.
QVersionNumber profileVersion
Protocol version read from the parsed FIT file header.
size_t bytesAvailable() const
Returns the number of bytes currently available for reading.
QByteArray readFileHeader()
Reads all bytes of the FIT stream file header.
QVersionNumber protocolVersion
Protocol version read from the parsed FIT file header.
size_t dataOffset
Current position within data.
QHash< int, DataDefinition > dataDefinitions
Local message types to current data definitions.
FitStreamReaderPrivate(FitStreamReader *const q)
Constructs a FitStreamReaderPrivate object, with public implementation q.
qsizetype size_t
Size type for size-related operations.
bool parseFileHeader()
Reads and parses the FIT stream's file header.
QByteArray readBytes(const size_t size)
Reads the next size bytes from the FIT stream.
virtual ~FitStreamReaderPrivate()
Destroys the FitStreamReaderPrivate object.
QHash< int, int > recordSizes
Local message types to current record sizes.
The FitStreamReader class provides a streaming parser for reading Garmin FIT files.
Internal types used by QtFit classes.