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

Function json_load

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

Source from the content-addressed store, hash-verified

111
112
113static int json_load(lua_State* L)
114{
115 const char* filename = luaL_checklstring(L, 1, NULL);
116 FILE* fp = file::open(filename, "rb");
117 if (fp == NULL)
118 luaL_error(L, "error while open file: %s", filename);
119
120 char buffer[512];
121 FileReadStream fs(fp, buffer, sizeof(buffer));
122 AutoUTFInputStream<unsigned, FileReadStream> eis(fs);
123
124 int n = values::pushDecoded(L, eis);
125
126 fclose(fp);
127 return n;
128}
129
130struct Key
131{

Callers

nothing calls this directly

Calls 4

luaL_checklstringFunction · 0.85
openFunction · 0.85
luaL_errorFunction · 0.85
pushDecodedFunction · 0.85

Tested by

no test coverage detected