e-CryptIt Engine - Compression Xojo Plugin

EinhugurZipArchives.ZipArchiveReader Class (console safe)

A ZipArchiveReader class to read from or to extract a Zip archive.

Note:This class is in EinhugurZipArchives Namespace

ZipArchive
   ZipArchiveReader

class EinhugurZipArchives.ZipArchiveReader

Constructors

ZipArchiveReaderConstructor with no parameters for the ZipArchiveReader class.

Properties

EntryCount (Inherited) Count of entries in the zip archive.
IsOpen (Inherited) Returns true if the archive is open else false.
IsZip64 (Inherited) Returns true if the zip archive is Zip64 archive, else false.
LastError (Inherited) Returns the last error that occurred by last operation that was executed or zero if no error.

Methods

Close (Inherited) Closes the archive and finalises all unsaved changes.
EntryAt (Inherited) Returns a entry with full details in the Zip Archive at a given index.
EntryIsDirectory (Inherited) Returns true if a entry in the Zip Archive at a given index is a directory, else false.
EntryName (Inherited) Gets name of a entry in the Zip Archive at a given index.
ExtractAllExtracts all entries from the zip file to a given location.
ExtractDirectoryFromEntryIndexExtracts directory from a given index in the ZipArchive
ExtractFileFromEntryIndexExtracts file from a given index in the ZipArchive
ExtractFileToStringFromEntryIndexExtracts file to a string from a given index in the ZipArchive
ExtractFromEntryIndexExtracts file or directory from a given index in the ZipArchive
ExtractToFileLow level function to Extract to a file from a entry.
GetArchiveWriterConverts ZipArchiveReader to ZipArchiveWriter. This function is good to use to add entries to existing Zip file.
OpenOpen the zip archive.

Notes

Note:
Since this class is in namespace then you address it like this:

Dim zip as EinhugurZipArchives.ZipArchiveReader


or

using EinhugurZipArchives

Dim zip as ZipArchiveReader



Extract all example:
Dim f as FolderItem
Dim outFolder as FolderItem
Dim zip as EinhugurZipArchives.ZipArchiveReader

f = GetOpenFolderItem(FileTypes1.Zip)

outFolder = SelectFolder()

if outFolder = nil then
    return
end if

if f <> nil then
    zip = new EinhugurZipArchives.ZipArchiveReader()
   
    zip.Open(f)
   
    if zip.IsOpen then
       zip.ExtractAll(outFolder)
    else
      
       MsgBox "Could not open file"
    end if
end if



Known limitations:
Encrypted entries are not supported.
Apple and Microsoft extensions for special file flags are not supported.
Multi disk files are not supported.
No old style MacOS 9 resource forks are supported

Supported Platforms:

  • MacOS X Cocoa 32 bit
  • MacOS X Cocoa 64 bit
  • Windows 32 bit
  • Windows 64 bit
  • Linux 32 bit
  • Linux 64 bit
  • Linux ARM

    Unsupported Platforms:

  • MacOS X Carbon