Yukino::Script Class Reference

Class that manages the scripts system. More...

#include <Script.h>

List of all members.

Public Member Functions

UINT Init (void)
 Function to initialize the object Script.
void Release (void)
 Function to finalize the object Script.
int GetTop (void)
 Function to obtain the top of the stack.
int Type (int index)
 Function to obtain the type of a position of the stack.
int IsNil (int index)
 Function to obtain if a position of the stack is a NULL.
int IsBool (int index)
 Function to obtain if a position of the stack is a boolean.
int IsNumber (int index)
 Function to obtain if a position of the stack is a number.
int IsString (int index)
 Function to obtain if a position of the stack is a string.
int IsTable (int index)
 Function to obtain if a position of the stack is a table.
int IsFunction (int index)
 Function to obtain if a position of the stack is a function.
int IsCFunction (int index)
 Function to obtain if a position of the stack is a C function.
int IsUserData (int index)
 Function to obtain if a position of the stack is an UserData.
int IsLightUserData (int index)
 Function to obtain if a position of the stack is an UserData.
const char * TypeName (int type)
 Function to obtain a type of data into a string.
int GetBool (int index)
 Function to obtain a boolean from a position of the stack.
lua_Number GetNumber (int index)
 Function to obtain a number from a position of the stack.
const char * GetString (int index)
 Function to obtain a string from a position of the stack.
size_t GetStrLen (int index)
 Function to obtain the size of a string from a position of the stack.
lua_CFunction GetCFunction (int index)
 Function to obtain a C function from a position of the stack.
void * GetUserData (int index)
 Function to obtain an UserData from a position of the stack.
lua_State * GetThread (int index)
 Function to obtain a thread from a position of the stack.
const void * GetPointer (int index)
 Function to obtain a pointer from a position of the stack.
void PushBool (int val)
 Function to push a boolean in the stack.
void PushNumber (lua_Number val)
 Function to push a number in the stack.
void PushString (const char *val, size_t len)
 Function to push a string in the stack.
void PushString (const char *val)
 Function to push a string in the stack.
void PushNil (void)
 Function to push a NULL in the stack.
void PushCFunction (lua_CFunction val)
 Function to push a C function in the stack.
void PushLightUserData (void *val)
 Function to push a UserData in the stack.
void ExecFile (const char *file)
 Function to excecute a file of Lua.
void ExecFile (const string &file)
 Function to excecute a file of Lua.
void ExecString (const char *str)
 Function to excecute a text string of Lua.
void ExecString (const string &str)
 Function to excecute a text string of Lua.
void Register (const char *name, lua_CFunction func)
 Function to register a C function in Lua.
void Register (const string &name, lua_CFunction func)
 Function to register a C function in Lua.
int GetTop (lua_State *L)
 Function to obtain the top of the stack.
int Type (lua_State *L, int index)
 Function to obtain the type of a position of the stack.
int IsNil (lua_State *L, int index)
 Function to obtain if a position of the stack is a NULL.
int IsBool (lua_State *L, int index)
 Function to obtain if a position of the stack is a boolean.
int IsNumber (lua_State *L, int index)
 Function to obtain if a position of the stack is a number.
int IsString (lua_State *L, int index)
 Function to obtain if a position of the stack is a string.
int IsTable (lua_State *L, int index)
 Function to obtain if a position of the stack is a table.
int IsFunction (lua_State *L, int index)
 Function to obtain if a position of the stack is a function.
int IsCFunction (lua_State *L, int index)
 Function to obtain if a position of the stack is a C function.
int IsUserData (lua_State *L, int index)
 Function to obtain if a position of the stack is an UserData.
int IsLightUserData (lua_State *L, int index)
 Function to obtain if a position of the stack is an UserData.
int GetBool (lua_State *L, int index)
 Function to obtain a boolean from a position of the stack.
lua_Number GetNumber (lua_State *L, int index)
 Function to obtain a number from a position of the stack.
const char * GetString (lua_State *L, int index)
 Function to obtain a string from a position of the stack.
