diff Core/Lua/LuaContext.h @ 1051:92f4bf2c5d73

HTTP GET in Lua
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 23 Jul 2014 12:59:28 +0200
parents cf52f3bcb2b3
children cc4ff680e2a0
line wrap: on
line diff
--- a/Core/Lua/LuaContext.h	Wed Jul 23 11:36:35 2014 +0200
+++ b/Core/Lua/LuaContext.h	Wed Jul 23 12:59:28 2014 +0200
@@ -33,6 +33,7 @@
 #pragma once
 
 #include "LuaException.h"
+#include "../HttpClient.h"
 
 extern "C" 
 {
@@ -40,7 +41,6 @@
 }
 
 #include <EmbeddedResources.h>
-
 #include <boost/noncopyable.hpp>
 
 namespace Orthanc
@@ -52,12 +52,19 @@
 
     lua_State *lua_;
     std::string log_;
+    HttpClient httpClient_;
+
+    static LuaContext& GetLuaContext(lua_State *state);
 
     static int PrintToLog(lua_State *L);
 
+    static int CallHttpGet(lua_State *L);
+
     void Execute(std::string* output,
                  const std::string& command);
 
+    void PushJson(const Json::Value& value);
+    
   public:
     LuaContext();