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

Function pushDecoded

Plugins/UnLuaExtensions/LuaRapidjson/Source/src/values.hpp:246–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244
245 template<typename Stream>
246 inline int pushDecoded(lua_State* L, Stream& s) {
247 int top = lua_gettop(L);
248 values::ToLuaHandler handler(L);
249 rapidjson::Reader reader;
250 rapidjson::ParseResult r = reader.Parse(s, handler);
251
252 if (!r) {
253 lua_settop(L, top);
254 lua_pushnil(L);
255 lua_pushfstring(L, "%s (%d)", rapidjson::GetParseError_En(r.Code()), r.Offset());
256 return 2;
257 }
258
259 return 1;
260 }
261
262 inline int pushDecoded(lua_State* L, const char* ptr, size_t len) {
263 rapidjson::extend::StringStream s(ptr, len);

Callers 2

json_decodeFunction · 0.85
json_loadFunction · 0.85

Calls 7

lua_gettopFunction · 0.85
lua_settopFunction · 0.85
lua_pushnilFunction · 0.85
lua_pushfstringFunction · 0.85
CodeMethod · 0.80
OffsetMethod · 0.80
ParseMethod · 0.45

Tested by

no test coverage detected