Mercurial > hg > orthanc
annotate Core/Lua/LuaFunctionCall.cpp @ 999:db18c071fbd7 lua-scripting
store-scu filter
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 04 Jul 2014 14:09:53 +0200 |
parents | 1b1d51e9f1a2 |
children | 160dfe770618 |
rev | line source |
---|---|
386 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
689 | 3 * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, |
386 | 4 * Belgium |
5 * | |
6 * This program is free software: you can redistribute it and/or | |
7 * modify it under the terms of the GNU General Public License as | |
8 * published by the Free Software Foundation, either version 3 of the | |
9 * License, or (at your option) any later version. | |
10 * | |
11 * In addition, as a special exception, the copyright holders of this | |
12 * program give permission to link the code of its release with the | |
13 * OpenSSL project's "OpenSSL" library (or with modified versions of it | |
14 * that use the same license as the "OpenSSL" library), and distribute | |
15 * the linked executables. You must obey the GNU General Public License | |
16 * in all respects for all of the code used other than "OpenSSL". If you | |
17 * modify file(s) with this exception, you may extend this exception to | |
18 * your version of the file(s), but you are not obligated to do so. If | |
19 * you do not wish to do so, delete this exception statement from your | |
20 * version. If you delete this exception statement from all source files | |
21 * in the program, then also delete it here. | |
22 * | |
23 * This program is distributed in the hope that it will be useful, but | |
24 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
26 * General Public License for more details. | |
27 * | |
28 * You should have received a copy of the GNU General Public License | |
29 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
30 **/ | |
31 | |
32 | |
824
a811bdf8b8eb
precompiled headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
33 #include "../PrecompiledHeaders.h" |
386 | 34 #include "LuaFunctionCall.h" |
35 | |
996
cf52f3bcb2b3
clarification of Lua classes wrt multithreading
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
36 #include <cassert> |
997
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
37 #include <stdio.h> |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
38 #include <boost/lexical_cast.hpp> |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
39 #include <glog/logging.h> |
386 | 40 |
41 namespace Orthanc | |
42 { | |
43 void LuaFunctionCall::CheckAlreadyExecuted() | |
44 { | |
45 if (isExecuted_) | |
46 { | |
47 throw LuaException("Arguments cannot be pushed after the function is executed"); | |
48 } | |
49 } | |
50 | |
51 LuaFunctionCall::LuaFunctionCall(LuaContext& context, | |
52 const char* functionName) : | |
53 context_(context), | |
54 isExecuted_(false) | |
55 { | |
56 // Clear the stack to fulfill the invariant | |
57 lua_settop(context_.lua_, 0); | |
58 lua_getglobal(context_.lua_, functionName); | |
59 } | |
60 | |
61 void LuaFunctionCall::PushString(const std::string& value) | |
62 { | |
63 CheckAlreadyExecuted(); | |
64 lua_pushstring(context_.lua_, value.c_str()); | |
65 } | |
66 | |
67 void LuaFunctionCall::PushBoolean(bool value) | |
68 { | |
69 CheckAlreadyExecuted(); | |
70 lua_pushboolean(context_.lua_, value); | |
71 } | |
72 | |
73 void LuaFunctionCall::PushInteger(int value) | |
74 { | |
75 CheckAlreadyExecuted(); | |
76 lua_pushinteger(context_.lua_, value); | |
77 } | |
78 | |
79 void LuaFunctionCall::PushDouble(double value) | |
80 { | |
81 CheckAlreadyExecuted(); | |
82 lua_pushnumber(context_.lua_, value); | |
83 } | |
84 | |
997
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
85 void LuaFunctionCall::PushJson(const Json::Value& value) |
386 | 86 { |
87 CheckAlreadyExecuted(); | |
88 | |
89 if (value.isString()) | |
90 { | |
91 lua_pushstring(context_.lua_, value.asCString()); | |
92 } | |
93 else if (value.isDouble()) | |
94 { | |
95 lua_pushnumber(context_.lua_, value.asDouble()); | |
96 } | |
97 else if (value.isInt()) | |
98 { | |
99 lua_pushinteger(context_.lua_, value.asInt()); | |
100 } | |
101 else if (value.isUInt()) | |
102 { | |
103 lua_pushinteger(context_.lua_, value.asUInt()); | |
104 } | |
105 else if (value.isBool()) | |
106 { | |
107 lua_pushboolean(context_.lua_, value.asBool()); | |
108 } | |
109 else if (value.isNull()) | |
110 { | |
111 lua_pushnil(context_.lua_); | |
112 } | |
113 else if (value.isArray()) | |
114 { | |
115 lua_newtable(context_.lua_); | |
116 | |
117 // http://lua-users.org/wiki/SimpleLuaApiExample | |
118 for (Json::Value::ArrayIndex i = 0; i < value.size(); i++) | |
119 { | |
120 // Push the table index (note the "+1" because of Lua conventions) | |
121 lua_pushnumber(context_.lua_, i + 1); | |
122 | |
123 // Push the value of the cell | |
997
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
124 PushJson(value[i]); |
386 | 125 |
126 // Stores the pair in the table | |
127 lua_rawset(context_.lua_, -3); | |
128 } | |
129 } | |
130 else if (value.isObject()) | |
131 { | |
132 lua_newtable(context_.lua_); | |
133 | |
134 Json::Value::Members members = value.getMemberNames(); | |
135 | |
136 for (Json::Value::Members::const_iterator | |
656 | 137 it = members.begin(); it != members.end(); ++it) |
386 | 138 { |
139 // Push the index of the cell | |
140 lua_pushstring(context_.lua_, it->c_str()); | |
141 | |
142 // Push the value of the cell | |
997
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
143 PushJson(value[*it]); |
386 | 144 |
145 // Stores the pair in the table | |
146 lua_rawset(context_.lua_, -3); | |
147 } | |
148 } | |
149 else | |
150 { | |
151 throw LuaException("Unsupported JSON conversion"); | |
152 } | |
153 } | |
154 | |
997
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
155 void LuaFunctionCall::ExecuteInternal(int numOutputs) |
386 | 156 { |
157 CheckAlreadyExecuted(); | |
158 | |
159 assert(lua_gettop(context_.lua_) >= 1); | |
160 int nargs = lua_gettop(context_.lua_) - 1; | |
161 int error = lua_pcall(context_.lua_, nargs, numOutputs, 0); | |
162 | |
163 if (error) | |
164 { | |
165 assert(lua_gettop(context_.lua_) >= 1); | |
166 | |
167 std::string description(lua_tostring(context_.lua_, -1)); | |
168 lua_pop(context_.lua_, 1); /* pop error message from the stack */ | |
169 throw LuaException(description); | |
170 } | |
171 | |
172 if (lua_gettop(context_.lua_) < numOutputs) | |
173 { | |
174 throw LuaException("The function does not give the expected number of outputs"); | |
175 } | |
176 | |
177 isExecuted_ = true; | |
178 } | |
179 | |
180 bool LuaFunctionCall::ExecutePredicate() | |
181 { | |
997
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
182 ExecuteInternal(1); |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
183 |
386 | 184 if (!lua_isboolean(context_.lua_, 1)) |
185 { | |
186 throw LuaException("The function is not a predicate (only true/false outputs allowed)"); | |
187 } | |
188 | |
189 return lua_toboolean(context_.lua_, 1) != 0; | |
190 } | |
997
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
191 |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
192 |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
193 static void PopJson(Json::Value& result, |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
194 lua_State* lua, |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
195 int top) |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
196 { |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
197 if (lua_istable(lua, top)) |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
198 { |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
199 Json::Value tmp = Json::objectValue; |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
200 bool isArray = true; |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
201 size_t size = 0; |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
202 |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
203 // http://stackoverflow.com/a/6142700/881731 |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
204 |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
205 // Push another reference to the table on top of the stack (so we know |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
206 // where it is, and this function can work for negative, positive and |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
207 // pseudo indices |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
208 lua_pushvalue(lua, top); |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
209 // stack now contains: -1 => table |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
210 lua_pushnil(lua); |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
211 // stack now contains: -1 => nil; -2 => table |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
212 while (lua_next(lua, -2)) |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
213 { |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
214 // stack now contains: -1 => value; -2 => key; -3 => table |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
215 // copy the key so that lua_tostring does not modify the original |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
216 lua_pushvalue(lua, -2); |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
217 // stack now contains: -1 => key; -2 => value; -3 => key; -4 => table |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
218 std::string key(lua_tostring(lua, -1)); |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
219 Json::Value v; |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
220 PopJson(v, lua, -2); |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
221 |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
222 tmp[key] = v; |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
223 |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
224 size += 1; |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
225 try |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
226 { |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
227 if (boost::lexical_cast<size_t>(key) != size) |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
228 { |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
229 isArray = false; |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
230 } |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
231 } |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
232 catch (boost::bad_lexical_cast&) |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
233 { |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
234 isArray = false; |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
235 } |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
236 |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
237 // pop value + copy of key, leaving original key |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
238 lua_pop(lua, 2); |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
239 // stack now contains: -1 => key; -2 => table |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
240 } |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
241 // stack now contains: -1 => table (when lua_next returns 0 it pops the key |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
242 // but does not push anything.) |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
243 // Pop table |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
244 lua_pop(lua, 1); |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
245 |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
246 // Stack is now the same as it was on entry to this function |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
247 |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
248 if (isArray) |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
249 { |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
250 result = Json::arrayValue; |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
251 for (size_t i = 0; i < size; i++) |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
252 { |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
253 result.append(tmp[boost::lexical_cast<std::string>(i + 1)]); |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
254 } |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
255 } |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
256 else |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
257 { |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
258 result = tmp; |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
259 } |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
260 } |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
261 else if (lua_isnumber(lua, top)) |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
262 { |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
263 result = static_cast<float>(lua_tonumber(lua, top)); |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
264 } |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
265 else if (lua_isstring(lua, top)) |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
266 { |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
267 result = std::string(lua_tostring(lua, top)); |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
268 } |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
269 else |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
270 { |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
271 LOG(WARNING) << "Unsupported Lua type when returning Json"; |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
272 result = Json::nullValue; |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
273 } |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
274 } |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
275 |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
276 |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
277 void LuaFunctionCall::ExecuteToJson(Json::Value& result) |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
278 { |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
279 ExecuteInternal(1); |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
280 PopJson(result, context_.lua_, lua_gettop(context_.lua_)); |
1b1d51e9f1a2
return Json from Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
996
diff
changeset
|
281 } |
386 | 282 } |