| 33 | using namespace luabind::detail; |
| 34 | |
| 35 | LUABIND_API std::string luabind::detail::stack_content_by_name(lua_State* L, int start_index) |
| 36 | { |
| 37 | std::string ret; |
| 38 | int top = lua_gettop(L); |
| 39 | for (int i = start_index; i <= top; ++i) |
| 40 | { |
| 41 | object_rep* obj = get_instance(L, i); |
| 42 | class_rep* crep = is_class_rep(L, i) |
| 43 | ? static_cast<class_rep*>(lua_touserdata(L, i)) : 0; |
| 44 | if (obj == 0 && crep == 0) |
| 45 | { |
| 46 | int type = lua_type(L, i); |
| 47 | ret += lua_typename(L, type); |
| 48 | } |
| 49 | else if (obj) |
| 50 | { |
| 51 | if (obj->is_const()) ret += "const "; |
| 52 | ret += obj->crep()->name(); |
| 53 | } |
| 54 | else if (crep) |
| 55 | { |
| 56 | ret += "<"; |
| 57 | ret += crep->name(); |
| 58 | ret += ">"; |
| 59 | } |
| 60 | if (i < top) ret += ", "; |
| 61 | } |
| 62 | return ret; |
| 63 | } |
nothing calls this directly
no test coverage detected