Index

Package: Packfiles

Description

package Streams.Packfiles is

Classes

Packfile_Stream

type Packfile_Stream is new Root_Stream_Type with private;

Ancestors:

Ada.Streams.Root_Stream_Type

Primitive operations:

Read (overriding Ada.Streams.Read)
Write (overriding Ada.Streams.Write)
A Packfile_Stream is a stream implementation backed by an Allegro packfile. The stream can own the packfile and close it automatically if the stream is constructed with Open_Stream, or the stream can be wrapped around an existing packfile for streaming by using the Stream function. Both reading and writing is supported.

Types

A_Packfile_Stream

type A_Packfile_Stream is access all Packfile_Stream'Class;

Subprograms & Entries

Open_Stream

function Open_Stream
( filename, mode: String ) return A_Packfile_Stream;
Opens a packfile on disk for streaming operations. The underlying packfile will be automatically opened and closed by the stream.

Stream

function Stream
( f: not null A_Packfile ) return A_Packfile_Stream;
Creates a stream using an open packfile. 'f' remains owned by the caller and should not be freed until the stream has been closed.

EOF

function EOF
( stream: not null access Packfile_Stream'Class ) return Boolean;
Returns True of the stream reading has reached end-of-file.

Error

function Error
( stream: not null access Packfile_Stream'Class ) return Boolean;
Returns True if the stream encountered an error. This is a wrapper around Pack_FError.

Close

procedure Close
( stream: in out A_Packfile_Stream );
Closes the stream. If the stream was constructed with the Stream function, its packfile reference will simply be discarded because the stream does not own it.