Libraries
Zstandard Source Code
 previous   up   next 

Types
zstdFile
File implementation type to decompress a Zstandard file.

zstdFile

const type: zstdFile

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


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

Function Detail

openZstdFile

const func file: openZstdFile (inout file: compressed)

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

close

const proc: close (in zstdFile: aFile)

Close a zstdFile.


getc

const func char: getc (inout zstdFile: inFile)

Read a character from a zstdFile.

Returns:
the character read.

gets

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

Read a string with maximum length from a zstdFile.

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

eof

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

seek

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