MCPcopy Create free account
hub / github.com/InoriRus/Kyty / DbgPrint

Method DbgPrint

source/lib/Scripts/src/Scripts.cpp:333–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331//}
332
333void ScriptVar::DbgPrint(int depth) const
334{
335 lua_init();
336
337 for (int i = 0; i < depth; i++)
338 {
339 printf(" ");
340 }
341 if (m_p->is_nil)
342 {
343 printf("nil\n");
344 } else if (m_p->is_table)
345 {
346 printf("Table:\n");
347 m_p->val_table.DbgPrint(depth + 1);
348 } else if (m_p->is_c_function)
349 {
350 printf("CFunction\n");
351 } else if (m_p->is_function)
352 {
353 printf("Function:\n");
354 printf("%s\n", m_p->val_function.ToDbgString().C_Str());
355 } else if (m_p->is_userdata)
356 {
357 printf("Userdata: %016" PRIx64 "\n", reinterpret_cast<uint64_t>(m_p->val_userdata));
358 } else
359 {
360#if KYTY_LUA_VER == KYTY_LUA_5_3
361 printf("d: %g, i: %" PRIi64 " s: %s\n", val_double, val_integer, val_string.C_Str());
362#else
363 printf("d: %g, s: %s\n", m_p->val_double, m_p->val_string.C_Str());
364#endif
365 }
366}
367
368ScriptVar::ScriptVar(): m_p(new ScriptVarPrivate)
369{

Callers 2

ArgDbgDumpFunction · 0.45

Calls 5

lua_initFunction · 0.85
printfFunction · 0.85
ToDbgStringMethod · 0.80
GetValueMethod · 0.80
GetKeyMethod · 0.45

Tested by

no test coverage detected