Include :
- aggiornamento prototipi.
This commit is contained in:
+12
-20
@@ -1,7 +1,7 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2013-2013
|
||||
// EgalTech 2013-2019
|
||||
//----------------------------------------------------------------------------
|
||||
// File : EgtIniFile.h Data : 10.12.13 Versione : 1.4a4
|
||||
// File : EgtIniFile.h Data : 17.03.19 Versione : 2.1c2
|
||||
// Contenuto : Funzioni per leggere e scrivere stringhe UTF-8 in file INI.
|
||||
//
|
||||
//
|
||||
@@ -21,36 +21,28 @@
|
||||
inline std::string
|
||||
GetPrivateProfileStringUtf8( const char* szSection, const char* szKey, const char* szDefault, const char* szIniFile)
|
||||
{
|
||||
int nChar ;
|
||||
wchar_t szBuffW[_MAX_PATH] ;
|
||||
|
||||
|
||||
// leggo la stringa dal file INI come ANSI/UTF-8 in WChar e metto in Char
|
||||
nChar = GetPrivateProfileStringW( AtoW( szSection), AtoW( szKey), NULL, szBuffW, _MAX_PATH, AtoW( szIniFile)) ;
|
||||
wchar_t szBuffW[_MAX_PATH] ;
|
||||
int nChar = GetPrivateProfileStringW( AtoW( szSection), AtoW( szKey), NULL, szBuffW, _MAX_PATH, AtoW( szIniFile)) ;
|
||||
|
||||
if ( nChar > 0) {
|
||||
return LPSTR( WtoAEX<>( szBuffW, CP_ACP)) ;
|
||||
}
|
||||
else
|
||||
if ( nChar <= 0)
|
||||
return szDefault ;
|
||||
|
||||
return LPSTR( WtoAEX<>( szBuffW, CP_ACP)) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
inline std::string
|
||||
GetPrivateProfileStringUtf8( const char* szSection, const char* szKey, const char* szDefault, const wchar_t* szIniFile)
|
||||
{
|
||||
int nChar ;
|
||||
wchar_t szBuffW[_MAX_PATH] ;
|
||||
|
||||
|
||||
// leggo la stringa dal file INI come ANSI/UTF-8 in WChar e metto in Char
|
||||
nChar = GetPrivateProfileStringW( AtoW( szSection), AtoW( szKey), NULL, szBuffW, _MAX_PATH, szIniFile) ;
|
||||
wchar_t szBuffW[_MAX_PATH] ;
|
||||
int nChar = GetPrivateProfileStringW( AtoW( szSection), AtoW( szKey), NULL, szBuffW, _MAX_PATH, szIniFile) ;
|
||||
|
||||
if ( nChar > 0) {
|
||||
return LPSTR( WtoAEX<>( szBuffW, CP_ACP)) ;
|
||||
}
|
||||
else
|
||||
if ( nChar <= 0)
|
||||
return szDefault ;
|
||||
|
||||
return LPSTR( WtoAEX<>( szBuffW, CP_ACP)) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user