size_t GetStrLen (lua_State *L, int index)
 Function to obtain the size of a string from a position of the stack.
lua_CFunction GetCFunction (lua_State *L, int index)
 Function to obtain a C function from a position of the stack.
void * GetUserData (lua_State *L, int index)
 Function to obtain an UserData from a position of the stack.
lua_State * GetThread (lua_State *L, int index)
 Function to obtain a thread from a position of the stack.
const void * GetPointer (lua_State *L, int index)
 Function to obtain a pointer from a position of the stack.
void PushBool (lua_State *L, int val)
 Function to push a boolean in the stack.
void PushNumber (lua_State *L, lua_Number val)
 Function to push a number in the stack.
void PushString (lua_State *L, const char *val, size_t len)
 Function to push a string in the stack.
void PushString (lua_State *L, const char *val)
 Function to push a string in the stack.
void PushNil (lua_State *L)
 Function to push a NULL in the stack.
void PushCFunction (lua_State *L, lua_CFunction val)
 Function to push a C function in the stack.
void PushLightUserData (lua_State *L, void *val)
 Function to push a UserData in the stack.
void ExecFile (lua_State *L, const char *file)
 Function to excecute a file of Lua.
void ExecFile (lua_State *L, const string &file)
 Function to excecute a file of Lua.
void ExecString (lua_State *L, const char *str)
 Function to excecute a text string of Lua.
void ExecString (lua_State *L, const string &str)
 Function to excecute a text string of Lua.
void Register (lua_State *L, const char *name, lua_CFunction func)
 Function to register a C function in Lua.
void Register (lua_State *L, const string &name, lua_CFunction func)
 Function to register a C function in Lua.
lua_State * GetLuaState (void)
 Function to obtain the Lua state.

Static Public Member Functions

static ScriptGetInstance (void)
 Function to obtain the instance of Script.


Detailed Description

Class that manages the scripts system.

The Input class manages the subjects related to the system of scripts with Lua.


Member Function Documentation

void Yukino::Script::ExecFile ( lua_State *  L,
const string &  file 
) [inline]

Function to excecute a file of Lua.

Parameters:
L Lua state.
file Path of the file.

void Yukino::Script::ExecFile ( lua_State *  L,
const char *  file 
) [inline]

Function to excecute a file of Lua.

Parameters:
L Lua state.
file Path of the file.

void Yukino::Script::ExecFile ( const string &  file  )  [inline]

Function to excecute a file of Lua.

Parameters:
file Path of the file.

void Yukino::Script::ExecFile ( const char *  file  )  [inline]

Function to excecute a file of Lua.

Parameters:
file Path of the file.

void Yukino::Script::ExecString ( lua_State *  L,
const string &  str 
) [inline]

Function to excecute a text string of Lua.

Parameters:
L Lua state.
str Text string.

void Yukino::Script::ExecString ( lua_State *  L,
const char *  str 
) [inline]

Function to excecute a text string of Lua.

Parameters:
L Lua state.
str Text string.

void Yukino::Script::ExecString ( const string &  str  )  [inline]

Function to excecute a text string of Lua.

Parameters:
str Text string.

void Yukino::Script::ExecString ( const char *  str  )  [inline]

Function to excecute a text string of Lua.

Parameters:
str Text string.

int Yukino::Script::GetBool ( lua_State *  L,
int  index 
) [inline]

Function to obtain a boolean from a position of the stack.

Parameters:
L Lua state.
index Position inside the stack.
Returns:
The value of the data.

int Yukino::Script::GetBool ( int  index  )  [inline]

Function to obtain a boolean from a position of the stack.

Parameters:
index Position inside the stack.
Returns:
The value of the data.

lua_CFunction Yukino::Script::GetCFunction ( lua_State *  L,
int  index 
) [inline]

Function to obtain a C function from a position of the stack.

Parameters:
L Lua state.
index Position inside the stack.
Returns:
The value of the data.

lua_CFunction Yukino::Script::GetCFunction ( int  index  )  [inline]

Function to obtain a C function from a position of the stack.

Parameters:
index Position inside the stack.
Returns:
The value of the data.

