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