QtFit  0.1
Internal library development documentation
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
fitstreamreader.h
Go to the documentation of this file.
1 /*
2  Copyright 2021 Paul Colby
3 
4  This file is part of QtFit.
5 
6  QtFit is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  QtFit is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with QtFit. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 /*!
21  * \file
22  * Declares the FitStreamReader class.
23  */
24 
25 #ifndef FITSTREAMREADER_H
26 #define FITSTREAMREADER_H
27 
28 #include "abstractdatamessage.h"
29 
30 #include <QIODevice>
31 #include <QVersionNumber>
32 
34 
36 
38 
39 public:
41  explicit FitStreamReader(const QByteArray &data);
42  explicit FitStreamReader(QIODevice *device);
43  ~FitStreamReader();
44 
45  void addData(const QByteArray &data);
46  bool atEnd() const;
47  void clear();
48  QIODevice *device() const;
49  // [enum] Error error() const; or lastError?
50  // QString errorString() const;
51  void setDevice(QIODevice *device);
52 
53 // quint8 headerSize() const;
54  QVersionNumber protocolVersion() const;
55  QVersionNumber profileVersion() const;
56 // quint32 expectedDataSize() const;
57 // quint32 expectedChecksum() const;
58 
59  AbstractDataMessage * readNext(); // Will consume the file header, defn records, and data message headers.
60 
61 protected:
62  /// \cond internal
63  FitStreamReaderPrivate * const d_ptr; ///< Internal d-pointer.
64  explicit FitStreamReader(FitStreamReaderPrivate * const d);
65  /// \endcond
66 
67 private:
68  Q_DECLARE_PRIVATE(FitStreamReader)
69  Q_DISABLE_COPY(FitStreamReader)
70 
71 };
72 
74 
75 #endif // FITSTREAMREADER_H
#define QTFIT_EXPORT
QtFit library export/import macro.
Definition: QtFit_global.h:42
#define QTFIT_END_NAMESPACE
Macro for ending the QtFit library's top-most namespace (if one is defined).
Definition: QtFit_global.h:78
#define QTFIT_BEGIN_NAMESPACE
Macro for starting the QtFit library's top-most namespace (if one is defined).
Definition: QtFit_global.h:77
Declares the AbstractDataMessage class.
The AbstractDataMessage class is the polymorphic base class for all FIT Data Message classes.
Provides private implementation for FitStreamReader.
The FitStreamReader class provides a streaming parser for reading Garmin FIT files.
FitStreamReaderPrivate *const d_ptr
Internal d-pointer.