Script * Yukino::Script::GetInstance ( void   )  [static]

Function to obtain the instance of Script.

This function creates an instance of Script, in case of not being created, and gives back a pointer of this if memory is successful requesting.

Returns:
It gives back to a pointer to the object Script if everything has gone well, if there is no memory for the object, gives back NULL.

lua_State* Yukino::Script::GetLuaState ( void   )  [inline]

Function to obtain the Lua state.

Returns:
A pointer to the Lua state.

lua_Number Yukino::Script::GetNumber ( lua_State *  L,
int  index 
) [inline]

Function to obtain a number from a position of the stack.

Parameters:
L Lua state.
index Position inside the stack.
Returns:
The value of the data.

lua_Number Yukino::Script::GetNumber ( int  index  )  [inline]

Function to obtain a number from a position of the stack.

Parameters:
index Position inside the stack.
Returns:
The value of the data.

const void* Yukino::Script::GetPointer ( lua_State *  L,
int  index 
) [inline]

Function to obtain a pointer from a position of the stack.

Parameters:
L Lua state.
index Position inside the stack.
Returns:
The value of the data.

const void* Yukino::Script::GetPointer ( int  index  )  [inline]

Function to obtain a pointer from a position of the stack.

Parameters:
index Position inside the stack.
Returns:
The value of the data.

const char* Yukino::Script::GetString ( lua_State *  L,
int  index 
) [inline]

Function to obtain a string from a position of the stack.

Parameters:
L Lua state.
index Position inside the stack.
Returns:
The value of the data.

const char* Yukino::Script::GetString ( int  index  )  [inline]

Function to obtain a string from a position of the stack.

Parameters:
index Position inside the stack.
Returns:
The value of the data.

size_t Yukino::Script::GetStrLen ( lua_State *  L,
int  index 
) [inline]

Function to obtain the size of a string from a position of the stack.

Parameters:
L Lua state.
index Position inside the stack.
Returns:
The size of a string.

size_t Yukino::Script::GetStrLen ( int  index  )  [inline]

Function to obtain the size of a string from a position of the stack.

Parameters:
index Position inside the stack.
Returns:
The size of a string.

lua_State* Yukino::Script::GetThread ( lua_State *  L,
int  index 
) [inline]

Function to obtain a thread from a position of the stack.

Parameters:
L Lua state.
index Position inside the stack.
Returns:
The value of the data.

lua_State* Yukino::Script::GetThread ( int  index  )  [inline]

Function to obtain a thread from a position of the stack.

Parameters:
index Position inside the stack.
Returns:
The value of the data.

int Yukino::Script::GetTop ( lua_State *  L  )  [inline]

Function to obtain the top of the stack.

Parameters:
L Lua state.
Returns:
The top of the stack.

int Yukino::Script::GetTop ( void   )  [inline]

Function to obtain the top of the stack.

Returns:
The top of the stack.

void* Yukino::Script::GetUserData ( lua_State *  L,
int  index 
) [inline]

Function to obtain an UserData from a position of the stack.

Parameters:
L Lua state.
index Position inside the stack.
Returns:
The value of the data.

void* Yukino::Script::GetUserData ( int  index  )  [inline]

Function to obtain an UserData from a position of the stack.

Parameters:
index Position inside the stack.
Returns:
The value of the data.

UINT Yukino::Script::Init ( void   ) 

Function to initialize the object Script.

This function serves to initialize the object Script.

See also:
Release().
Returns:
If everything goes well returns 0, on errors returns: SCRIPT_ERROR_LUAOPEN.

int Yukino::Script::IsBool ( lua_State *  L,
int  index 
) [inline]

Function to obtain if a position of the stack is a boolean.

Parameters:
L Lua state.
index Position inside the stack.
Returns:
If it's true returns 1, on errors returns 0.

int Yukino::Script::IsBool ( int  index  )  [inline]

Function to obtain if a position of the stack is a boolean.

Parameters:
index Position inside the stack.
Returns:
If it's true returns 1, on errors returns 0.

