Index

Package: Streams

Description

package UnZip.Streams is
UnZip.Streams -------------- Extracts, as a stream, a file which is has been compressed into a Zip archive. The Zip archive itself (the input) can be a file or a more general stream. This package is resembling Ada.Streams.Stream_IO, to facilitate transition.

Classes

UnZip_Stream_Type (private)

type UnZip_Stream_Type is new Ada.Streams.Root_Stream_Type with record
      state         : UZS_state := uninitialized;
      archive_info  : Zip.Zip_info; -- archive info (.zip file, directory)
      delete_info_on_closing  : Boolean;
      file_name     : p_String; -- name of zipped file to unzip from archive
      Uncompressed  : p_Stream_Element_Array; -- whole uncompressed data
      index         : Ada.Streams.Stream_Element_Offset;
   end record;

Ancestors:

Ada.Streams.Root_Stream_Type

Primitive operations:

Read (overriding Ada.Streams.Read)
Write (overriding Ada.Streams.Write)

Types

Stream_Access

subtype Stream_Access is Ada.Streams.Stream_IO.Stream_Access;

References:

unzip-streams.ads:19:12 (declaration)
unzip-streams.adb:320:54 (reference)
unzip-streams.adb:320:72 (reference)
unzip-streams.ads:64:54 (reference)

Zipped_File_Type

type Zipped_File_Type is private;

UZS_state (private)

type UZS_state is (
      uninitialized,
      data_uncompressed, -- In that model, all data is unzipped in one
                         --   time, into memory. If you have a smarter
                         --   idea (small buffer with tasking, write me!)
      end_of_zip         -- We have reached the end, not yet closed
);

References:

unzip-streams.ads:71:9 (declaration)
unzip-streams.ads:82:23 (reference)

p_String (private)

type p_String is access String;

References:

unzip-streams.ads:79:9 (declaration)
unzip-streams.adb:10:42 (reference)
unzip-streams.ads:85:23 (reference)

Constants & Global variables

Use_Error

Use_Error     : exception renames Ada.IO_Exceptions.Use_Error;

References:

unzip-streams.ads:66:4 (declaration)
unzip-streams.adb:159:16 (reference)
unzip-streams.adb:177:16 (reference)
unzip-streams.adb:198:16 (reference)
unzip-streams.adb:281:16 (reference)

End_Error

End_Error     : exception renames Ada.IO_Exceptions.End_Error;

References:

unzip-streams.ads:67:4 (declaration)

Subprograms & Entries

Open

procedure Open 
(File: in out Zipped_File_Type;
-- File - in - archive handle Archive_Name: String;
-- Name of archive file Name: String;
-- Name of zipped entry Password: String := "";
-- Decryption password Case_sensitive: Boolean := False );

Calls:

Open defined at unzip-streams.ads:51:14
Zip.Load defined at zip.ads:62:14
Version : Zip as a file

Open

procedure Open 
(File: in out Zipped_File_Type;
-- File - in - archive handle Archive_Stream: Zip_Streams.Zipstream_Class;
-- Archive's stream Name: String;
-- Name of zipped entry Password: String := "";
-- Decryption password Case_sensitive: Boolean := False );

Calls:

Open defined at unzip-streams.ads:51:14
Zip.Load defined at zip.ads:68:14
Version : Zip as a stream

Open

procedure Open 
(File: in out Zipped_File_Type;
-- File - in - archive handle Archive_Info: Zip.Zip_info;
-- Archive's Zip_info Name: String;
-- Name of zipped entry Password: String := "";
-- Decryption password Case_sensitive: Boolean := False );

Is_Open

function Is_Open     
(File: Zipped_File_Type) return Boolean;

References:

unzip-streams.ads:61:13 (declaration)
unzip-streams.adb:170:13 (body)

End_Of_File

function End_Of_File 
(File: Zipped_File_Type) return Boolean;

Read (private)

overriding procedure Read 
(UnZip_Stream: in out UnZip_Stream_Type;
Item: out Ada.Streams.Stream_Element_Array;
Last: out Ada.Streams.Stream_Element_Offset);

Write (private)

overriding procedure Write 
(UnZip_Stream: in out UnZip_Stream_Type;
Item: Ada.Streams.Stream_Element_Array);