OTQIWZDDZHNEFZRD4LGORAFWA7KEQYVNKUQ4WXAX72FTCDMIUNVQC
4INPF5IJVGBGPKVKFSWITIPKV2LC3XENRZLDYO5HQWRHNNV47RGQC
P5HXZFSDGCYC5L7FY7VATY74WFLGYL4WAERPGTO2P64EURULMV4QC
AUXHSGS4EFOPZ6TVZYWNVOUDO7NYKUKE3HBKGQQWTALSVFOE3HAAC
OYTCBRC7LE44EUVRZVYTOOVKQWJ6P6YE3FXTOGUTNKEMLNWPHKSQC
LE5U6CTXEIETQN5GOVYF2K2VCISRXR3ULORXDKIKWYDVBG5GS3WAC
IGUSSYANPKGMX5YDQC7AI5ZWZLEQPIXA4KG3RZHNPMERL554HQWQC
template <typename list, typename lpush>
static int dlua_gentable(lua_State *ls, const list &strings, lpush push)
{
lua_newtable(ls);
for (int i = 0, size = strings.size(); i < size; ++i)
{
push(ls, strings[i]);
lua_rawseti(ls, -2, i + 1);
}
return (1);
}
inline static void dlua_pushcxxstring(lua_State *ls, const std::string &s)
{
lua_pushstring(ls, s.c_str());
}
template <typename list, typename lpush>
static int dlua_gentable(lua_State *ls, const list &strings, lpush push)
{
lua_newtable(ls);
for (int i = 0, size = strings.size(); i < size; ++i)
{
push(ls, strings[i]);
lua_rawseti(ls, -2, i + 1);
}
return (1);
}
inline static void dlua_pushcxxstring(lua_State *ls, const std::string &s)
{
lua_pushstring(ls, s.c_str());
}
int dlua_stringtable(lua_State *ls, const std::vector<std::string> &s)
{
return dlua_gentable(ls, s, dlua_pushcxxstring);
}