package Zip is
type Zip_info is private;
subtype File_size_type is Interfaces.Unsigned_32;
type PKZip_method is (store, -- C, D shrink, -- C, D reduce_1, -- C, D reduce_2, -- C, D reduce_3, -- C, D reduce_4, -- C, D implode, -- D tokenize, deflate, -- D deflate_e, -- D - Enhanced deflate bzip2, -- D lzma, ppmd, unknown );
subtype Time is Zip_Streams.Time;
type Feedback_proc is access procedure (percents_done : Natural; -- %'s completed entry_skipped : Boolean; -- indicates one can show "skipped", no %'s user_abort : out Boolean);
subtype Byte is Interfaces.Unsigned_8;
type Byte_Buffer is array (Integer range <>) of aliased Byte;
type Dir_node;
type p_Dir_node is access Dir_node;
type p_String is access String;
Form_For_IO_Open_N_Create : Ada.Strings.Unbounded.Unbounded_String
:= Ada.Strings.Unbounded.Null_Unbounded_String;
Forgot_to_load_zip_info : exception;
File_name_not_found : exception;
reference : constant String := "14 - Jul - 2012";
web : constant String := "http://unzip - ada.sf.net/";
procedure Load
( | info | : out Zip_info; |
from | : String; | |
-- Zip file name case_sensitive | : Boolean := False); |
procedure Load
( | info | : out Zip_info; |
from | : Zip_Streams.Zipstream_Class; | |
case_sensitive | : Boolean := False); |
function Is_loaded
( | info | : Zip_info) return Boolean; |
function Zip_name
( | info | : Zip_info) return String; |
function Zip_comment
( | info | : Zip_info) return String; |
function Zip_Stream
( | info | : Zip_info) return Zip_Streams.Zipstream_Class; |
function Entries
( | info | : Zip_info) return Natural; |
procedure Delete
( | info | : in out Zip_info); |
function Method_from_code
( | x | : Interfaces.Unsigned_16) return PKZip_method; |
function Method_from_code
( | x | : Natural) return PKZip_method; |
function Convert
( | date | : Ada.Calendar.Time) return Time renames Zip_Streams.Calendar.Convert; |
function Convert
( | date | : Time) return Ada.Calendar.Time renames Zip_Streams.Calendar.Convert; |
generic with procedure Action
( | name | : String); |
-- 'name' is compressed entry's name procedure Traverse (z | : Zip_info); |
generic with procedure Action
( | name | : String; |
-- 'name' is compressed entry's name file_index | : Positive; | |
comp_size | : File_size_type; | |
uncomp_size | : File_size_type; | |
crc_32 | : Interfaces.Unsigned_32; | |
date_time | : Time; | |
method | : PKZip_method; | |
unicode_file_name | : Boolean ); | |
procedure Traverse_verbose (z | : Zip_info); |
procedure Tree_stat
( | z | : Zip_info; |
total | : out Natural; | |
max_depth | : out Natural; | |
avg_depth | : out Float); |
procedure Find_first_offset
( | file | : Zip_Streams.Zipstream_Class; |
file_index | : out Positive); |
procedure Find_offset
( | file | : Zip_Streams.Zipstream_Class; |
name | : String; | |
case_sensitive | : Boolean; | |
file_index | : out Positive; | |
comp_size | : out File_size_type; | |
uncomp_size | : out File_size_type); |
procedure Find_offset
( | info | : Zip_info; |
name | : String; | |
case_sensitive | : Boolean; | |
file_index | : out Ada.Streams.Stream_IO.Positive_Count; | |
comp_size | : out File_size_type; | |
uncomp_size | : out File_size_type); |
procedure Get_sizes
( | info | : Zip_info; |
name | : String; | |
case_sensitive | : Boolean; | |
comp_size | : out File_size_type; | |
uncomp_size | : out File_size_type); |
procedure BlockRead
( | file | : Ada.Streams.Stream_IO.File_Type; |
buffer | : out Byte_Buffer; | |
actually_read | : out Natural); |
procedure BlockRead
( | stream | : Zip_Streams.Zipstream_Class; |
buffer | : out Byte_Buffer; | |
actually_read | : out Natural); |
procedure BlockRead
( | stream | : Zip_Streams.Zipstream_Class; |
buffer | : out Byte_Buffer); |
procedure BlockWrite
( | stream | : in out Ada.Streams.Root_Stream_Type'Class; |
buffer | : Byte_Buffer); |
procedure Write_as_text
( | out_file | : Ada.Text_IO.File_Type; |
buffer | : Byte_Buffer; | |
last_char | : in out Character -- track line - ending characters between writes ); |