-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy patheeparser.h
63 lines (53 loc) · 1.38 KB
/
eeparser.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 EEPARSER_H
#define EEPARSER_H
#include <QObject>
#include <QTextStream>
#include <QRegularExpression>
#include <QFile>
#include "logevent.h"
class QFileSystemWatcher;
class QSettings;
namespace Yate {
class FileWatcher;
class EEParser: public QObject
{
Q_OBJECT
public:
EEParser(QString logFilename, bool isLive = false, QObject *parent = nullptr);
bool liveParsing() const;
void setLiveParsing(bool newLiveParsing);
const QString &filename() const;
void setFilename(const QString &newFilename);
int currentPosition() const;
void setCurrentPosition(int newCurrentPosition);
static LogEventType msgToEventType(QString msg, int &val, QString& strVal);
private slots:
void onFileChanged(bool exist);
public slots:
void startOffline();
void startLive();
void reset();
void parseLine(QString &line);
void stopParsing();
signals:
void parsingStarted();
void parsingFinished();
void parsingReset();
void parsingError(QString);
void logEvent(Yate::LogEvent &e);
void startWatcher();
void stopWatcher();
private:
QString filename_;
bool liveParsing_;
QSettings *settings_;
int currentPosition_;
int evtId_;
QRegularExpression lineParseRegex_;
FileWatcher *watcher_;
bool logDoesNotExist_;
bool hostJustUnloaded_;
void processFileContent(QFile &logFile);
};
}
#endif // EEPARSER_H