#include <luacscript.h>
|
static int | StackDump (lua_State *l, bool toLog=true) |
|
static std::string | readType (lua_State *l, int i) |
|
static int | requireLib (lua_State *l) |
|
static int | requireScript (lua_State *l) |
|
static void | CopyStack (lua_State *sender, lua_State *reciever, int numVals) |
|
static void | CopyData (lua_State *sender, int idx, lua_State *reciever) |
|
static void | CopyUdata (lua_State *sender, int idx, lua_State *reciever) |
|
static int | LuaOpenLib (lua_State *l, const std::string &metatable, const std::string &className, const luaL_reg *lib, int(*call)(lua_State *)) |
|
static void | Add (lua_State *l, int i, const std::string &metatable) |
|
Class to store the various functions needed for interactions between Lua and LuaScript class along with some general Lua C utility functions
void LuaC::LuaScriptLib::Add |
( |
lua_State * |
l, |
|
|
int |
i, |
|
|
const std::string & |
metatable |
|
) |
| |
|
static |
A generic addX function for adding some userdata to the desired metatable
- Parameters
-
l | The Lua state |
i | The index of the user data, relative to top |
metatable | The metatable name to register with |
void LuaC::LuaScriptLib::CopyData |
( |
lua_State * |
sender, |
|
|
int |
idx, |
|
|
lua_State * |
reciever |
|
) |
| |
|
static |
Type check some data in sender stack at index idx and copy it to the top of the reciever stack
- Parameters
-
sender | The Lua state to copy from |
idx | The index of the data to copy |
reciever | The Lua state to copy too |
void LuaC::LuaScriptLib::CopyStack |
( |
lua_State * |
sender, |
|
|
lua_State * |
reciever, |
|
|
int |
numVals |
|
) |
| |
|
static |
Copy some number of entries from the sender stack to the reciever stack The function will attempt to restore metatables, but the Lua libs must already be registered in each state for it to be able to properly register numVals data will be copied from the sender to reciever and the stack ordering will be preserved, ie. start copying at the bottom most entry in sender and push onto reciever so the stack will be identical
- Parameters
-
sender | The Lua state to transfer data from |
reciever | The Lua state to transfer too |
numVals | The number of entries to copy over |
void LuaC::LuaScriptLib::CopyUdata |
( |
lua_State * |
sender, |
|
|
int |
idx, |
|
|
lua_State * |
reciever |
|
) |
| |
|
static |
Copy some userdata using one of the UdataCopier functions, Log issue if a copier lookup failed
- Parameters
-
sender | The Lua state to copy from |
idx | The index of the data to copy |
reciever | The Lua state to copy too |
int LuaC::LuaScriptLib::LuaOpenLib |
( |
lua_State * |
l, |
|
|
const std::string & |
metatable, |
|
|
const std::string & |
className, |
|
|
const luaL_reg * |
lib, |
|
|
int(*)(lua_State *) |
call |
|
) |
| |
|
static |
A generic luaopen_X function for opening libraries that share similar style, and have the same organization for their luaopen_X function
- Parameters
-
l | The Lua state to register in |
metatable | The name for the metatable |
className | The name for the class table and type |
lib | The luaL_reg struct containing the functions and names |
call | The function to load for the __call field (constructor) |
std::string LuaC::LuaScriptLib::readType |
( |
lua_State * |
l, |
|
|
int |
i |
|
) |
| |
|
static |
Read the type value of the metatable of some userdata at index
- Parameters
-
l | The lua_State to read from |
i | The index of the userdata to get the type of |
- Returns
- The userdata type value, as a string
int LuaC::LuaScriptLib::requireLib |
( |
lua_State * |
l | ) |
|
|
static |
A function for looking up our engine libraries and loading them to a lua_State
- Parameters
-
l | The lua_State to load the library into |
- Returns
- Number of return values for lua to pick up
int LuaC::LuaScriptLib::requireScript |
( |
lua_State * |
l | ) |
|
|
static |
A function for looking up engine scripts and loading them to to a lua_State. An engine script is scripts/scriptname, the path will be redirected to the proper location to load from
- Parameters
-
l | The lua_State to load the script to |
- Returns
- Number of return values for lua to pick up
int LuaC::LuaScriptLib::StackDump |
( |
lua_State * |
l, |
|
|
bool |
toLog = true |
|
) |
| |
|
static |
Perform a stack dump on the lua_State
- Parameters
-
l | The lua_State to perform the stack dump on |
toFile | If the stack dump should be written to Debug Log or console default is Log |
- Returns
- Number of return values for lua to pick up
The documentation for this class was generated from the following files:
- C:/Users/Will/Documents/Programs/LPCGame/src/luac/luacscript.h
- C:/Users/Will/Documents/Programs/LPCGame/src/luac/luacscript.cpp