C++ Web Framework  3.0
cstlcompiler.h
1 /*
2  Copyright 2017 Herik Lima de Castro and Marcelo Medeiros Eler
3  Distributed under MIT license, or public domain if desired and
4  recognized in your jurisdiction.
5  See file LICENSE for detail.
6 */
7 
8 #ifndef CSTLCOMPILER_H
9 #define CSTLCOMPILER_H
10 
11 #include <QMap>
12 #include <QFile>
13 #include <QString>
14 #include <QXmlStreamReader>
15 #include <QXmlStreamWriter>
16 #include <QStringList>
17 #include <QMetaObject>
18 #include <QMetaMethod>
19 #include "properties.h"
20 #include "qlistobject.h"
21 #include "cppwebframework_global.h"
22 
23 CWF_BEGIN_NAMESPACE
27 class CPPWEBFRAMEWORKSHARED_EXPORT CSTLCompiler
28 {
29  QByteArray str;
30  QString path;
31  QMap<QString, QObject *> &objects;
32  bool isStrFileName;
33  bool isView = true;
39  QByteArray openFile(QXmlStreamReader &xml);
45  QByteArray processXml(QXmlStreamReader &xml);
51  QByteArray processOutTag(QMap<QString, QString> &attr);
57  QByteArray processForTag(QXmlStreamReader &xml);
63  QByteArray processIfTag(QXmlStreamReader &xml);
70  QByteArray getBody(QXmlStreamReader &xml, const QString &tagName);
71 
72 
73  void processText(QString &text);
74 public:
81  CSTLCompiler(const QByteArray &str, const QString &path, QMap<QString, QObject *> &objects, bool isStrFileName = true);
86  QByteArray output();
87 };
88 
89 CWF_END_NAMESPACE
90 
91 #endif // CSTLCOMPILER_H
This class compiles view pages with CSTL (C++ Server Pages Standard Tags Library).
Definition: cstlcompiler.h:27