diff --git a/API_MachMgr.cpp b/API_MachMgr.cpp index f0c0798..a1c7b0f 100644 --- a/API_MachMgr.cpp +++ b/API_MachMgr.cpp @@ -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 //-----------------------------------------------------------------------------