Files
fs2open.github.com/code/scripting/lua/LuaUtil.cpp
T
asarium 0110954518 Add improved lua reference handling
This adds a utility library for handling all the nasty lua referencing
stuff. It also provides functions for convienent usage of lua objects
such as tables and functions which allows to use them directly from C++
code without using the ugly Lua C-API.
2017-01-01 22:13:40 +01:00

34 lines
633 B
C++

#include "LuaUtil.h"
namespace luacpp {
namespace util {
const char* getValueName(ValueType type) {
switch (type) {
case ValueType::NONE:
return "none";
case ValueType::NIL:
return "nil";
case ValueType::BOOLEAN:
return "boolean";
case ValueType::LIGHTUSERDATA:
return "light userdata";
case ValueType::STRING:
return "string";
case ValueType::NUMBER:
return "number";
case ValueType::TABLE:
return "table";
case ValueType::FUNCTION:
return "function";
case ValueType::USERDATA:
return "userdata";
case ValueType::THREAD:
return "thread";
default:
return "unknown";
}
}
}
}