int Yukino::Script::IsCFunction ( lua_State *  L,
int  index 
) [inline]

Function to obtain if a position of the stack is a C function.

Parameters:
L Lua state.
index Position inside the stack.
Returns:
If it's true returns 1, on errors returns 0.

int Yukino::Script::IsCFunction ( int  index  )  [inline]

Function to obtain if a position of the stack is a C function.

Parameters:
index Position inside the stack.
Returns:
If it's true returns 1, on errors returns 0.

int Yukino::Script::IsFunction ( lua_State *  L,
int  index 
) [inline]

Function to obtain if a position of the stack is a function.

Parameters:
L Lua state.
index Position inside the stack.
Returns:
If it's true returns 1, on errors returns 0.

int Yukino::Script::IsFunction ( int  index  )  [inline]

Function to obtain if a position of the stack is a function.

Parameters:
index Position inside the stack.
Returns:
If it's true returns 1, on errors returns 0.

int Yukino::Script::IsLightUserData ( lua_State *  L,
int  index 
) [inline]

Function to obtain if a position of the stack is an UserData.

Parameters:
L Lua state.
index Position inside the stack.
Returns:
If it's true returns 1, on errors returns 0.

int Yukino::Script::IsLightUserData ( int  index  )  [inline]

Function to obtain if a position of the stack is an UserData.

Parameters:
index Position inside the stack.
Returns:
If it's true returns 1, on errors returns 0.

int Yukino::Script::IsNil ( lua_State *  L,
int  index 
) [inline]

Function to obtain if a position of the stack is a NULL.

Parameters:
L Lua state.
index Position inside the stack.
Returns:
If it's true returns 1, on errors returns 0.

int Yukino::Script::IsNil ( int  index  )  [inline]

Function to obtain if a position of the stack is a NULL.

Parameters:
index Position inside the stack.
Returns:
If it's true returns 1, on errors returns 0.

int Yukino::Script::IsNumber ( lua_State *  L,
int  index 
) [inline]

Function to obtain if a position of the stack is a number.

Parameters:
L Lua state.
index Position inside the stack.
Returns:
If it's true returns 1, on errors returns 0.

int Yukino::Script::IsNumber ( int  index  )  [inline]

Function to obtain if a position of the stack is a number.

Parameters:
index Position inside the stack.
Returns:
If it's true returns 1, on errors returns 0.

int Yukino::Script::IsString ( lua_State *  L,
int  index 
) [inline]

Function to obtain if a position of the stack is a string.

Parameters:
L Lua state.
index Position inside the stack.
Returns:
If it's true returns 1, on errors returns 0.

int Yukino::Script::IsString ( int  index  )  [inline]

Function to obtain if a position of the stack is a string.

Parameters:
index Position inside the stack.
Returns:
If it's true returns 1, on errors returns 0.

int Yukino::Script::IsTable ( lua_State *  L,
int  index 
) [inline]

Function to obtain if a position of the stack is a table.

Parameters:
L Lua state.
index Position inside the stack.
Returns:
If it's true returns 1, on errors returns 0.

int Yukino::Script::IsTable ( int  index  )  [inline]

Function to obtain if a position of the stack is a table.

Parameters:
index Position inside the stack.
Returns:
If it's true returns 1, on errors returns 0.

int Yukino::Script::IsUserData ( lua_State *  L,
int  index 
) [inline]

Function to obtain if a position of the stack is an UserData.

Parameters:
L Lua state.
index Position inside the stack.
Returns:
If it's true returns 1, on errors returns 0.

int Yukino::Script::IsUserData ( int  index  )  [inline]

Function to obtain if a position of the stack is an UserData.

Parameters:
index Position inside the stack.
Returns:
If it's true returns 1, on errors returns 0.

void Yukino::Script::PushBool ( lua_State *  L,
int  val 
) [inline]

Function to push a boolean in the stack.

Parameters:
L Lua state.
val The value of the data.

void Yukino::Script::PushBool ( int  val  )  [inline]

Function to push a boolean in the stack.

Parameters:
val The value of the data.

