Include :
- aggiornamenti.
This commit is contained in:
+33
-1
@@ -34,4 +34,36 @@ extern "C" {
|
||||
EEX_EXPORT void SetEExLogger( ILogger* pLogger) ;
|
||||
// imposta la chiave di protezione
|
||||
EEX_EXPORT void SetEExKey( const std::string& sKey) ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
#include "/EgtDev/Include/EGnStringUtils.h"
|
||||
#include "/EgtDev/Include/EgtILogger.h"
|
||||
#include "/EgtDev/Include/EgtKeyCodes.h"
|
||||
#include "/EgtDev/Include/SELkKeyProc.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Test della chiave per caricare la DLL
|
||||
inline bool
|
||||
TestKeyForEEx( const std::string& sKey, int nKeyOpt, ILogger* pLogger)
|
||||
{
|
||||
// verifico la chiave e le opzioni
|
||||
unsigned int nOpt1, nOpt2 ;
|
||||
int nOptExpDays ;
|
||||
int nRet = GetKeyOptions( sKey, KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV,
|
||||
nOpt1, nOpt2, nOptExpDays) ;
|
||||
if ( nRet != KEY_OK) {
|
||||
std::string sErr = "Error on Key (EXC/" + ToString( nRet) + ")" ;
|
||||
LOG_ERROR( pLogger, sErr.c_str()) ;
|
||||
return false ;
|
||||
}
|
||||
if ( ( nOpt1 & ( KEYOPT_EEX_INPBASE|KEYOPT_EEX_EXPBASE)) == 0 ||
|
||||
( nKeyOpt != 0 && ( nOpt1 & nKeyOpt) == 0) ||
|
||||
nOptExpDays < GetCurrDay()) {
|
||||
std::string sErr = "Error on Key (EXC/OPT)" ;
|
||||
LOG_ERROR( pLogger, sErr.c_str()) ;
|
||||
return false ;
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
ObjUserRegister<class T>::DoRegister( sName)
|
||||
#define OBJUSER_GETNAME( T) ObjUserRegister<class T>::GetName()
|
||||
#define OBJUSER_CREATE( sName) ObjUserFactory::Create( sName)
|
||||
#define OBJUSER_GETLIST( vsList) ObjUserFactory::GetList( vsList)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
template <class T>
|
||||
@@ -64,6 +65,8 @@ class ObjUserFactory
|
||||
EGK_EXPORT static bool Register( const std::string& sName, ObjUserCreator Creator) ;
|
||||
// per creare l'oggetto richiesto
|
||||
EGK_EXPORT static IObjUser* Create( const std::string& sName) ;
|
||||
// per restituire la lista degli oggetti registrati
|
||||
EGK_EXPORT static bool GetList( STRVECTOR& vsList) ;
|
||||
|
||||
private :
|
||||
ObjUserFactory( void) {}
|
||||
|
||||
+9
-1
@@ -1,7 +1,7 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2015-2015
|
||||
//----------------------------------------------------------------------------
|
||||
// File : EgnStringKeyVal.h Data : 23.05.15 Versione : 1.6e3
|
||||
// File : EGnStringKeyVal.h Data : 23.05.15 Versione : 1.6e3
|
||||
// Contenuto : Funzioni per gestione coppie chiave-valore in stringhe.
|
||||
//
|
||||
//
|
||||
@@ -45,6 +45,14 @@ IsValidVal( const std::string& sString)
|
||||
sString.find_first_not_of( " \t\r\n") != std::string::npos)) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
inline bool
|
||||
ValidateKeyVal( std::string& sString)
|
||||
{ std::string::size_type i ;
|
||||
while ( ( i = sString.find_first_of( "\t\r\n")) != std::string::npos)
|
||||
sString[i] = '_' ;
|
||||
return true ; }
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
inline bool
|
||||
SetVal( const std::string& sKey, const std::string& sVal, std::string& sString)
|
||||
|
||||
+33
-2
@@ -13,7 +13,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
class ILogger ;
|
||||
|
||||
//----------------------- Macro per import/export ----------------------------
|
||||
@@ -33,4 +32,36 @@ extern "C" {
|
||||
EGR_EXPORT void SetEGrLogger( ILogger* pLogger) ;
|
||||
// imposta la chiave di protezione
|
||||
EGR_EXPORT void SetEGrKey( const std::string& sKey) ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
#include "/EgtDev/Include/EGnStringUtils.h"
|
||||
#include "/EgtDev/Include/EgtILogger.h"
|
||||
#include "/EgtDev/Include/EgtKeyCodes.h"
|
||||
#include "/EgtDev/Include/SELkKeyProc.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Test della chiave per caricare la DLL
|
||||
inline bool
|
||||
TestKeyForEGr( const std::string& sKey, int nKeyOpt, ILogger* pLogger)
|
||||
{
|
||||
// verifico la chiave e le opzioni
|
||||
unsigned int nOpt1, nOpt2 ;
|
||||
int nOptExpDays ;
|
||||
int nRet = GetKeyOptions( sKey, KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV,
|
||||
nOpt1, nOpt2, nOptExpDays) ;
|
||||
if ( nRet != KEY_OK) {
|
||||
std::string sErr = "Error on Key (GRC/" + ToString( nRet) + ")" ;
|
||||
LOG_ERROR( pLogger, sErr.c_str()) ;
|
||||
return false ;
|
||||
}
|
||||
if ( ( nOpt1 & KEYOPT_EGR_BASE) == 0 ||
|
||||
( nKeyOpt != 0 && ( nOpt1 & nKeyOpt) == 0) ||
|
||||
nOptExpDays < GetCurrDay()) {
|
||||
std::string sErr = "Error on Key (GRC/OPT)" ;
|
||||
LOG_ERROR( pLogger, sErr.c_str()) ;
|
||||
return false ;
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
|
||||
+33
-1
@@ -34,4 +34,36 @@ extern "C" {
|
||||
EMK_EXPORT void SetEMkLogger( ILogger* pLogger) ;
|
||||
// imposta la chiave di protezione
|
||||
EMK_EXPORT void SetEMkKey( const std::string& sKey) ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
#include "/EgtDev/Include/EGnStringUtils.h"
|
||||
#include "/EgtDev/Include/EgtILogger.h"
|
||||
#include "/EgtDev/Include/EgtKeyCodes.h"
|
||||
#include "/EgtDev/Include/SELkKeyProc.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Test della chiave per caricare la DLL
|
||||
inline bool
|
||||
TestKeyForEMk( const std::string& sKey, int nKeyOpt, ILogger* pLogger)
|
||||
{
|
||||
// verifico la chiave e le opzioni
|
||||
unsigned int nOpt1, nOpt2 ;
|
||||
int nOptExpDays ;
|
||||
int nRet = GetKeyOptions( sKey, KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV,
|
||||
nOpt1, nOpt2, nOptExpDays) ;
|
||||
if ( nRet != KEY_OK) {
|
||||
std::string sErr = "Error on Key (MKC/" + ToString( nRet) + ")" ;
|
||||
LOG_ERROR( pLogger, sErr.c_str()) ;
|
||||
return false ;
|
||||
}
|
||||
if ( ( nOpt1 & KEYOPT_EMK_BASE) == 0 ||
|
||||
( nKeyOpt != 0 && ( nOpt1 & nKeyOpt) == 0) ||
|
||||
nOptExpDays < GetCurrDay()) {
|
||||
std::string sErr = "Error on Key (MKC/OPT)" ;
|
||||
LOG_ERROR( pLogger, sErr.c_str()) ;
|
||||
return false ;
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user