Libraries
XZ Source Code
 previous   up   next 

Types
xzFile
File implementation type to decompress a XZ file.

xzFile

const type: xzFile

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


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

Function Detail

openXzFile

const func file: openXzFile (inout file: compressed)

Open a XZ file for reading (decompression). XZ 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 XZ format.

close

const proc: close (in xzFile: aFile)

Close a xzFile.


getc

const func char: getc (inout xzFile: inFile)

Read a character from a xzFile.

Returns:
the character read.

gets

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

Read a string with maximum length from a xzFile.

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

eof

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

seek

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