![]() |
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 <CkZipW.h> #include <CkZipEntryW.h> void ChilkatSample(void) { // ------------------------------------------------------------------------ // The NextEntry method is deprecated. // See below or code showing how to rewrite using EntryAt/GetNext CkZipW zip; bool success = zip.OpenZip(L"qa_data/zips/xml_files.zip"); if (success != true) { wprintf(L"%s\n",zip.lastErrorText()); return; } CkZipEntryW *entry = zip.FirstEntry(); if (zip.get_LastMethodSuccess() == false) { wprintf(L"This zip archive is empty.\n"); return; } bool finished = false; while (finished == false) { if (entry->get_IsDirectory() == false) { wprintf(L"%s\n",entry->fileName()); } else { wprintf(L"(directory) %s\n",entry->fileName()); } CkZipEntryW *next = entry->NextEntry(); if (entry->get_LastMethodSuccess() == false) { finished = true; } delete entry; entry = next; } zip.CloseZip(); wprintf(L"----\n"); // ------------------------------------------------------------------------ // Do the equivalent using EntryAt/GetNext. success = zip.OpenZip(L"qa_data/zips/xml_files.zip"); CkZipEntryW ze; zip.EntryAt(0,ze); bool entryValid = true; while (entryValid == true) { if (ze.get_IsDirectory() == false) { wprintf(L"%s\n",ze.fileName()); } else { wprintf(L"(directory) %s\n",ze.fileName()); } entryValid = ze.GetNext(); } zip.CloseZip(); } |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.