forked from uyras/partsEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
loadhelper.h
46 lines (37 loc) · 1.19 KB
/
loadhelper.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
#ifndef LOADHELPER_H
#define LOADHELPER_H
#include <QString>
#include <QFile>
#include <QTextStream>
#include <QDebug>
class PartArray;
class LoadHelper
{
friend class PartArray;
public:
LoadHelper(QString file);
virtual ~LoadHelper();
bool validate();
void parseHeader(); //спарсить заголовок в свою внутреннюю структуру
bool go(QString section); //переместить курсор к определенной секции
bool go(unsigned int num); //переместить курсо к секции num
void close();
//функции чтения
QString line();
bool end();
LoadHelper & operator >>(double & num);
LoadHelper & operator >>(int & num);
LoadHelper & operator >>(long & num);
LoadHelper & operator >>(unsigned int & num);
LoadHelper & operator >>(QString & num);
LoadHelper & operator >>(bool & num);
void applyHeader(PartArray* sys);
static int version(QString file);
std::map<QString,QString> params;
private:
void applyHeader(PartArray *sys, bool readAnyWay);
QMap<QString,QString> dumpFileContent();
QFile f;
QTextStream s;
};
#endif // LOADHELPER_H