package UnZip.Streams is
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;
subtype Stream_Access is Ada.Streams.Stream_IO.Stream_Access;
type Zipped_File_Type is 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 );
type p_String is access String;
Use_Error : exception renames Ada.IO_Exceptions.Use_Error;
End_Error : exception renames Ada.IO_Exceptions.End_Error;
procedure Open
| ( | File | : in out Zipped_File_Type; |
| -- File-in-archive handle Archive_Name | : in String; | |
| -- Name of archive file Name | : in String; | |
| -- Name of zipped entry Password | : in String := ""; | |
| -- Decryption password Case_sensitive | : in Boolean:= False ); |
procedure Open
| ( | File | : in out Zipped_File_Type; |
| -- File-in-archive handle Archive_Stream | : in Zip_Streams.Zipstream_Class; | |
| -- Archive's stream Name | : in String; | |
| -- Name of zipped entry Password | : in String := ""; | |
| -- Decryption password Case_sensitive | : in Boolean:= False ); |
procedure Open
| ( | File | : in out Zipped_File_Type; |
| -- File-in-archive handle Archive_Info | : in Zip.Zip_info; | |
| -- Archive's Zip_info Name | : in String; | |
| -- Name of zipped entry Password | : in String := ""; | |
| -- Decryption password Case_sensitive | : in Boolean:= False ); |
procedure Close
| ( | File | : in out Zipped_File_Type); |
procedure Read
| ( | Stream | : in out Unzip_Stream_Type; |
| Item | : out Ada.Streams.Stream_Element_Array; | |
| Last | : out Ada.Streams.Stream_Element_Offset); |
procedure Write
| ( | Stream | : in out Unzip_Stream_Type; |
| Item | : in Ada.Streams.Stream_Element_Array); |