EgtInterface :
- aggiunte interfacce per funzioni EgtTdbExport, EgtTdbToBeImported e EgtTdbImport.
This commit is contained in:
@@ -893,6 +893,60 @@ __stdcall EgtTdbGetToolHolderDir( wchar_t*& wsTHolderDir)
|
||||
return (( wsTHolderDir == nullptr) ? FALSE : TRUE) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtTdbExport( const wchar_t* wsToolsNames, const wchar_t* wsOutFile)
|
||||
{
|
||||
STRVECTOR vsToolsNames ;
|
||||
if ( ! Tokenize( string( wstrztoA( wsToolsNames)), "\n", vsToolsNames))
|
||||
return FALSE ;
|
||||
return( ExeTdbExport( vsToolsNames, string( wstrztoA( wsOutFile))) ? TRUE : FALSE) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtTdbToBeImported( const wchar_t* wsFile, wchar_t*& wsToolsNames)
|
||||
{
|
||||
if ( &wsToolsNames == nullptr)
|
||||
return FALSE ;
|
||||
STRVECTOR vsToolsNames ;
|
||||
if ( ! ExeTdbToBeImported( string( wstrztoA( wsFile)), vsToolsNames))
|
||||
return FALSE ;
|
||||
string sToolsNames ;
|
||||
for ( const auto& sName : vsToolsNames) {
|
||||
if ( ! sToolsNames.empty())
|
||||
sToolsNames += "\n" ;
|
||||
sToolsNames += sName ;
|
||||
}
|
||||
wsToolsNames = _wcsdup( stringtoW( sToolsNames)) ;
|
||||
return (( wsToolsNames == nullptr) ? FALSE : TRUE) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtTdbImport( const wchar_t* wsFile, const wchar_t* wsToolsToImport, const wchar_t* wsToolsNames, wchar_t*& wsImported)
|
||||
{
|
||||
if ( &wsImported == nullptr)
|
||||
return FALSE ;
|
||||
STRVECTOR vsToolsToImport ;
|
||||
if ( ! Tokenize( string( wstrztoA( wsToolsToImport)), "\n", vsToolsToImport))
|
||||
return FALSE ;
|
||||
STRVECTOR vsToolsNames ;
|
||||
if ( ! Tokenize( string( wstrztoA( wsToolsNames)), "\n", vsToolsNames))
|
||||
return FALSE ;
|
||||
STRVECTOR vsImported ;
|
||||
if ( ! ExeTdbImport( string( wstrztoA( wsFile)), vsToolsToImport, vsToolsNames, vsImported))
|
||||
return FALSE ;
|
||||
string sImported ;
|
||||
for ( const auto& sName : vsImported) {
|
||||
if ( ! sImported.empty())
|
||||
sImported += "\n" ;
|
||||
sImported += sName ;
|
||||
}
|
||||
wsImported = _wcsdup( stringtoW( sImported)) ;
|
||||
return (( wsToolsNames == nullptr) ? FALSE : TRUE) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Setup
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user