Represents a Lua table.
LuaTable sub-types luad.base.LuaObject through this reference.
Lookup a value in this table or in a sub-table of this table.
T | type of value |
U args | list of keys, where all keys but the last one should result in a table |
auto execute = lua.get!LuaFunction("os", "execute"); execute(`echo hello, world!`);
Read a string value in this table without making a copy of the string. The read string is passed to dg, and should not be escaped. If the value for key is not a string, dg is not called.
T key | lookup key |
void delegate(in char[] str) dg | delegate to receive string |
t[2] = "two"; t.readString(2, str => assert(str == "two"));
Same as calling get!LuaObject with the same arguments.
auto luapath = lua["package", "path"]; writefln("LUA_PATH:\n%s", luapath);
Set a key-value pair in this table.
T key | key to set |
U value | value for key |
Set a key-value pair this table or in a sub-table of this table.
T value | value to set |
U args | list of keys, where all keys but the last one should result in a table |
lua["string", "empty"] = (in char[] s){ return s.length == 0; }; lua.doString(`assert(string.empty(""))`);
Create struct of type T and fill its members with fields from this table.
Struct fields that are not present in this table are left at their default value.
T | any struct type |
Fill a struct's members with fields from this table.
T s | struct to fill |
Set the metatable for this table.
LuaTable meta | new metatable |
Get the metatable for this table.
Get the array length of the table.
Iterate over the values in this table.
Iterate over the key-value pairs in this table.