Rename get_json_value to read_json_value
This commit is contained in:
parent
bd8ddf1a52
commit
a9df87ede0
@ -1088,7 +1088,7 @@ bool push_json_value(lua_State *L, const Json::Value &value, int nullindex)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Converts Lua table --> JSON
|
// Converts Lua table --> JSON
|
||||||
void get_json_value(lua_State *L, Json::Value &root, int index)
|
void read_json_value(lua_State *L, Json::Value &root, int index)
|
||||||
{
|
{
|
||||||
int type = lua_type(L, index);
|
int type = lua_type(L, index);
|
||||||
if (type == LUA_TBOOLEAN) {
|
if (type == LUA_TBOOLEAN) {
|
||||||
@ -1104,7 +1104,7 @@ void get_json_value(lua_State *L, Json::Value &root, int index)
|
|||||||
while (lua_next(L, index)) {
|
while (lua_next(L, index)) {
|
||||||
// Key is at -2 and value is at -1
|
// Key is at -2 and value is at -1
|
||||||
Json::Value value;
|
Json::Value value;
|
||||||
get_json_value(L, value, lua_gettop(L));
|
read_json_value(L, value, lua_gettop(L));
|
||||||
|
|
||||||
Json::ValueType roottype = root.type();
|
Json::ValueType roottype = root.type();
|
||||||
int keytype = lua_type(L, -1);
|
int keytype = lua_type(L, -1);
|
||||||
|
@ -150,7 +150,7 @@ void luaentity_get (lua_State *L,u16 id);
|
|||||||
bool push_json_value (lua_State *L,
|
bool push_json_value (lua_State *L,
|
||||||
const Json::Value &value,
|
const Json::Value &value,
|
||||||
int nullindex);
|
int nullindex);
|
||||||
void get_json_value (lua_State *L,
|
void read_json_value (lua_State *L,
|
||||||
Json::Value &root,
|
Json::Value &root,
|
||||||
int index);
|
int index);
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ int ModApiUtil::l_write_json(lua_State *L)
|
|||||||
|
|
||||||
Json::Value root;
|
Json::Value root;
|
||||||
try {
|
try {
|
||||||
get_json_value(L, root, 1);
|
read_json_value(L, root, 1);
|
||||||
} catch (SerializationError &e) {
|
} catch (SerializationError &e) {
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
lua_pushstring(L, e.what());
|
lua_pushstring(L, e.what());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user