Nugget
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
psyqo::Lua Struct Reference

#include <psyqo-lua/lua.hh>

Public Types

using lua_CPPFunction = int(*)(Lua)
 

Public Member Functions

 Lua ()
 
 Lua (lua_State *L)
 
 Lua (Lua &&oL) noexcept
 
 Lua (const Lua &oL)
 
Luaoperator= (Lua &&oL) noexcept
 
void close ()
 
lua_State * getState ()
 
int getTop ()
 
void setTop (int idx)
 
void pop (int n=1)
 
void clearStack ()
 
void remove (int idx)
 
void insert (int idx)
 
void replace (int idx)
 
void copy (int fromidx, int toidx)
 
void copy (int fromidx)
 
void checkStack (int sz, const char *msg=nullptr)
 
int getabsolute (int index)
 
void push ()
 
void push (bool b)
 
void pushNumber (lua_Number n)
 
void push (std::nullptr_t)
 
void push (const char *s, size_t len)
 
template<size_t S>
void push (const char(&s)[S])
 
void push (eastl::string_view s)
 
void vpushf (const char *fmt, va_list ap)
 
void pushf (const char *fmt,...)
 
void push (lua_CFunction f, int closure=0)
 
void push (lua_CPPFunction f)
 
void push (void *p)
 
void pushGlobalTable ()
 
void push (FixedPoint<> fp)
 
FixedPoint toFixedPoint (int idx)
 
bool isFixedPoint (int idx)
 
FixedPoint checkFixedPoint (int idx)
 
FixedPoint optFixedPoint (int idx, FixedPoint<> def={})
 
bool toBoolean (int idx)
 
lua_Number toNumber (int idx, bool *isnum=nullptr)
 
const char * toString (int idx, size_t *len=nullptr)
 
size_t rawLen (int idx)
 
lua_CFunction toCFunction (int idx)
 
template<typename T = void>
T * toUserdata (int idx)
 
lua_State * toThread (int idx)
 
const voidtoPointer (int idx)
 
int type (int idx)
 
const char * typeName (int tp)
 
bool isNil (int idx)
 
bool isNone (int idx)
 
bool isNoneOrNil (int idx)
 
bool isBoolean (int idx)
 
bool isNumber (int idx)
 
bool isString (int idx)
 
bool isTable (int idx)
 
bool isFunction (int idx)
 
bool isCFunction (int idx)
 
bool isUserdata (int idx)
 
bool isLightUserdata (int idx)
 
bool isThread (int idx)
 
void newTable ()
 
void createTable (int narr, int nrec)
 
void getTable (int idx)
 
void getField (int idx, const char *k)
 
void getGlobal (const char *name)
 
void setTable (int idx)
 
void setField (int idx, const char *k)
 
void setGlobal (const char *name)
 
void rawGet (int idx)
 
void rawGetI (int idx, int n)
 
void rawGetP (int idx, const void *p)
 
void rawSet (int idx)
 
void rawSetI (int idx, int n)
 
void rawSetP (int idx, const void *p)
 
int next (int idx)
 
int newMetatable (const char *tname)
 
void getMetatable (const char *tname)
 
int getMetatable (int objindex)
 
int setMetatable (int objindex)
 
void call (int nargs, int nresults=LUA_MULTRET)
 
int pcall (int nargs, int nresults=LUA_MULTRET)
 
int loadBuffer (const char *buff, size_t sz, const char *chunkname=nullptr)
 
template<size_t S>
int loadBuffer (const char(&buff)[S], const char *chunkname=nullptr)
 
voidnewUserdata (size_t sz)
 
int ref (int t=LUA_REGISTRYINDEX)
 
void unref (int t, int ref)
 
int gc (int what, int data=0)
 
int error (const char *fmt,...)
 
int argError (int narg, const char *extramsg)
 
void checkType (int narg, int t)
 
void checkAny (int narg)
 
lua_Number checkNumber (int narg)
 
