diff OrthancServer/LuaScripting.cpp @ 1455:a68545767975

Initialize() and Finalize() events in Lua
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 02 Jul 2015 15:17:19 +0200
parents 164a381abb2b
children 68827c07e683
line wrap: on
line diff
--- a/OrthancServer/LuaScripting.cpp	Thu Jul 02 12:30:55 2015 +0200
+++ b/OrthancServer/LuaScripting.cpp	Thu Jul 02 15:17:19 2015 +0200
@@ -488,4 +488,16 @@
 
     return true;
   }
+
+
+  void LuaScripting::Execute(const std::string& command)
+  {
+    LuaScripting::Locker locker(*this);
+      
+    if (locker.GetLua().IsExistingFunction(command.c_str()))
+    {
+      LuaFunctionCall call(locker.GetLua(), command.c_str());
+      call.Execute();
+    }
+  }
 }