Gzip Class
Properties Methods Events Configuration Settings Errors
The Gzip class implements a gzip compressor and decompressor. It is compliant with RFC 1952 and compatible with the UNIX gzip and gunzip utilities.
Syntax
Gzip
Remarks
The gzip file format is typically used only to archive a single file. Accordingly, the operation of the class is simpler than that of the other classs.
To compress with the class, set ArchiveFile to the name of the gzip file to be created, and FileDecompressedName to the name of the file to be compressed. Finally, invoke Compress. To extract the file, first set ArchiveFile. FileDecompressedName may then be set; if not, it will automatically be set from the gzip file headers. Finally, invoke the Extract or Compress method.
.tar.gz files may be created or extracted in one step by using the Tar class. See the documentation for Tar for more details.
Example (Creating a Gzip File)
ZipControl.ArchiveFile = "c:\test.gz" ZipControl.FileDecompressedName = "c:\test.txt" ZipControl.Compress()Example (Extracting from a Gzip File)
ZipControl.ArchiveFile = "c:\test.gz" ZipControl.Scan() ZipControl.FileDecompressedName = "c:\test.txt" ZipControl.Extract()
Property List
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
ArchiveFile | The name of the zip, gzip, tar, or jar archive. |
CompressionLevel | The compression level to use. |
CompressionMethod | The compression method for the class to use. |
ExtractToPath | A base path to decompress to. |
FileCompressedDate | The date and time of the compressed file, as stored within the gzip archive. |
FileCompressedName | Filename, as stored inside of the archive. |
FileDecompressedName | File name to decompress to, or compress from. |
FileDecompressedSize | Gets the size of the file, as decompressed outside the archive. |
FileInputData | The data of the file to be compressed. |
GzipData | (Decompression only) The gzip file contents as a byte array. |
HasMoreData | Shows whether or not there is more data in the gzip archive. |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
Abort | Aborts the current operation. |
Append | Adds specified file to an existing archive. |
Compress | Creates the compressed gzip archive. |
Config | Sets or retrieves a configuration setting. |
Extract | Extracts the compressed file from the gzip archive. |
ExtractAll | Extracts all files from the compressed archive. |
Reset | Resets the class. |
Scan | Scans the compressed archive. |
SetArchiveInputStream | The stream to read the zip, tar, jar, or gzip archive from. |
SetArchiveOutputStream | The stream to write the zip, tar, jar, or gzip archive to. |
SetFileInputStream | The input stream to read the decompressed data from. |
Event List
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
BeginFile | Fired before a file is processed. |
EndFile | Fired after a file is processed. |
Error | Information about non-fatal errors. |
Overwrite | Fired whenever a file exists and may be overwritten. |
Progress | Fired as progress is made. |
Configuration Settings
The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.
FileComment | Holds the comment associated with the archive. |
PreserveModifiedTime | Whether or not to preserve the original modified time on extracted files. |
WriteToProgressEvent | Whether or not to write data to the Progress Event. |
BuildInfo | Information about the product's build. |
CodePage | The system code page used for Unicode to Multibyte translations. |
LicenseInfo | Information about the current license. |
ProcessIdleEvents | Whether the class uses its internal event loop to process events when the main thread is idle. |
SelectWaitMillis | The length of time in milliseconds the class will wait when DoEvents is called if there are no events to process. |
UseInternalSecurityAPI | Tells the class whether or not to use the system security libraries or an internal implementation. |