comp.lang.ada
 help / color / mirror / Atom feed
From: Gautier <gautier.demontmollin@maths.unine.ch>
Subject: Unzip.Streams definition
Date: 2000/01/31
Date: 2000-01-31T00:00:00+00:00	[thread overview]
Message-ID: <3895A41F.1B36FB7D@maths.unine.ch> (raw)

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;




                 reply	other threads:[~2000-01-31  0:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox