Include :

- aggiornamento codici protezione librerie a 27
- aggiornamento ToString con uso std::to_chars.
This commit is contained in:
Dario Sassi
2025-01-09 17:53:27 +01:00
parent 481a86c2fa
commit 6c57d57be1
3 changed files with 20 additions and 18 deletions
+13 -12
View File
@@ -18,6 +18,7 @@
#include "/EgtDev/Extern/fast_float/fast_float.h"
#include <algorithm>
#include <array>
#include <charconv>
//----------------------- Macro per import/export -----------------------------
#undef EGN_EXPORT
@@ -187,12 +188,12 @@ inline const std::string
ToString( int nVal, int nPrec = 1, int nRadix = 10)
{
// eseguo conversione
char szBuff[24] ;
int nErr = _itoa_s( nVal, szBuff, nRadix) ;
// se errore, ritorno stringa opportuna
if ( nErr != 0) {
_ASSERT( 0) ;
return "#Error" ;
const int nBuffSize = 36 ;
char szBuff[nBuffSize]{} ;
auto Res = std::to_chars( szBuff, szBuff + nBuffSize - 1, nVal, nRadix) ;
if ( Res.ec != std::errc()) {
std::string sOut = make_error_code( Res.ec).message() ;
return "#Error (" + sOut + ")" ;
}
// verifico lunghezza minima
int nLen = (int) strlen( szBuff) ;
@@ -207,12 +208,12 @@ inline const std::string
ToString( unsigned int nVal, int nPrec = 1, int nRadix = 10)
{
// eseguo conversione
char szBuff[24] ;
int nErr = _ultoa_s( nVal, szBuff, nRadix) ;
// se errore, ritorno stringa opportuna
if ( nErr != 0) {
_ASSERT( 0) ;
return "#Error" ;
const int nBuffSize = 36 ;
char szBuff[nBuffSize]{} ;
auto Res = std::to_chars( szBuff, szBuff + nBuffSize - 1, nVal, nRadix) ;
if ( Res.ec != std::errc()) {
std::string sOut = make_error_code( Res.ec).message() ;
return "#Error (" + sOut + ")" ;
}
// verifico lunghezza minima
int nLen = (int) strlen( szBuff) ;
+3 -3
View File
@@ -101,9 +101,9 @@ B64Decode( const std::string& sB64Sou, std::string& sDest)
if ( p != nullptr)
nVal = char( p - EncB64) ;
in[phase] = (( c < 43 || c > 122) ? -1 : (int) DecB64[ c - 43]) ;
if ( in[phase] != 0 )
in[phase] = ((in[phase] == (int)'$') ? -1 : in[phase] - 62) ;
if ( in[phase] != -1 ) {
if ( in[phase] != 0 )
in[phase] = ((in[phase] == (int)'$') ? -1 : in[phase] - 62) ;
if ( in[phase] != -1 ) {
phase = (phase + 1) % 4 ;
if ( phase == 0) {
decodeblock( in, sDest) ;
+4 -3
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2015-2024
// EgalTech 2015-2025
//----------------------------------------------------------------------------
// File : EgtKeyCodes.h Data : 16.01.24 Versione : 2.6a1
// File : EgtKeyCodes.h Data : 07.01.25 Versione : 2.7a1
// Contenuto : Costanti per codici di protezione librerie di base.
//
//
@@ -18,6 +18,7 @@
// 01.01.22 DS Passaggio a versione 24.
// 01.01.23 DS Passaggio a versione 25.
// 16.01.24 DS Passaggio a versione 26.
// 07.01.25 DS Passaggio a versione 27.
//
//----------------------------------------------------------------------------
@@ -25,7 +26,7 @@
//----------------------------------------------------------------------------
const int KEY_BASELIB_PROD = 207 ;
const int KEY_BASELIB_VER = 2612 ;
const int KEY_BASELIB_VER = 2701 ;
const int KEY_BASELIB_LEV = 1 ;
//----------------------------------------------------------------------------