-
Notifications
You must be signed in to change notification settings - Fork 0
/
parsedelements.h
41 lines (31 loc) · 924 Bytes
/
parsedelements.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
#ifndef PARSEDELEMENTS_H
#define PARSEDELEMENTS_H
#include <QHash>
QT_BEGIN_NAMESPACE
namespace Parser { class ParsedElements; }
QT_END_NAMESPACE
class ClassText;
class BaseElement;
class ParsedElements
{
public:
ParsedElements(int patternType, const QHash<QString, QVector<ClassText *>> &parseData);
~ParsedElements();
QHash<QString, BaseElement *> getElements();
bool rewriteInFiles();
bool isOk();
private:
bool ok = false;
enum PATTERN_TYPE { SINLETON = 1, ABSTRACT_FACTORY, BUILDER };
int patternType;
QHash<QString, QVector<ClassText *>> parseData;
QHash<QString, BaseElement *> elements;
bool writeElementsToFile(ClassText *classText);
bool rewriteSingletonInFiles();
bool rewriteAbstractFactoryInFiles();
bool rewriteBuilderInFiles();
void parseSingleton();
void parseAbstractFactory();
void parseBuilder();
};
#endif // PARSEDELEMENTS_H