LuaTable.readString

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.

struct LuaTable
@trusted
bool
readString
(
T
)
(
T key
,
scope void delegate
(
in char[] str
)
dg
)

Parameters

key T

lookup _key

dg void delegate
(
in char[] str
)

delegate to receive string

Return Value

Type: bool

true if the value for key was a string and passed to dg, false otherwise

Examples

t[2] = "two";
t.readString(2, str => assert(str == "two"));

Meta