summaryrefslogtreecommitdiff
path: root/client/formatparser.cc
diff options
context:
space:
mode:
authordeva <deva>2009-02-12 14:42:12 +0000
committerdeva <deva>2009-02-12 14:42:12 +0000
commit9be2869c6ebad21621e10b3bd9e82dc811b75d2d (patch)
tree499aa5af9dfd80aae4c07437f2f55f21241e5891 /client/formatparser.cc
parent22e0b0ddd78f13b2648befe892d9ec6c5b1b1229 (diff)
Added formatlanguage attribute to metawidget, and implemented lua parser for it.
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 "";
+}