Index

Package: UnZip

Description

package UnZip is
NB: this is the MIT License, as found 12-Sep-2007 on the site http://www.opensource.org/licenses/mit-license.php

Types

option

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
  );

Option_set

type Option_set is array( option ) of Boolean;

Create_Path_proc

type Create_Path_proc is access
    procedure (New_Directory : in String;
               Form          : in String := "");
Ada 2005's Ada.Directories.Create_Path. For Ada 95 compatibility we pass it as an optional procedure access.

Set_Time_Stamp_proc

type Set_Time_Stamp_proc is access
    procedure (file_name: String; stamp: Ada.Calendar.Time);
This is system-dependent (or in a future Ada)

Set_ZTime_Stamp_proc

type Set_ZTime_Stamp_proc is access
    procedure (file_name: String; stamp: Zip.Time);
Alternatively, you can use Zip.Time to set file time stamps

Compose_func

type Compose_func is access function (File_Name : String) return String;
This is for modifying output file names (e.g. adding a work directory, modifying the archived path, etc.)

FS_routines_type

type FS_routines_type is record
    Create_Path            : Create_Path_proc;
    Set_Time_Stamp         : Set_Time_Stamp_proc;
    Directory_Separator    : Character;
    Compose_File_Name      : Compose_func;
    Set_ZTime_Stamp        : Set_ZTime_Stamp_proc; -- alt. to Set_Time_Stamp
  end record;
File System dependent settings

PKZip_method

subtype PKZip_method is Zip.PKZip_method;

Name_conflict_intervention

type Name_conflict_intervention is
    ( yes, no, yes_to_all, none, rename_it, abort_now );

Resolve_conflict_proc

type Resolve_conflict_proc is access
    procedure ( name            :  in String;
                action          : out Name_conflict_intervention;
                new_name        : out String;
                new_name_length : out Natural );

Get_password_proc

type Get_password_proc is access
    procedure(password: out Ada.Strings.Unbounded.Unbounded_String);

File_size_type

subtype File_size_type is Zip.File_size_type;
Data sizes in archive

Tell_data_proc

type Tell_data_proc is access
    procedure ( name               : String;
                compressed_bytes   : File_size_type;
                uncompressed_bytes : File_size_type;
                method             : PKZip_method );

Constants & Global variables

no_option (Option_set)

no_option: constant Option_set:= ( others=> False );

null_routines (FS_routines_type)

null_routines: constant FS_routines_type:= (null,null,'\',null,null);

current_user_attitude (Name_conflict_intervention)

current_user_attitude : Name_conflict_intervention:= yes;
reset to "yes" for a new session (in case of yes_to_all / none state!)

CRC_Error

CRC_Error,
  Uncompressed_size_Error,
  Write_Error,
  Read_Error,
  Wrong_password,
  User_abort,
  Not_supported,
  Unsupported_method,
  Wrong_or_no_password,
  Internal_Error : exception;

Uncompressed_size_Error

Uncompressed_size_Error,
  Write_Error,
  Read_Error,
  Wrong_password,
  User_abort,
  Not_supported,
  Unsupported_method,
  Wrong_or_no_password,
  Internal_Error : exception;

Write_Error

Write_Error,
  Read_Error,
  Wrong_password,
  User_abort,
  Not_supported,
  Unsupported_method,
  Wrong_or_no_password,
  Internal_Error : exception;

Read_Error

Read_Error,
  Wrong_password,
  User_abort,
  Not_supported,
  Unsupported_method,
  Wrong_or_no_password,
  Internal_Error : exception;

Wrong_password

Wrong_password,
  User_abort,
  Not_supported,
  Unsupported_method,
  Wrong_or_no_password,
  Internal_Error : exception;

User_abort

User_abort,
  Not_supported,
  Unsupported_method,
  Wrong_or_no_password,
  Internal_Error : exception;

Not_supported

Not_supported,
  Unsupported_method,
  Wrong_or_no_password,
  Internal_Error : exception;

Unsupported_method

Unsupported_method,
  Wrong_or_no_password,
  Internal_Error : exception;

Wrong_or_no_password

Wrong_or_no_password,
  Internal_Error : exception;

Internal_Error

Internal_Error : exception;

Subprograms & Entries

Extract

procedure Extract
( from: String;
options: Option_set:= no_option;
password: String:= "";
file_system_routines: FS_routines_type:= null_routines );
Extract one precise file (what) from an archive (from)

Extract

procedure Extract
( from: String;
what: String;
options: Option_set:= no_option;
password: String:= "";
file_system_routines: FS_routines_type:= null_routines );
Extract one precise file (what) from an archive (from), but save under a new name (rename)

Extract

procedure Extract
( from: String;
what: String;
rename: String;
options: Option_set:= no_option;
password: String:= "";
file_system_routines: FS_routines_type:= null_routines );
----------------------------------------------------------------------- Simple extraction procedures without re-searching central directory -- -----------------------------------------------------------------------

Extract

procedure Extract
( from: Zip.Zip_info;
options: Option_set:= no_option;
password: String:= "";
file_system_routines: FS_routines_type:= null_routines );
Extract one precise file (what) from an archive (from) Needs Zip.Load(from, ...) prior to the extraction

Extract

procedure Extract
( from: Zip.Zip_info;
what: String;
options: Option_set:= no_option;
password: String:= "";
file_system_routines: FS_routines_type:= null_routines );
Extract one precise file (what) from an archive (from), but save under a new name (rename) Needs Zip.Load(from, ...) prior to the extraction

Extract

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 );

Extract

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 );
Extract one precise file (what) from an archive (from)

Extract

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 );
Extract one precise file (what) from an archive (from), but save under a new name (rename)

Extract

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 );
Using Zip_info structure:

Extract

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 );
Extract one precise file (what) from an archive (from) Needs Zip.Load(from, ...) prior to the extraction

Extract

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 );
Extract one precise file (what) from an archive (from), but save under a new name (rename) Needs Zip.Load(from, ...) prior to the extraction

Extract

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 );
Errors