---------------------------------------------------------------------- -- Title : FileAK -- Author : David Wallace Croft, CompuServe [76600,102] -- Compiler : Ada ---------------------------------------------------------------------- with IO_Exceptions; with Text_IO; use Text_IO; package FileAK is ---------------------------------------------------------------------- ---------------------------------------------------------------------- Copyright : constant string := "FileAK v1.10 (C) 1994 David Wallace Croft. All rights reserved."; ---------------------------------------------------------------------- procedure Demo; -- ---------------------------------------------------------------------- -- -- I/O exceptions renamed from IO_Exceptions. -- ---------------------------------------------------------------------- -- Data_Error : exception renames IO_Exceptions.Data_Error; -- Device_Error : exception renames IO_Exceptions.Device_Error; -- End_Error : exception renames IO_Exceptions.End_Error; -- Layout_Error : exception renames IO_Exceptions.Layout_Error; -- Mode_Error : exception renames IO_Exceptions.Mode_Error; -- Name_Error : exception renames IO_Exceptions.Name_Error; -- Status_Error : exception renames IO_Exceptions.Status_Error; -- Use_Error : exception renames IO_Exceptions.Use_Error; -- ---------------------------------------------------------------------- -- -- File I/O declarations transfered from Text_IO. -- ---------------------------------------------------------------------- -- subtype File_Mode is Text_IO.File_Mode; -- In_File : constant File_Mode := Text_IO.In_File; -- Out_File : constant File_Mode := Text_IO.Out_File; -- subtype File_Type is Text_IO.File_Type; -- ---------------------------------------------------------------------- -- -- File I/O sub-programs renamed from Text_IO. -- ---------------------------------------------------------------------- -- procedure Create ( -- File : in out File_Type; -- Mode : in File_Mode := Out_File; -- Name : in string := ""; -- Form : in string := "" ) -- renames Text_IO.Create; -- procedure Close ( -- File : in out File_Type ) -- renames Text_IO.Close; -- procedure Delete ( -- File : in out File_Type ) -- renames Text_IO.Delete; -- procedure Get ( -- File : in File_Type; -- Item : out character ) -- renames Text_IO.Get; -- procedure Get_Line ( -- File : in File_Type; -- Item : out string; -- Last : out natural ) -- renames Text_IO.Get_Line; -- function End_Of_File ( -- File : in File_Type ) -- return boolean -- renames Text_IO.End_Of_File; -- procedure Open ( -- File : in out File_Type; -- Mode : in File_Mode; -- Name : in string; -- Form : in string := "" ) -- renames Text_IO.Open; -- procedure Put ( -- File : in File_Type; -- Item : in character ) -- renames Text_IO.Put; -- procedure Put ( -- File : in File_Type; -- Item : in string ) -- renames Text_IO.Put; -- procedure Put_Line ( -- File : in File_Type; -- Item : in string := "" ) -- renames Text_IO.Put_Line; ---------------------------------------------------------------------- -- File I/O unique ---------------------------------------------------------------------- subtype Line_Type is string ( 1..255 ); procedure Copy ( From : in string; To : in string ); procedure Delete ( File_Name : in string ); procedure Read ( Path_File_Name : in string ); function Scan ( File_Name : string; For_String : string; Case_Sensitive : boolean := true ) return long_integer; ---------------------------------------------------------------------- -- Scans File_Name for a string and reports starting byte position. -- Returns 0 if not found. -- Returns negative number if an error occurs. -- Currently only handles text files of type character. ---------------------------------------------------------------------- ---------------------------------------------------------------------- ---------------------------------------------------------------------- end FileAK;