From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, T_FILL_THIS_FORM_SHORT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8e46abaa8f815e09,start X-Google-Attributes: gid103376,public From: Gautier Subject: Unzip.Streams definition Date: 2000/01/31 Message-ID: <3895A41F.1B36FB7D@maths.unine.ch>#1/1 X-Deja-AN: 579887601 Content-Transfer-Encoding: 7bit X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Trace: 31 Jan 2000 15:01:33 +0100, 130.125.13.32 MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-01-31T00:00:00+00:00 List-Id: Hello OO experts - there seems to be gurus of the tagged type. I have made a `streams' extension to Unzip, it works nice, but I'm not absolutely sure if there aren't nonsenses in the definitions (access or not, etc.). As a total beginner in stream programming, I have mimiced some examples. If you spot an absurdity or hidden trap, write me! Release for ~1 week. Spec. follows. TIA, G. ------------- with Unzip; with Ada.Streams; use Ada.Streams; package Unzip.Streams is pragma Elaborate_Body; type Stream_Access is access all Root_Stream_Type'Class; type Zipped_File_Type is private; procedure Open (File : in out Zipped_File_Type; Archive_Name : in String; Name : in String); procedure Close (File : in out Zipped_File_Type); function Is_Open (File : in Zipped_File_Type) return Boolean; function End_Of_File (File : in Zipped_File_Type) return Boolean; function Stream (File : Zipped_File_Type) return Stream_Access; private type UZS_state is ( ... ); type p_String is access String; type p_Stream_Element_Array is access Stream_Element_Array; type Unzip_Stream_Type is new Root_Stream_Type with record state : UZS_state; ... end record; procedure Read (Stream : in out Unzip_Stream_Type; Item : out Stream_Element_Array; Last : out Stream_Element_Offset); procedure Write (Stream : in out Unzip_Stream_Type; Item : in Stream_Element_Array); type Zipped_File_Type is access Unzip_Stream_Type; End_Error : exception; Use_Error : exception; end Unzip.Streams;