lua_Number optNumber (int narg, lua_Number def)
 
const char * checkString (int narg)
 
const char * optString (int narg, const char *def)
 
const char * checkLString (int narg, size_t *len)
 
const char * optLString (int narg, const char *def, size_t *len)
 
voidcheckUdata (int narg, const char *tname)
 
void argCheck (bool cond, int narg, const char *extramsg)
 
int checkOption (int narg, const char *def, const char *const lst[])
 
bool checkBoolean (int narg)
 
bool optBoolean (int narg, bool def)
 
int getStack (int level, lua_Debug *ar)
 
int getInfo (const char *what, lua_Debug *ar)
 
const char * getLocal (const lua_Debug *ar, int n)
 
const char * setLocal (const lua_Debug *ar, int n)
 
int yield (int nresults)
 
int resume (Lua from, int narg)
 
int status ()
 

Member Typedef Documentation

◆ lua_CPPFunction

Constructor & Destructor Documentation

◆ Lua() [1/4]

psyqo::Lua::Lua ( )

◆ Lua() [2/4]

psyqo::Lua::Lua ( lua_State *  L)
inline

◆ Lua() [3/4]

psyqo::Lua::Lua ( Lua &&  oL)
inlinenoexcept

◆ Lua() [4/4]

psyqo::Lua::Lua ( const Lua oL)
inline

Member Function Documentation

◆ argCheck()

void psyqo::Lua::argCheck ( bool  cond,
int  narg,
const char *  extramsg 
)
inline

◆ argError()

int psyqo::Lua::argError ( int  narg,
const char *  extramsg 
)
inline

◆ call()

void psyqo::Lua::call ( int  nargs,
int  nresults = LUA_MULTRET 
)
inline

◆ checkAny()

void psyqo::Lua::checkAny ( int  narg)
inline

◆ checkBoolean()

bool psyqo::Lua::checkBoolean ( int  narg)
inline

◆ checkFixedPoint()

psyqo::FixedPoint psyqo::Lua::checkFixedPoint ( int  idx)

◆ checkLString()

const char * psyqo::Lua::checkLString ( int  narg,
size_t *  len 
)
inline

◆ checkNumber()

lua_Number psyqo::Lua::checkNumber ( int  narg)
inline

◆ checkOption()

int psyqo::Lua::checkOption ( int  narg,
const char *  def,
const char *const  lst[] 
)
inline

◆ checkStack()

void psyqo::Lua::checkStack ( int  sz,
const char *  msg = nullptr 
)
inline

◆ checkString()

const char * psyqo::Lua::checkString ( int  narg)
inline

◆ checkType()

void psyqo::Lua::checkType ( int  narg,
int  t 
)
inline

◆ checkUdata()

void * psyqo::Lua::checkUdata ( int  narg,
const char *  tname 
)
inline

◆ clearStack()

void psyqo::Lua::clearStack ( )
inline

◆ close()

void psyqo::Lua::close ( )

◆ copy() [1/2]

void psyqo::Lua::copy ( int  fromidx)
inline

◆ copy() [2/2]

void psyqo::Lua::copy ( int  fromidx,
int  toidx 
)
inline

◆ createTable()

void psyqo::Lua::createTable ( int  narr,
int  nrec 
)
inline

◆ error()

int psyqo::Lua::error ( const char *  fmt,
  ... 
)

◆ gc()

int psyqo::Lua::gc ( int  what,
int  data = 0 
)
inline

◆ getabsolute()

int psyqo::Lua::getabsolute ( int  index)
inline

◆ getField()

void psyqo::Lua::getField ( int  idx,
const char *  k 
)
inline

◆ getGlobal()

void psyqo::Lua::getGlobal ( const char *  name)
inline

◆ getInfo()

int psyqo::Lua::getInfo ( const char *  what,
lua_Debug *  ar 
)
inline

◆ getLocal()

