diff OrthancServer/ServerJobs/SystemCallOperation.cpp @ 2616:2f3007bf0708 jobs

event queues in Lua, serialization of sequence of operations
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 22 May 2018 12:25:37 +0200
parents 25225f0b4f33
children
line wrap: on
line diff
--- a/OrthancServer/ServerJobs/SystemCallOperation.cpp	Mon May 21 09:00:20 2018 +0200
+++ b/OrthancServer/ServerJobs/SystemCallOperation.cpp	Tue May 22 12:25:37 2018 +0200
@@ -111,5 +111,30 @@
       LOG(ERROR) << "Lua: Failed system call - \"" << info << "\": " << e.What();
     }
   }
+
+
+  void SystemCallOperation::Serialize(Json::Value& result) const
+  {
+    result["Type"] = "SystemCall";
+    result["Command"] = command_;
+
+    Json::Value tmp;
+
+    tmp = Json::arrayValue;
+    for (size_t i = 0; i < preArguments_.size(); i++)
+    {
+      tmp.append(preArguments_[i]);
+    }
+
+    result["PreArguments"] = tmp;
+
+    tmp = Json::arrayValue;
+    for (size_t i = 0; i < postArguments_.size(); i++)
+    {
+      tmp.append(postArguments_[i]);
+    }
+
+    result["PostArguments"] = tmp;
+  }
 }