MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / member_to_string

Function member_to_string

ogsr_engine/xrGame/script_engine_help.cpp:109–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109static 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
154static void print_class(lua_State* L, luabind::detail::class_rep* crep)
155{

Callers 1

print_classFunction · 0.85

Calls 9

lua_getupvalueFunction · 0.85
to_stringFunction · 0.85
lua_stateMethod · 0.80
typeMethod · 0.80
lua_touserdataFunction · 0.50
pushvalueMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected