-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathWorker.h
More file actions
44 lines (38 loc) · 985 Bytes
/
Worker.h
File metadata and controls
44 lines (38 loc) · 985 Bytes
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
#pragma once
#include <QList>
#include <QString>
namespace Meta {
struct Arg {
QString type;
QString name;
};
struct Property : Arg {
QString notify;
QString get;
QString set;
bool readonly = false;
};
struct Method {
bool isNotifyMethod = false;
QString name;
QString returnType;
QList<Arg> args;
};
struct MetaObj {
QString name;
QList<Property> properties;
QList<Method> methods;
};
} // namespace Meta
class Worker {
public:
void work(const QString &inputFile, const QString &outputFile);
private:
void parseLine(const QString &line);
void parseProperty(const QString &line);
void parseFunction(bool isInvok, const QString &type, const QString &name, const QString &args);
void parseArgs(QList<Meta::Arg> &args, const QString &argsStr);
void writeTs(const QString &outputFile);
private:
Meta::MetaObj m_obj;
};