Index

Package: Archives

Description

package Archives is

Classes

Archive (abstract)

type Archive is abstract new Limited_Object with private;

Ancestors:

Immediate Children:

Archives.Zip_Archives.Zip_Archive

Primitive operations:

Construct
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.To_String (Inherited)
Open_Chunk (overriding Stream_Element_Array)
An Archive is a data file containing individually addressable files. The Archive class should be subclassed for each archive file format supported by the application.

Types

A_Archive

type A_Archive is access all Archive'Class;

Constants & Global variables

FILE_NOT_FOUND

FILE_NOT_FOUND : exception;
Raised if an archive or a file in an archive can't be found.

READ_ERROR

READ_ERROR : exception;
Raised if a read error occurs while attempting to load an archive. The archive file is probably corrupt.

ARCHIVE_FORMAT_ERROR

ARCHIVE_FORMAT_ERROR : exception;
Raised if the file extension of an archive is not supported.

Subprograms & Entries

Load_Archive

function Load_Archive
( path: String ) return A_Archive;
Loads an Archive into memory. An exception is raised on error.

Load_Archive

function Load_Archive
( resource: not null A_Resource_File ) return A_Archive;
Loads an Archive into memory from a resource file. The resource can be unloaded independently of the Archive after calling this function.

Exists (abstract)

function Exists
( this: access Archive;
filename: String ) return Boolean is abstract;
Returns true if 'filename' exists in the Archive.

Load_Bitmap (abstract)

function Load_Bitmap
( this: access Archive;
filename: String ) return A_Bitmap is abstract;
Reads 'filename' from the Archive and opens it as an Allegro bitmap. The Archive can be closed independently of the bitmap after calling this function. An exception is raised on error.

Open (abstract)

function Open
( this: access Archive;
filename: String ) return A_Packfile is abstract;
Reads 'filename' from the Archive and opens it as an in-memory packfile. The Archive can be closed independently of the bitmap after calling this function. An exception is raised on error.

Open_Chunk (abstract)

function Open_Chunk
( this: access Archive;
filename: String ) return access Stream_Element_Array is abstract;
Reads 'filename' from the Archive and returns it as an in-memory buffer. The caller takes ownership of the returned buffer; closing the Archive does not affect it. An exception is raised on error.

Delete

procedure Delete
( this: in out A_Archive );
Deletes the Archive.