Libraries
Gzip Source Code
 previous   up   next 

Types
gzipFile
File implementation type to decompress a GZIP file.
gzipWriteFile
File implementation type to compress data with the GZIP format.

gzipFile

const type: gzipFile

File implementation type to decompress a GZIP file. GZIP is a file format used for compression.


gzipWriteFile

const type: gzipWriteFile

File implementation type to compress data with the GZIP format.


Function Summary
string
gzuncompress (in string: compressed)
Decompress a string that was compressed with zlib (RFC 1950).
string
gunzip (in string: compressed)
Decompress a string that was compressed with gzip (RFC 1952).
file
openGzipFile (inout file: compressed, READ)
Open a GZIP file for reading (decompression).
void
close (in gzipFile: aFile)
Close a gzipFile.
char
getc (inout gzipFile: inFile)
Read a character from a gzipFile.
string
gets (inout gzipFile: inFile, in integer: maxLength)
Read a string with maximum length from a gzipFile.
boolean
eof (in gzipFile: inFile)
Determine the end-of-file indicator.
boolean
hasNext (inout gzipFile: inFile)
Determine if at least one character can be read successfully.
integer
length (inout gzipFile: aFile)
Obtain the length of a file.
boolean
seekable (in gzipFile: aFile)
Determine if the file aFile is seekable.
void
seek (inout gzipFile: aFile, in integer: position)
Set the current file position.
integer
tell (in gzipFile: aFile)
Obtain the current file position.
string
gzip (in string: uncompressed)
Compress a string to the gzip format.
file
openGzipFile (inout file: destFile, WRITE)
Open a GZIP file for writing (compression)
void
close (inout gzipWriteFile: aFile)
Close a gzipWriteFile.
void
write (inout gzipWriteFile: outFile, in string: stri)
Write the string stri to a gzipWriteFile.
integer
length (in gzipWriteFile: outFile)
Obtain the length of a file.
integer
tell (in gzipWriteFile: outFile)
Obtain the current file position.

Function Detail

gzuncompress

const func string: gzuncompress (in string: compressed)

Decompress a string that was compressed with zlib (RFC 1950). Zlib uses the DEFLATE compression algorithm. DEFLATE uses a combination of the LZ77 algorithm and Huffman coding. Additionally to DEFLATE zlib uses a small header.

Returns:
the uncompressed string.
Raises:
RANGE_ERROR - If compressed is not in zlib format.

gunzip

const func string: gunzip (in string: compressed)

Decompress a string that was compressed with gzip (RFC 1952). Gzip uses the DEFLATE compression algorithm. DEFLATE uses a combination of the LZ77 algorithm and Huffman coding. Additionally to DEFLATE gzip uses a magic number and a header.

Returns:
the uncompressed string.
Raises:
RANGE_ERROR - If compressed is not in gzip format.

openGzipFile

const func file: openGzipFile (inout file: compressed, READ)

Open a GZIP file for reading (decompression). GZIP is a file format used for compression. Reading from the file delivers decompressed data. Writing is not supported. Gzip uses the DEFLATE compression algorithm. DEFLATE uses a combination of the LZ77 algorithm and Huffman coding. Additionally to DEFLATE gzip uses a magic number and a header.

Returns:
the file opened, or STD_NULL if the file is not in GZIP format.

close

const proc: close (in gzipFile: aFile)

Close a gzipFile.


getc

const func char: getc (inout gzipFile: inFile)

Read a character from a gzipFile.

Returns:
the character read.

gets

const func string: gets (inout gzipFile: inFile, in integer: maxLength)

Read a string with maximum length from a gzipFile.

Returns:
the string read.
Raises:
RANGE_ERROR - The parameter maxLength is negative.

eof

const func boolean: eof (in gzipFile: inFile)

Determine the end-of-file indicator. The end-of-file indicator is set if at least one request to read from the file failed.

Returns:
TRUE if the end-of-file indicator is set, FALSE otherwise.

hasNext

const func boolean: hasNext (inout gzipFile: inFile)

Determine if at least one character can be read successfully. This function allows a file to be handled like an iterator.

Returns:
FALSE if getc would return EOF, TRUE otherwise.

length

const func integer: length (inout gzipFile: aFile)

Obtain the length of a file. The file length is measured in bytes.

Returns:
the length of a file, or 0 if it cannot be obtained.

seekable

const boolean: seekable (in gzipFile: aFile)

Determine if the file aFile is seekable. If a file is seekable the functions seek and tell can be used to set and and obtain the current file position.

Returns:
TRUE, since a gzipFile is seekable.

seek

const proc: seek (inout gzipFile: aFile, in integer: position)

Set the current file position. The file position is measured in bytes from the start of the file. The first byte in the file has the position 1.

Raises:
RANGE_ERROR - The file position is negative or zero.

tell

const func integer: tell (in gzipFile: aFile)

Obtain the current file position. The file position is measured in bytes from the start of the file. The first byte in the file has the position 1.

Returns:
the current file position.

gzip

const func string: gzip (in string: uncompressed)

Compress a string to the gzip format. Gzip uses the DEFLATE compression algorithm. DEFLATE uses a combination of the LZ77 algorithm and Huffman coding. Additionally to DEFLATE gzip uses a magic number and a header.

Returns:
the compressed string.

openGzipFile

const func file: openGzipFile (inout file: destFile, WRITE)

Open a GZIP file for writing (compression) GZIP is a file format used for compression. Writing to the file compresses the data to destFile. Reading is not supported. Gzip uses the DEFLATE compression algorithm. DEFLATE uses a combination of the LZ77 algorithm and Huffman coding. Additionally to DEFLATE gzip uses a magic number and a header.

Returns:
the file opened.

close

const proc: close (inout gzipWriteFile: aFile)

Close a gzipWriteFile.


write

const proc: write (inout gzipWriteFile: outFile, in string: stri)

Write the string stri to a gzipWriteFile.


length

const func integer: length (in gzipWriteFile: outFile)

Obtain the length of a file. The number of uncompressed characters written to the file.

Returns:
the length of a file.

tell

const func integer: tell (in gzipWriteFile: outFile)

Obtain the current file position. The file position is measured in bytes from the start of the file. The first byte in the file has the position 1.

Returns:
the current file position.


 previous   up   next