| 107 | } |
| 108 | |
| 109 | static luabind::internal_string member_to_string(luabind::object const& e, LPCSTR function_signature) |
| 110 | { |
| 111 | using namespace luabind; |
| 112 | lua_State* L = e.lua_state(); |
| 113 | LUABIND_CHECK_STACK(L); |
| 114 | |
| 115 | if (e.type() == LUA_TFUNCTION) |
| 116 | { |
| 117 | e.pushvalue(); |
| 118 | luabind::detail::stack_pop p(L, 1); |
| 119 | |
| 120 | { |
| 121 | if (lua_getupvalue(L, -1, 3) == 0) |
| 122 | return to_string(e); |
| 123 | luabind::detail::stack_pop p2(L, 1); |
| 124 | if (lua_touserdata(L, -1) != reinterpret_cast<void*>(0x1337)) |
| 125 | return to_string(e); |
| 126 | } |
| 127 | |
| 128 | std::stringstream s; |
| 129 | { |
| 130 | lua_getupvalue(L, -1, 2); |
| 131 | luabind::detail::stack_pop p2(L, 1); |
| 132 | } |
| 133 | |
| 134 | { |
| 135 | lua_getupvalue(L, -1, 1); |
| 136 | luabind::detail::stack_pop p2(L, 1); |
| 137 | luabind::detail::method_rep* m = static_cast<luabind::detail::method_rep*>(lua_touserdata(L, -1)); |
| 138 | |
| 139 | for (auto i = m->overloads().begin(); i != m->overloads().end(); ++i) |
| 140 | { |
| 141 | luabind::internal_string str; |
| 142 | i->get_signature(L, str); |
| 143 | if (i != m->overloads().begin()) |
| 144 | s << "\n"; |
| 145 | s << function_signature << process_signature(str) << ";"; |
| 146 | } |
| 147 | } |
| 148 | return s.str().c_str(); |
| 149 | } |
| 150 | |
| 151 | return to_string(e); |
| 152 | } |
| 153 | |
| 154 | static void print_class(lua_State* L, luabind::detail::class_rep* crep) |
| 155 | { |
no test coverage detected