summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/src/luaquerymapper.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/server/src/luaquerymapper.cc b/server/src/luaquerymapper.cc
index 8e154ed..aefbabf 100644
--- a/server/src/luaquerymapper.cc
+++ b/server/src/luaquerymapper.cc
@@ -27,6 +27,7 @@
#include "luaquerymapper.h"
#include <sstream>
+#include <string>
static std::string loadresultstring(QueryResult &res, std::string group = "")
{
@@ -35,6 +36,13 @@ static std::string loadresultstring(QueryResult &res, std::string group = "")
std::map< std::string, std::string >::iterator v = res.values.begin();
while(v != res.values.end()) {
+
+ std::string grp = (*v).first;
+ std::string::size_type idx = -1;
+ while((idx = grp.find(".", idx + 1)) != std::string::npos) {
+ s += group + grp.substr(0, idx) + " = {}\n";
+ }
+
s += group + (*v).first + " = {}\n";
s += group + (*v).first + ".value = \"" + (*v).second + "\"\n";
s += group + (*v).first + ".timestamp = " + timestamp.str() + "\n";