2f7a8a8f9c
- aggiunta funzione ExeLuaExistsFunction.
48 lines
2.0 KiB
C++
48 lines
2.0 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2015-2022
|
|
//----------------------------------------------------------------------------
|
|
// File : LUA_Base.h Data : 26.08.22 Versione : 2.4h4
|
|
// Contenuto : Dichiarazioni per funzioni di base gestione LUA.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 21.03.15 DS Creazione modulo.
|
|
// 26.08.22 DS Aggiunta funzione LuaExistsFunction.
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "/EgtDev/Include/EGnLuaMgr.h"
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool LuaInit( void) ;
|
|
bool LuaExit( void) ;
|
|
LuaMgr& LuaGetLuaMgr( void) ;
|
|
bool LuaSetLuaLibsDir( const std::string& sDir) ;
|
|
bool LuaRequire( const std::string& sFile) ;
|
|
template<typename T>
|
|
bool LuaSetGlobVar( const std::string& sVar, const T& Val)
|
|
{ return LuaSetGlobVar( LuaGetLuaMgr().GetLuaState(), sVar, Val) ; }
|
|
template<typename T>
|
|
bool LuaGetGlobVar( const std::string& sVar, T& Val)
|
|
{ return LuaGetGlobVar( LuaGetLuaMgr().GetLuaState(), sVar, Val) ; }
|
|
bool LuaResetGlobVar( const std::string& sVar) ;
|
|
bool LuaCreateGlobTable( const std::string& sVar) ;
|
|
inline bool LuaExistsFunction( const std::string& sFunName)
|
|
{ return LuaGetLuaMgr().ExistsFunction( sFunName) ; }
|
|
template<typename... Args>
|
|
bool LuaCallFunction( const std::string& sFunName, int nRets, const Args&... params)
|
|
{ return LuaGetLuaMgr().CallFunction( sFunName, nRets, params...) ; }
|
|
template<typename... Args>
|
|
bool LuaGetFunctionReturns( Args&... rets)
|
|
{ return LuaGetLuaMgr().GetFunctionReturns( rets...) ; }
|
|
template<typename T>
|
|
bool LuaEvalExpr( const std::string& sExpr, T& Val)
|
|
{ return LuaGetLuaMgr().EvalExpr( sExpr, Val) ; }
|
|
bool LuaExecLine( const std::string& sLine) ;
|
|
bool LuaExecFile( const std::string& sFile) ;
|
|
const std::string& LuaGetLastError( void) ;
|
|
const std::string& LuaGetLuaLibsDir( void) ;
|
|
const std::string& LuaGetLastRequire( void) ;
|