const char * psyqo::Lua::getLocal ( const lua_Debug *  ar,
int  n 
)
inline

◆ getMetatable() [1/2]

void psyqo::Lua::getMetatable ( const char *  tname)
inline

◆ getMetatable() [2/2]

int psyqo::Lua::getMetatable ( int  objindex)
inline

◆ getStack()

int psyqo::Lua::getStack ( int  level,
lua_Debug *  ar 
)
inline

◆ getState()

lua_State * psyqo::Lua::getState ( )
inline

◆ getTable()

void psyqo::Lua::getTable ( int  idx)
inline

◆ getTop()

int psyqo::Lua::getTop ( )
inline

◆ insert()

void psyqo::Lua::insert ( int  idx)
inline

◆ isBoolean()

bool psyqo::Lua::isBoolean ( int  idx)
inline

◆ isCFunction()

bool psyqo::Lua::isCFunction ( int  idx)
inline

◆ isFixedPoint()

bool psyqo::Lua::isFixedPoint ( int  idx)

◆ isFunction()

bool psyqo::Lua::isFunction ( int  idx)
inline

◆ isLightUserdata()

bool psyqo::Lua::isLightUserdata ( int  idx)
inline

◆ isNil()

bool psyqo::Lua::isNil ( int  idx)
inline

◆ isNone()

bool psyqo::Lua::isNone ( int  idx)
inline

◆ isNoneOrNil()

bool psyqo::Lua::isNoneOrNil ( int  idx)
inline

◆ isNumber()

bool psyqo::Lua::isNumber ( int  idx)
inline

◆ isString()

bool psyqo::Lua::isString ( int  idx)
inline

◆ isTable()

bool psyqo::Lua::isTable ( int  idx)
inline

◆ isThread()

bool psyqo::Lua::isThread ( int  idx)
inline

◆ isUserdata()

bool psyqo::Lua::isUserdata ( int  idx)
inline

◆ loadBuffer() [1/2]

int psyqo::Lua::loadBuffer ( const char *  buff,
size_t  sz,
const char *  chunkname = nullptr 
)
inline

◆ loadBuffer() [2/2]

template<size_t S>
int psyqo::Lua::loadBuffer ( const char(&)  buff[S],
const char *  chunkname = nullptr 
)
inline

◆ newMetatable()

int psyqo::Lua::newMetatable ( const char *  tname)
inline

◆ newTable()

void psyqo::Lua::newTable ( )
inline

◆ newUserdata()

void * psyqo::Lua::newUserdata ( size_t  sz)
inline

◆ next()

int psyqo::Lua::next ( int  idx)
inline

◆ operator=()

psyqo::Lua & psyqo::Lua::operator= ( Lua &&  oL)
noexcept

◆ optBoolean()

bool psyqo::Lua::optBoolean ( int  narg,
bool  def 
)
inline

◆ optFixedPoint()

psyqo::FixedPoint psyqo::Lua::optFixedPoint ( int  idx,
FixedPoint<>  def = {} 
)

◆ optLString()

const char * psyqo::Lua::optLString ( int  narg,
const char *  def,
size_t *  len 
)
inline

◆ optNumber()

lua_Number psyqo::Lua::optNumber ( int  narg,
lua_Number  def 
)
inline

◆ optString()

const char * psyqo::Lua::optString ( int  narg,
const char *  def 
)
inline

◆ pcall()

int psyqo::Lua::pcall ( int  nargs,
int  nresults = LUA_MULTRET 
)

◆ pop()

void psyqo::Lua::pop ( int  n = 1)
inline

◆ push() [1/10]

void psyqo::Lua::push ( )
inline

◆ push() [2/10]

void psyqo::Lua::push ( bool  b)
inline

◆ push() [3/10]

void psyqo::Lua::push ( const char *  s,
size_t  len 
)
inline

◆ push() [4/10]

template<size_t S>
void psyqo::Lua::push ( const char(&)  s[S])
inline

