Libraries
Bzip2 Source Code
 previous   up   next 

Types
bzip2File
File implementation type to decompress a BZIP2 file.

bzip2File

const type: bzip2File

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


Function Summary
file
openBzip2File (inout file: compressed, READ)
Open a BZIP2 file for reading (decompression).
void
close (in bzip2File: aFile)
Close a bzip2File.
char
getc (inout bzip2File: inFile)
Read a character from a bzip2File.
string
gets (inout bzip2File: inFile, in integer: maxLength)
Read a string with maximum length from a bzip2File.
boolean
eof (in bzip2File: inFile)
Determine the end-of-file indicator.
boolean
hasNext (inout bzip2File: inFile)
Determine if at least one character can be read successfully.
integer
length (inout bzip2File: aFile)
Obtain the length of a file.
boolean
seekable (in bzip2File: aFile)
Determine if the file aFile is seekable.
void
seek (inout bzip2File: aFile, in integer: position)
Set the current file position.
integer
tell (in bzip2File: aFile)
Obtain the current file position.

Function Detail

openBzip2File

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

Open a BZIP2 file for reading (decompression). BZIP2 is a file format used for compression. Reading from the file delivers decompressed data. Writing is not supported.

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

close

const proc: close (in bzip2File: aFile)

Close a bzip2File.


getc

const func char: getc (inout bzip2File: inFile)

Read a character from a bzip2File.

Returns:
the character read.

gets

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

Read a string with maximum length from a bzip2File.

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

eof

const func boolean: eof (in bzip2File: 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 bzip2File: 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 bzip2File: 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 bzip2File: 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 bzip2File is seekable.

seek

const proc: seek (inout bzip2File: 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 bzip2File: 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.


 previous   up   next