![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Unicode C) Transition from ZipEntry.NextEntry to ZipEntry.GetNextProvides instructions for replacing deprecated NextEntry method calls with GetNext. Note: This example requires Chilkat v11.0.0 or greater.
#include <C_CkZipW.h> #include <C_CkZipEntryW.h> void ChilkatSample(void) { HCkZipW zip; BOOL success; HCkZipEntryW entry; BOOL finished; HCkZipEntryW next; HCkZipEntryW ze; BOOL entryValid; // ------------------------------------------------------------------------ // The NextEntry method is deprecated. // See below or code showing how to rewrite using EntryAt/GetNext zip = CkZipW_Create(); success = CkZipW_OpenZip(zip,L"qa_data/zips/xml_files.zip"); if (success != TRUE) { wprintf(L"%s\n",CkZipW_lastErrorText(zip)); CkZipW_Dispose(zip); return; } entry = CkZipW_FirstEntry(zip); if (CkZipW_getLastMethodSuccess(zip) == FALSE) { wprintf(L"This zip archive is empty.\n"); CkZipW_Dispose(zip); return; } finished = FALSE; while (finished == FALSE) { if (CkZipEntryW_getIsDirectory(entry) == FALSE) { wprintf(L"%s\n",CkZipEntryW_fileName(entry)); } else { wprintf(L"(directory) %s\n",CkZipEntryW_fileName(entry)); } next = CkZipEntryW_NextEntry(entry); if (CkZipEntryW_getLastMethodSuccess(entry) == FALSE) { finished = TRUE; } CkZipEntryW_Dispose(entry); entry = next; } CkZipW_CloseZip(zip); wprintf(L"----\n"); // ------------------------------------------------------------------------ // Do the equivalent using EntryAt/GetNext. success = CkZipW_OpenZip(zip,L"qa_data/zips/xml_files.zip"); ze = CkZipEntryW_Create(); CkZipW_EntryAt(zip,0,ze); entryValid = TRUE; while (entryValid == TRUE) { if (CkZipEntryW_getIsDirectory(ze) == FALSE) { wprintf(L"%s\n",CkZipEntryW_fileName(ze)); } else { wprintf(L"(directory) %s\n",CkZipEntryW_fileName(ze)); } entryValid = CkZipEntryW_GetNext(ze); } CkZipW_CloseZip(zip); CkZipW_Dispose(zip); CkZipEntryW_Dispose(ze); } |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.