◆ push() [5/10]

void psyqo::Lua::push ( eastl::string_view  s)
inline

◆ push() [6/10]

void psyqo::Lua::push ( FixedPoint<>  fp)

◆ push() [7/10]

void psyqo::Lua::push ( lua_CFunction  f,
int  closure = 0 
)
inline

◆ push() [8/10]

void psyqo::Lua::push ( lua_CPPFunction  f)

◆ push() [9/10]

void psyqo::Lua::push ( std::nullptr_t  )
inline

◆ push() [10/10]

void psyqo::Lua::push ( void p)
inline

◆ pushf()

void psyqo::Lua::pushf ( const char *  fmt,
  ... 
)

◆ pushGlobalTable()

void psyqo::Lua::pushGlobalTable ( )
inline

◆ pushNumber()

void psyqo::Lua::pushNumber ( lua_Number  n)
inline

◆ rawGet()

void psyqo::Lua::rawGet ( int  idx)
inline

◆ rawGetI()

void psyqo::Lua::rawGetI ( int  idx,
int  n 
)
inline

◆ rawGetP()

void psyqo::Lua::rawGetP ( int  idx,
const void p 
)
inline

◆ rawLen()

size_t psyqo::Lua::rawLen ( int  idx)
inline

◆ rawSet()

void psyqo::Lua::rawSet ( int  idx)
inline

◆ rawSetI()

void psyqo::Lua::rawSetI ( int  idx,
int  n 
)
inline

◆ rawSetP()

void psyqo::Lua::rawSetP ( int  idx,
const void p 
)
inline

◆ ref()

int psyqo::Lua::ref ( int  t = LUA_REGISTRYINDEX)
inline

◆ remove()

void psyqo::Lua::remove ( int  idx)
inline

◆ replace()

void psyqo::Lua::replace ( int  idx)
inline

◆ resume()

int psyqo::Lua::resume ( Lua  from,
int  narg 
)
inline

◆ setField()

void psyqo::Lua::setField ( int  idx,
const char *  k 
)
inline

◆ setGlobal()

void psyqo::Lua::setGlobal ( const char *  name)
inline

◆ setLocal()

const char * psyqo::Lua::setLocal ( const lua_Debug *  ar,
int  n 
)
inline

◆ setMetatable()

int psyqo::Lua::setMetatable ( int  objindex)
inline

◆ setTable()

void psyqo::Lua::setTable ( int  idx)
inline

◆ setTop()

void psyqo::Lua::setTop ( int  idx)
inline

◆ status()

int psyqo::Lua::status ( )
inline

◆ toBoolean()

bool psyqo::Lua::toBoolean ( int  idx)
inline

◆ toCFunction()

lua_CFunction psyqo::Lua::toCFunction ( int  idx)
inline

◆ toFixedPoint()

psyqo::FixedPoint psyqo::Lua::toFixedPoint ( int  idx)

◆ toNumber()

lua_Number psyqo::Lua::toNumber ( int  idx,
bool *  isnum = nullptr 
)

◆ toPointer()

const void * psyqo::Lua::toPointer ( int  idx)
inline

◆ toString()

const char * psyqo::Lua::toString ( int  idx,
size_t *  len = nullptr 
)
inline

◆ toThread()

lua_State * psyqo::Lua::toThread ( int  idx)
inline

◆ toUserdata()

template<typename T = void>
T * psyqo::Lua::toUserdata ( int  idx)
inline

◆ type()

int psyqo::Lua::type ( int  idx)
inline

◆ typeName()

const char * psyqo::Lua::typeName ( int  tp)
inline

◆ unref()

void psyqo::Lua::unref ( int  t,
int  ref 
)
inline

◆ vpushf()

void psyqo::Lua::vpushf ( const char *  fmt,
va_list  ap 
)
inline

◆ yield()

int psyqo::Lua::yield ( int  nresults)
inline

The documentation for this struct was generated from the following files: