From 85e912ceb16334389f38ed69a67f8f72c1930321 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Fri, 10 Feb 2017 19:04:57 +0000 Subject: [PATCH] EgtExecutor 1.8b3 : - aggiunta in Exe e Lua SetIniFile. --- EXE.h | 3 +++ EXE_General.cpp | 16 ++++++++++++++++ EgtExecutor.rc | Bin 15088 -> 15088 bytes LUA_General.cpp | 17 +++++++++++++++++ 4 files changed, 36 insertions(+) diff --git a/EXE.h b/EXE.h index 895ba44..6f45f0e 100644 --- a/EXE.h +++ b/EXE.h @@ -16,6 +16,9 @@ #include "GseContext.h" #include "/EgtDev/Include/EgtILogger.h" +//---------------------------------------------------------------------------- +const std::string& ExeGetIniFile( void) ; + //---------------------------------------------------------------------------- ILogger* GetLogger( void) ; ILogger* GetCmdLogger( void) ; diff --git a/EXE_General.cpp b/EXE_General.cpp index eaef3d9..7a167af 100644 --- a/EXE_General.cpp +++ b/EXE_General.cpp @@ -41,6 +41,7 @@ static bool s_bCmdLog = false ; static Logger* s_pCmdLog = nullptr ; static string s_sKey ; static int s_nKeyType = KEY_LOCK_TYPE_ANY ; +static string s_sIniFile ; static pfProcEvents s_pFunProcEvents = nullptr ; static pfOutText s_pFunOutText = nullptr ; @@ -215,6 +216,14 @@ ExeSetLuaLibs( const string& sLuaLibsDir) return LuaSetLuaLibsDir( sLuaLibsDir) ; } +//----------------------------------------------------------------------------- +bool +ExeSetIniFile( const string& sIniFile) +{ + s_sIniFile = sIniFile ; + return true ; +} + //----------------------------------------------------------------------------- bool ExeSetCommandLogger( const string& sLogFile) @@ -418,6 +427,13 @@ ExeOutText( const string& sText) return false ; } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +const string& +ExeGetIniFile( void) +{ + return s_sIniFile ; +} //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- diff --git a/EgtExecutor.rc b/EgtExecutor.rc index a48b8423db813e095036496d7ec38a555c825e79..e794e3184609fff8939ee9c895f9ac32127bfabc 100644 GIT binary patch delta 79 zcmexR`k{2gFE&Qw&A-`PnSqoe*K!sx?>N)s4T4pS#*-bnk~jAW*?>e(i-FY$N+HxV MD8kglDNT|90Go*$jQ{`u delta 79 zcmexR`k{2gFE&P_&A-`PnSqoe*K!sx?>N)s4T4pSMw1=6k~jAW*?>e(i-FY$N+HxV MD8kglDNT|90Gd4;g#Z8m diff --git a/LUA_General.cpp b/LUA_General.cpp index 9480882..c19395a 100644 --- a/LUA_General.cpp +++ b/LUA_General.cpp @@ -484,6 +484,22 @@ LuaWriteStringToIni( lua_State* L) return 1 ; } +//------------------------------------------------------------------------------- +static int +LuaGetIniFile( lua_State* L) +{ + // nessun parametro + LuaClearStack( L) ; + // recupero la path del file Ini dell'eseguibile + string sIniFile = ExeGetIniFile() ; + // restituisco il risultato + if ( ! sIniFile.empty()) + LuaSetParam( L, sIniFile) ; + else + LuaSetParam( L) ; + return 1 ; +} + //------------------------------------------------------------------------------- static int LuaGetVersion( lua_State* L) @@ -648,6 +664,7 @@ LuaInstallGeneral( LuaMgr& luaMgr) bOk = bOk && luaMgr.RegisterFunction( "EgtBinaryFileCompare", LuaBinaryFileCompare) ; bOk = bOk && luaMgr.RegisterFunction( "EgtGetStringFromIni", LuaGetStringFromIni) ; bOk = bOk && luaMgr.RegisterFunction( "EgtWriteStringToIni", LuaWriteStringToIni) ; + bOk = bOk && luaMgr.RegisterFunction( "EgtGetIniFile", LuaGetIniFile) ; bOk = bOk && luaMgr.RegisterFunction( "EgtGetVersion", LuaGetVersion) ; bOk = bOk && luaMgr.RegisterFunction( "EgtIs64bit", LuaIs64bit) ; bOk = bOk && luaMgr.RegisterFunction( "EgtGetLanguage", LuaGetLanguage) ;