void Yukino::Script::PushCFunction ( lua_State *  L,
lua_CFunction  val 
) [inline]

Function to push a C function in the stack.

Parameters:
L Lua state.
val The value of the data.

void Yukino::Script::PushCFunction ( lua_CFunction  val  )  [inline]

Function to push a C function in the stack.

Parameters:
val The value of the data.

void Yukino::Script::PushLightUserData ( lua_State *  L,
void *  val 
) [inline]

Function to push a UserData in the stack.

Parameters:
L Lua state.
val The value of the data.

void Yukino::Script::PushLightUserData ( void *  val  )  [inline]

Function to push a UserData in the stack.

Parameters:
val The value of the data.

void Yukino::Script::PushNil ( lua_State *  L  )  [inline]

Function to push a NULL in the stack.

Parameters:
L Lua state.

void Yukino::Script::PushNumber ( lua_State *  L,
lua_Number  val 
) [inline]

Function to push a number in the stack.

Parameters:
L Lua state.
val The value of the data.

void Yukino::Script::PushNumber ( lua_Number  val  )  [inline]

Function to push a number in the stack.

Parameters:
val The value of the data.

void Yukino::Script::PushString ( lua_State *  L,
const char *  val 
) [inline]

Function to push a string in the stack.

Parameters:
L Lua state.
val The value of the data.

void Yukino::Script::PushString ( lua_State *  L,
const char *  val,
size_t  len 
) [inline]

Function to push a string in the stack.

Parameters:
L Lua state.
val The value of the data.
len Size of the string.

void Yukino::Script::PushString ( const char *  val  )  [inline]

Function to push a string in the stack.

Parameters:
val The value of the data.

void Yukino::Script::PushString ( const char *  val,
size_t  len 
) [inline]

Function to push a string in the stack.

Parameters:
val The value of the data.
len Size of the string.

void Yukino::Script::Register ( lua_State *  L,
const string &  name,
lua_CFunction  func 
) [inline]

Function to register a C function in Lua.

Parameters:
L Lua state.
name Name in Lua of the function.
func Pointer to the function in C.

void Yukino::Script::Register ( lua_State *  L,
const char *  name,
lua_CFunction  func 
) [inline]

Function to register a C function in Lua.

Parameters:
L Lua state.
name Name in Lua of the function.
func Pointer to the function in C.

void Yukino::Script::Register ( const string &  name,
lua_CFunction  func 
) [inline]

Function to register a C function in Lua.

Parameters:
name Name in Lua of the function.
func Pointer to the function in C.

void Yukino::Script::Register ( const char *  name,
lua_CFunction  func 
) [inline]

Function to register a C function in Lua.

Parameters:
name Name in Lua of the function.
func Pointer to the function in C.

void Yukino::Script::Release ( void   ) 

Function to finalize the object Script.

This function serves to finalize the object Script.

See also:
Init().

int Yukino::Script::Type ( lua_State *  L,
int  index 
) [inline]

Function to obtain the type of a position of the stack.

Parameters:
L Lua state.
index Position inside the stack.
Returns:
LUA_TNIL, LUA_TNUMBER, LUA_TBOOLEAN, LUA_TSTRING, LUA_TTABLE, LUA_TFUNCTION, LUA_TUSERDATA, LUA_TTHREAD, LUA_TLIGHTUSERDATA.

int Yukino::Script::Type ( int  index  )  [inline]

Function to obtain the type of a position of the stack.

Parameters:
index Position inside the stack.
Returns:
LUA_TNIL, LUA_TNUMBER, LUA_TBOOLEAN, LUA_TSTRING, LUA_TTABLE, LUA_TFUNCTION, LUA_TUSERDATA, LUA_TTHREAD, LUA_TLIGHTUSERDATA.

const char* Yukino::Script::TypeName ( int  type  )  [inline]

Function to obtain a type of data into a string.

Parameters:
type Type of data.
Returns:
A string with the data type in text.


The documentation for this class was generated from the following files:
Generated on Sun Jun 25 03:43:36 2006 for Yukino by  doxygen 1.4.7