Minetest  5.4.0
LuaHelper Class Reference

#include <helper.h>

+ Inheritance diagram for LuaHelper:

Public Member Functions

template<>
bool readParam (lua_State *L, int index)
 

Static Protected Member Functions

static bool isNaN (lua_State *L, int idx)
 
template<typename T >
static T readParam (lua_State *L, int index)
 Read a value using a template type T from Lua State L and index. More...
 
template<typename T >
static T readParam (lua_State *L, int index, const T &default_value)
 Read a value using a template type T from Lua State L and index. More...
 

Member Function Documentation

◆ isNaN()

bool LuaHelper::isNaN ( lua_State *  L,
int  idx 
)
staticprotected

References idx.

◆ readParam() [1/3]

template<>
std::string LuaHelper::readParam ( lua_State *  L,
int  index 
)

◆ readParam() [2/3]

template<typename T >
static T LuaHelper::readParam ( lua_State *  L,
int  index 
)
staticprotected

Read a value using a template type T from Lua State L and index.

Template Parameters
Ttype to read from Lua
Parameters
LLua state
indexLua Index to read
Returns
read value from Lua

◆ readParam() [3/3]

template<typename T >
static T LuaHelper::readParam ( lua_State *  L,
int  index,
const T &  default_value 
)
inlinestaticprotected

Read a value using a template type T from Lua State L and index.

Template Parameters
Ttype to read from Lua
Parameters
LLua state
indexLua Index to read
default_valuedefault value to apply if nil
Returns
read value from Lua or default value if nil

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