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

前端 未结 4 1171
北恋
北恋 2020-12-23 16:57

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 b

4条回答
  •  一整个雨季
    2020-12-23 17:46

    If allowed in the environment, looking at the metatable of the exported C++ object can help:

    for key,value in pairs(getmetatable(o)) do
        print(key, value)
    end
    

提交回复
热议问题