-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathweighttablemodelio.h
63 lines (45 loc) · 1.01 KB
/
weighttablemodelio.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef WEIGHTTABLEMODELIO_H
#define WEIGHTTABLEMODELIO_H
#include <QString>
#include <QFile>
#include <vector>
#include "datapoint.h"
namespace weighttracker {
class WeightTableModel;
class WeightDataManager;
class WeightTableModelIO
{
public:
WeightTableModelIO() = default;
~WeightTableModelIO() = default;
static bool populateModelFromFile(WeightTableModel& model, const QString& fileName);
static bool writeModelToFile(WeightTableModel& model, const QString& fileName);
};
class WeightDataReader
{
public:
virtual bool read(DataVector& data) = 0;
};
class XMLReader : public WeightDataReader
{
public:
XMLReader(QString filename);
bool read(DataVector& data) override;
private:
QFile file_;
};
class WeightDataWriter
{
public:
virtual bool write(const DataVector& data) = 0;
};
class XMLWriter : public WeightDataWriter
{
public:
XMLWriter(QString filename);
bool write(const DataVector& data) override;
private:
QFile file_;
};
}
#endif // WEIGHTTABLEMODELIO_H