MCPcopy Create free account
hub / github.com/Tencent/UnLua / json_encode

Function json_encode

Plugins/UnLuaExtensions/LuaRapidjson/Source/src/rapidjson.cpp:337–350  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

335
336
337static int json_encode(lua_State* L)
338{
339 try{
340 Encoder encode(L, 2);
341 StringBuffer s;
342 encode.encode(L, &s, 1);
343 lua_pushlstring(L, s.GetString(), s.GetSize());
344 return 1;
345 }
346 catch (...) {
347 luaL_error(L, "error while encoding");
348 }
349 return 0;
350}
351
352
353static int json_dump(lua_State* L)

Callers

nothing calls this directly

Calls 4

lua_pushlstringFunction · 0.85
luaL_errorFunction · 0.85
encodeMethod · 0.80
GetSizeMethod · 0.45

Tested by

no test coverage detected