MagicSmoke  $VERSION$
stick_p.h
Go to the documentation of this file.
1 //
2 // C++ Interface: Stick Renderer Private
3 //
4 // Description: Stick Renderer for Qt, implements a twig-like syntax
5 //
6 //
7 // Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2016
8 //
9 // Copyright: See README/COPYING.GPL files that come with this distribution
10 //
11 //
12 
13 #ifndef MAGICSMOKE_STICK_PH
14 #define MAGICSMOKE_STICK_PH
15 
16 #include <QObject>
17 #include <QVariant>
18 #include <QMap>
19 #include <QStringList>
20 
21 class MStickRenderer;
22 namespace ELAM {class Engine;}
23 
25 {
26 public:
27 // MStickToken(QString);
28  MStickToken()=default;
29  MStickToken(const MStickToken&)=default;
30  MStickToken(MStickToken&&)=default;
31 
32  MStickToken& operator=(const MStickToken&)=default;
33  MStickToken& operator=(MStickToken&&)=default;
34 
35  QString render(MStickRenderer&,ELAM::Engine&);
36 
37  bool hasError()const{return !merror.isEmpty();}
38 
39  enum class Type{
41  ForLoop,
44  IfElse,
45  Else,
46  Comment,
47  Text,
48  EndIf,
49  EndFor
50  };
51 private:
52  friend class MStickTokenizer;
53  MStickToken(QStringList&);
54  void parseCommand(QStringList&);
55 
57  QList<MStickToken>msubtokens;
58  QString mcontent,mextra,merror;
59 };
60 
62 {
63 public:
64  MStickTokenizer(QString);
66 private:
67  QStringList mtokens;
68 };
69 
70 #endif
MStickToken()=default
QString render(MStickRenderer &, ELAM::Engine &)
Definition: stick.cpp:191
A Twig-like renderer for HTML pages or other text based documents.
Definition: stick.h:27
Type
Definition: stick_p.h:39
Definition: stick_p.h:61
MStickTokenizer(QString)
Definition: stick.cpp:265
MStickToken & operator=(const MStickToken &)=default
bool hasError() const
Definition: stick_p.h:37
MStickToken * createTokens()
Definition: stick.cpp:305
Definition: stick_p.h:24
Definition: stick.h:24