MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / stack_content_by_name

Method stack_content_by_name

Source/Misc/luabind/src/stack_content_by_name.cpp:35–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33using namespace luabind::detail;
34
35LUABIND_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}

Callers

nothing calls this directly

Calls 6

lua_gettopFunction · 0.85
lua_touserdataFunction · 0.85
lua_typeFunction · 0.85
lua_typenameFunction · 0.85
get_instanceFunction · 0.70
nameMethod · 0.45

Tested by

no test coverage detected