package UnZip is
type option is ( test_only, -- test .zip file integrity, no write junk_directories, -- ignore directory info - > extract to current one case_sensitive_match, -- case sensitive name matching extract_as_text -- files will be written with native line endings );
type Option_set is array (option) of Boolean;
type Create_Path_proc is access procedure (New_Directory : String; Form : String := "");
type Set_Time_Stamp_proc is access procedure (file_name : String; stamp : Ada.Calendar.Time);
type Set_ZTime_Stamp_proc is access procedure (file_name : String; stamp : Zip.Time);
type Compose_func is access function (File_Name : String) return String;
type FS_routines_type is record Create_Path : Create_Path_proc; Set_Time_Stamp : Set_Time_Stamp_proc; Compose_File_Name : Compose_func; Set_ZTime_Stamp : Set_ZTime_Stamp_proc; -- alt. to Set_Time_Stamp end record;
subtype PKZip_method is Zip.PKZip_method;
type Name_conflict_intervention is (yes, no, yes_to_all, none, rename_it, abort_now);
type Resolve_conflict_proc is access procedure (name : String; action : out Name_conflict_intervention; new_name : out String; new_name_length : out Natural);
type Get_password_proc is access procedure (password : out Ada.Strings.Unbounded.Unbounded_String);
subtype File_size_type is Zip.File_size_type;
type Tell_data_proc is access procedure (name : String; compressed_bytes : File_size_type; uncompressed_bytes : File_size_type; method : PKZip_method);
type Write_mode is (write_to_binary_file, write_to_text_file, write_to_memory, just_test );
subtype Write_to_file is Write_mode range write_to_binary_file .. write_to_text_file;
type p_Stream_Element_Array is access all Ada.Streams.Stream_Element_Array;
no_option : constant Option_set := (others => False);
null_routines : constant FS_routines_type := (null, null, null, null);
current_user_attitude : Name_conflict_intervention := yes;
Uncompressed_size_Error, Write_Error, Read_Error, Wrong_password, User_abort, Not_supported, Unsupported_method, Wrong_or_no_password, Internal_Error : exception;
Write_Error, Read_Error, Wrong_password, User_abort, Not_supported, Unsupported_method, Wrong_or_no_password, Internal_Error : exception;
Read_Error, Wrong_password, User_abort, Not_supported, Unsupported_method, Wrong_or_no_password, Internal_Error : exception;
Wrong_password, User_abort, Not_supported, Unsupported_method, Wrong_or_no_password, Internal_Error : exception;
procedure Extract
( | from | : String; |
options | : Option_set := no_option; | |
password | : String := ""; | |
file_system_routines | : FS_routines_type := null_routines ); |
procedure Extract
( | from | : String; |
what | : String; | |
options | : Option_set := no_option; | |
password | : String := ""; | |
file_system_routines | : FS_routines_type := null_routines ); |
procedure Extract
( | from | : String; |
what | : String; | |
rename | : String; | |
options | : Option_set := no_option; | |
password | : String := ""; | |
file_system_routines | : FS_routines_type := null_routines ); |
procedure Extract
( | from | : Zip.Zip_info; |
options | : Option_set := no_option; | |
password | : String := ""; | |
file_system_routines | : FS_routines_type := null_routines ); |
procedure Extract
( | from | : Zip.Zip_info; |
what | : String; | |
options | : Option_set := no_option; | |
password | : String := ""; | |
file_system_routines | : FS_routines_type := null_routines ); |
procedure Extract
( | from | : Zip.Zip_info; |
what | : String; | |
rename | : String; | |
options | : Option_set := no_option; | |
password | : String := ""; | |
file_system_routines | : FS_routines_type := null_routines ); |
procedure Extract
( | from | : String; |
feedback | : Zip.Feedback_proc; | |
help_the_file_exists | : Resolve_conflict_proc; | |
tell_data | : Tell_data_proc; | |
get_pwd | : Get_password_proc; | |
options | : Option_set := no_option; | |
password | : String := ""; | |
file_system_routines | : FS_routines_type := null_routines ); |
procedure Extract
( | from | : String; |
what | : String; | |
feedback | : Zip.Feedback_proc; | |
help_the_file_exists | : Resolve_conflict_proc; | |
tell_data | : Tell_data_proc; | |
get_pwd | : Get_password_proc; | |
options | : Option_set := no_option; | |
password | : String := ""; | |
file_system_routines | : FS_routines_type := null_routines ); |
procedure Extract
( | from | : String; |
what | : String; | |
rename | : String; | |
feedback | : Zip.Feedback_proc; | |
tell_data | : Tell_data_proc; | |
get_pwd | : Get_password_proc; | |
options | : Option_set := no_option; | |
password | : String := ""; | |
file_system_routines | : FS_routines_type := null_routines ); |
procedure Extract
( | from | : Zip.Zip_info; |
feedback | : Zip.Feedback_proc; | |
help_the_file_exists | : Resolve_conflict_proc; | |
tell_data | : Tell_data_proc; | |
get_pwd | : Get_password_proc; | |
options | : Option_set := no_option; | |
password | : String := ""; | |
file_system_routines | : FS_routines_type := null_routines ); |
procedure Extract
( | from | : Zip.Zip_info; |
what | : String; | |
feedback | : Zip.Feedback_proc; | |
help_the_file_exists | : Resolve_conflict_proc; | |
tell_data | : Tell_data_proc; | |
get_pwd | : Get_password_proc; | |
options | : Option_set := no_option; | |
password | : String := ""; | |
file_system_routines | : FS_routines_type := null_routines ); |
procedure Extract
( | from | : Zip.Zip_info; |
what | : String; | |
rename | : String; | |
feedback | : Zip.Feedback_proc; | |
tell_data | : Tell_data_proc; | |
get_pwd | : Get_password_proc; | |
options | : Option_set := no_option; | |
password | : String := ""; | |
file_system_routines | : FS_routines_type := null_routines ); |