-
Notifications
You must be signed in to change notification settings - Fork 0
/
NVParser.h
59 lines (45 loc) · 1.01 KB
/
NVParser.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
#ifndef NVPARSER_H
#define NVPARSER_H
#include <QString>
#include <QList>
#include "Rectangle.h"
#include "Record.h"
#include "RecordCoords.h"
class QTextStream;
class QFile;
class QRegExp;
class NVParser
{
public:
NVParser();
~NVParser();
void setInputFileName(const QString& fileName);
void setOutputFileName(const QString& fileName);
void startParsing();
double getTotalCash() const;
uint getProcessedNrPages() const;
uint getTotalNrRecords() const;
private:
void parseLine(const QString& line);
void processWord(const QString& word);
void flushRecord();
private:
QString m_InFileName;
QString m_OutFileName;
QTextStream* m_out;
QFile* m_outFile;
QFile* m_logFile;
QTextStream* m_logStream;
double totalCash;
uint nrPages;
uint nrRecords;
QRegExp* pagesRx;
QRegExp* digitRx;
Rectangle rect;
Record record;
bool newRecord;
RecordCoords recCoords;
bool firstRecordFlushed;
bool process;
};
#endif // NVPARSER_H