luanoob luanoob - 4 months ago 52
C++ Question

Lua - Reflection - Get list of functions/fields on an object?

I'm new to Lua and dealing with Lua as a scripting language in an alpha release of a program. The developer is unresponsive and I need to get a list of functions provided by some C++ objects which are accessible from the Lua code.

Is there any easy way to see what fields and functions these objects expose?


In Lua, to view the members of a object, you can use:

for key,value in pairs(o) do
    print("found member " .. key);

Unfortunately I don't know if this will work for objects imported from C++.