Functions | |
HTUNZIPPER | TecUnzipper_Alloc (LPCSTR pszFilename) |
Allocated memory for a new unzipper handle. | |
HTUNZIPPER | TecUnzipper_AllocW (LPCWSTR pszFilename) |
Allocated memory for a new unzipper handle. | |
VOID | TecUnzipper_Free (HTUNZIPPER htUnzipper) |
Deallocates memory allocated by TecUnzipper_Alloc. | |
ERRCODE | TecUnzipper_DeleteAllFiles (HTUNZIPPER htUnzipper) |
Deletes all files and directories on disk that have been created by TecUnzipper_Extract. | |
ERRCODE | TecUnzipper_Base64Decode (HTUNZIPPER htUnzipper) |
Tests if the passed to TecUnzipper_Alloc is a BASE64 encoded string and decodes it to a temporary file. | |
ERRCODE | TecUnzipper_Extract (HTUNZIPPER htUnzipper, LPCSTR pszDirectory) |
Extracts a ZIP file into a temporary directory. | |
ERRCODE | TecUnzipper_ExtractW (HTUNZIPPER htUnzipper, LPCWSTR pszDirectory) |
Extracts a ZIP file into a temporary directory. | |
INT | TecUnzipper_GetFileCount (HTUNZIPPER htUnzipper) |
Returns the number of files that have been extracted. | |
LPCSTR | TecUnzipper_GetFile (HTUNZIPPER htUnzipper, INT nIndex) |
Returns the filename with the specified index (0. | |
INT | TecUnzipper_FindFileByExt (HTUNZIPPER htUnzipper, LPCSTR pszExtension, INT nStartIndex, BOOL bCaseInsensitiveSearch) |
Finds the first file in the set of extracted files that matches the specified file extension. | |
INT | TecUnzipper_FindFileByExtW (HTUNZIPPER htUnzipper, LPCWSTR pszExtension, INT nStartIndex, BOOL bCaseInsensitiveSearch) |
Finds the first file in the set of extracted files that matches the specified file extension. | |
LPSTR | TecUnzipper_Base64_Encode (LPCSTR szData, LONG lLen) |
Creates a BASE64 encoded string. | |
VOID | TecUnzipper_Base64_Free (LPSTR szStr) |
Free a BASE64 encoded string created with TecUnzipper_Base64_Encode. | |
LPCSTR | TecUnzipper_GetFilename (HTUNZIPPER htUnzipper) |
Returns the filename of the zip file being used or of the temp file created by TecUnzipper_Base64Decode. |
Functions in this group enable the software developer to implement an optimized handling of such zip-files (or BASE64 string).
Usually all TFORMer functions accepting files are trying to determine if it is a zip-file automatically (a BASE64 encoded file is determined by the BASE64:
prefix). When TFORMer detects a zip-file it is unzipped automatically to the temp-directory of the current user. This automatic unzipping requires TFORMer to clean up such temporary files after the function call ends. If you want to avoid the per-function unzipping and deleting, then implement the unzipping functionality yourself by the TecUnzipper-functions. Thereafter pass the resulting files to the TFORMer functions.
HTUNZIPPER hZip = TecUnzipper_Alloc( pszFilename ); if( !hZip ) return ERROR_OUTOFMEMORY;
TecUnzipper_Base64Decode( hZip );
eCode = TecUnzipper_Extract( hZip, NULL );
if( eCode == ErrOk ) {
INT nIndex = TecUnzipper_FindFileByExt( hZip, "TFR", -1, TRUE ); if( nIndex == -1 )
eCode = ERROR_FILE_NOT_FOUND;
else
pszFilename = TecUnzipper_GetFile( hZip, nIndex ); } else {
pszFilename = TecUnzipper_GetFilename( hZip ); eCode = ErrOk; }
TecUnzipper_DeleteAllFiles( hZip );
TecUnzipper_Free( hZip );
© 2006-2009 - all rights reserved by TEC-IT Datenverarbeitung GmbH |
![]() |
Generated on Wed Sep 2 16:01:09 2009 for TFORMer Runtime DLL/Shared Library with doxygen 1.5.8 |