summaryrefslogtreecommitdiff
path: root/client/formatparser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/formatparser.cc')
-rw-r--r--client/formatparser.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/client/formatparser.cc b/client/formatparser.cc
index 0f04d0a..751c83e 100644
--- a/client/formatparser.cc
+++ b/client/formatparser.cc
@@ -30,7 +30,16 @@
#include <QVariant>
#include <string.h>
-QString format_parser(QString format, QVector< Widget *> widgets)
+#include "lua.h"
+
+static QString format_parser_lua(QString format, QVector< Widget *> widgets)
+{
+ LUA lua(&widgets);
+
+ return lua.runParser(format);
+}
+
+static QString format_parser_pracro(QString format, QVector< Widget *> widgets)
{
QString resume;
QString var;
@@ -172,3 +181,10 @@ QString format_parser(QString format, QSqlQuery &query)
return resume;
}
+
+QString format_parser(QString format, QVector< Widget *> widgets, QString language)
+{
+ if(language == "pracro") return format_parser_pracro(format, widgets);
+ if(language == "lua") return format_parser_lua(format, widgets);
+ return "";
+}