diff --git a/CmdParser.h b/CmdParser.h index 7cb8b59..d28a080 100644 --- a/CmdParser.h +++ b/CmdParser.h @@ -14,9 +14,9 @@ #pragma once #include "CmdScanner.h" -#include "/EgtDev/Include/EgtPerfCounter.h" -#include "/EgtDev/Include/EgnStringBase.h" #include "/EgtDev/Include/EgnCmdParser.h" +#include "/EgtDev/Include/EgtPerfCounter.h" +#include "/EgtDev/Include/EgtStringBase.h" #include "/EgtDev/Include/EgtExecMgr.h" //---------------------------------------------------------------------------- diff --git a/CmdScanner.cpp b/CmdScanner.cpp index 65d2aff..939e771 100644 --- a/CmdScanner.cpp +++ b/CmdScanner.cpp @@ -16,7 +16,7 @@ #include "stdafx.h" #include "CmdScanner.h" #include "/EgtDev/Include/EgnStringUtils.h" -#include "/EgtDev/Include/EgnStringConverter.h" +#include "/EgtDev/Include/EgtStringConverter.h" using namespace std ; diff --git a/EgtGeneral.rc b/EgtGeneral.rc index 8174fa2..ea0c7c3 100644 Binary files a/EgtGeneral.rc and b/EgtGeneral.rc differ diff --git a/EgtGeneral.vcxproj b/EgtGeneral.vcxproj index 15fdb4c..66be3a0 100644 --- a/EgtGeneral.vcxproj +++ b/EgtGeneral.vcxproj @@ -199,11 +199,12 @@ copy $(TargetPath) \EgtProg\Dll64 + + - - - + + diff --git a/EgtGeneral.vcxproj.filters b/EgtGeneral.vcxproj.filters index 21b21f4..5b41179 100644 --- a/EgtGeneral.vcxproj.filters +++ b/EgtGeneral.vcxproj.filters @@ -24,9 +24,6 @@ File di intestazione - - File di intestazione - File di intestazione @@ -42,9 +39,6 @@ File di intestazione - - File di intestazione - File di intestazione @@ -60,7 +54,16 @@ File di intestazione - + + File di intestazione + + + File di intestazione + + + File di intestazione + + File di intestazione diff --git a/FileCompare.cpp b/FileCompare.cpp index 05ba79e..7ff2b9f 100644 --- a/FileCompare.cpp +++ b/FileCompare.cpp @@ -15,7 +15,7 @@ //--------------------------- Include ---------------------------------------- #include "stdafx.h" #include "/EgtDEv/Include/EgnFileCompare.h" -#include "/EgtDEv/Include/EGnStringConverter.h" +#include "/EgtDEv/Include/EgtStringConverter.h" #include "/EgtDEv/Include/EGnScan.h" #include #include diff --git a/FileUtils.cpp b/FileUtils.cpp index 92d73b0..50f032a 100644 --- a/FileUtils.cpp +++ b/FileUtils.cpp @@ -15,7 +15,7 @@ #include "stdafx.h" #include "\EgtDev\Include\EgnFileUtils.h" #include "\EgtDev\Include\EgnStringUtils.h" -#include "\EgtDev\Include\EgnStringConverter.h" +#include "\EgtDev\Include\EgtStringConverter.h" #include using namespace std ; diff --git a/GetModuleVer.cpp b/GetModuleVer.cpp index 4f834be..1cf8050 100644 --- a/GetModuleVer.cpp +++ b/GetModuleVer.cpp @@ -14,7 +14,7 @@ //--------------------------- Include ---------------------------------------- #include "stdafx.h" #include "\EgtDev\Include\EgnGetModuleVer.h" -#include "\EgtDev\Include\EgnStringConverter.h" +#include "\EgtDev\Include\EgtStringConverter.h" #include "\EgtDev\Include\EgnStringUtils.h" #include diff --git a/GetOsInfo.cpp b/GetOsInfo.cpp index f219a3a..0b3257f 100644 --- a/GetOsInfo.cpp +++ b/GetOsInfo.cpp @@ -14,8 +14,8 @@ //--------------------------- Include ---------------------------------------- #include "Stdafx.h" #include "/EgtDEv/Include/EGnPcInfo.h" -#include "/EgtDEv/Include/EgnStringUtils.h" -#include "/EgtDEv/Include/EgnStringConverter.h" +#include "/EgtDEv/Include/EGnStringUtils.h" +#include "/EgtDEv/Include/EgtStringConverter.h" #define NOMINMAX #include "Windows.h" #include "lmcons.h" diff --git a/LuaManager.cpp b/LuaManager.cpp index 4046fcb..13ce280 100644 --- a/LuaManager.cpp +++ b/LuaManager.cpp @@ -72,6 +72,8 @@ LuaMgr::GetVersion( string& sLuaVer) bool LuaMgr::SetLuaLibsDir( const string& sDir) { + // salvo il direttorio + m_sLuaLibsDir = sDir ; // recupero la stringa globale package.path lua_getglobal( m_pL, "package") ; lua_getfield( m_pL, -1, "path") ; @@ -95,6 +97,9 @@ LuaMgr::SetLuaLibsDir( const string& sDir) bool LuaMgr::Require( const string& sFile) { + // salvo nome libreria richiesta + m_sLastRequire = sFile ; + // eseguo lua_getglobal( m_pL, "require") ; lua_pushstring( m_pL, sFile.c_str()) ; int nErr = lua_pcall( m_pL, 1, 1, 0) ; /* call 'require(sFile)' */ @@ -228,10 +233,3 @@ LuaMgr::ExecFile( const string& sFile) return false ; } } - -//---------------------------------------------------------------------------- -const string& -LuaMgr::GetLastError( void) -{ - return m_sLastError ; -} diff --git a/Scan.cpp b/Scan.cpp index db8f911..4e5a618 100644 --- a/Scan.cpp +++ b/Scan.cpp @@ -18,7 +18,7 @@ #include "stdafx.h" #include "/EgtDEv/Include/EGnScan.h" #include "/EgtDEv/Include/EGnStringUtils.h" -#include "/EgtDEv/Include/EGnStringConverter.h" +#include "/EgtDEv/Include/EgtStringConverter.h" #include "/EgtDev/Extern/Zlib/Include/zlib.h" using namespace std ; diff --git a/StringUtils.cpp b/StringUtils.cpp index a31ce6a..6f3ba5d 100644 --- a/StringUtils.cpp +++ b/StringUtils.cpp @@ -16,7 +16,7 @@ //--------------------------- Include ---------------------------------------- #include "stdafx.h" -#include "/EgtDEv/Include/EgnStringUtils.h" +#include "/EgtDEv/Include/EGnStringUtils.h" #include using namespace std ; @@ -48,7 +48,7 @@ FromString( const string& sVal, INTVECTOR& vnVal) // ciclo sui caratteri della stringa const char* pStart = sVal.c_str() ; SkipSpaces( pStart) ; - while ( *pStart >= '0' && *pStart <= '9') { + while ( ( *pStart >= '0' && *pStart <= '9') || *pStart == '+' || *pStart == '-') { char* pStop ; int nVal = strtol( pStart, &pStop, 10) ; vnVal.push_back( nVal) ; @@ -74,7 +74,8 @@ FromString( const string& sVal, DBLVECTOR& vdVal) // ciclo sui caratteri della stringa const char* pStart = sVal.c_str() ; SkipSpaces( pStart) ; - while ( *pStart >= '0' && *pStart <= '9') { + while ( ( *pStart >= '0' && *pStart <= '9') || + *pStart == '+' || *pStart == '-' || *pStart == '.') { char* pStop ; double dVal = strtod( pStart, &pStop) ; vdVal.push_back( dVal) ; @@ -89,6 +90,13 @@ FromString( const string& sVal, DBLVECTOR& vdVal) return ( *pStart == '\0' && errno == 0) ; } +//---------------------------------------------------------------------------- +bool +FromString( const std::string& sVal, STRVECTOR& vsVal) +{ + return Tokenize( sVal, ",", vsVal) ; +} + //---------------------------------------------------------------------------- const string ToString( double dVal, int nPrec) @@ -232,6 +240,25 @@ ToString( const DBLVECTOR& vdVal, int nPrec) return sDest ; } +//---------------------------------------------------------------------------- +const string +ToString( const STRVECTOR& vsVal) +{ + // se vettore vuoto, stringa vuota + if ( vsVal.empty()) + return "" ; + // costruisco la stringa + int nLen = 0 ; + for ( size_t i = 0 ; i < vsVal.size() ; ++ i) + nLen += int( vsVal[i].length()) + 1 ; + string sDest ; + sDest.reserve( nLen) ; + for ( size_t i = 0 ; i < vsVal.size() ; ++ i) + sDest += vsVal[i] + "," ; + sDest.pop_back() ; + return sDest ; +} + //---------------------------------------------------------------------------- void Split( const string& sString, const string& sSeparator, bool bFirstVsLast,