DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ T V

⟦1be7df075⟧ TextFile

    Length: 17152 (0x4300)
    Types: TextFile
    Names: »V«

Derivation

└─⟦d10a02448⟧ Bits:30000409 8mm tape, Rational 1000, ENVIRONMENT, D_12_7_3
    └─ ⟦fc9b38f02⟧ »DATA« 
        └─⟦9b46a407a⟧ 
            └─⟦12c68c704⟧ 
                └─⟦this⟧ 
└─⟦5f3412b64⟧ Bits:30000745 8mm tape, Rational 1000, ENVIRONMENT 12_6_5 TOOLS 
    └─ ⟦91c658230⟧ »DATA« 
        └─⟦458657fb6⟧ 
            └─⟦220843204⟧ 
                └─⟦this⟧ 

TextFile

with Action;
with Device_Independent_Io;
with Directory;
with Io_Exceptions;
with Text_Io;
package Io is

    pragma Subsystem (Input_Output, Private_Part => Closed);
    pragma Module_Name (4, 3506);

    type File_Type is private;

    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 Count          is Text_Io.Count;
    subtype Positive_Count is Count range 1 .. Count'Last;
    Unbounded : constant Count := Text_Io.Unbounded;

    subtype Field       is Integer range 0 .. Integer'Last;
    subtype Number_Base is Integer range 2 .. 16;

    subtype Type_Set is Text_Io.Type_Set;
    Upper_Case : constant Type_Set := Text_Io.Upper_Case;
    Lower_Case : constant Type_Set := Text_Io.Lower_Case;

    -- File Management

    procedure Create (File : in out File_Type;
                      Mode :        File_Mode := Out_File;
                      Name :        String    := "";
                      Form :        String    := "");

    procedure Open (File : in out File_Type;
                    Mode :        File_Mode := Out_File;
                    Name :        String;
                    Form :        String    := "");

    procedure Open (File   : in out File_Type;
                    Mode   :        File_Mode;
                    Object :        Directory.Version;
                    Form   :        String := "");
    -- Open a particular directory version; not Text_IO

    procedure Append
                 (File : in out File_Type; Name : String; Form : String := "");

    procedure Append (File   : in out File_Type;
                      Object :        Directory.Version;
                      Form   :        String := "");
    -- Open existing file for output, positioned at end of file; not Text_IO
    -- Output starting after an Append is on a new line, but on the same page
    -- as the previous end of the file

    procedure Flush (File : File_Type);
    -- Force any buffer characters out to file

    procedure Save (File : File_Type);
    -- Save the current contents of the file, but leave it open; calls Flush

    procedure Close  (File : in out File_Type);
    procedure Delete (File : in out File_Type);
    procedure Reset  (File : in out File_Type; Mode : File_Mode);
    procedure Reset  (File : in out File_Type);

    function Mode (File : File_Type) return File_Mode;
    function Name (File : File_Type) return String;
    function Form (File : File_Type) return String;

    function Is_Open (File : File_Type) return Boolean;


    -- Control of default input, output and error files;  error not Text_IO

    procedure Set_Input  (File : File_Type);
    procedure Set_Output (File : File_Type);
    procedure Set_Error  (File : File_Type);

    -- Equivalent of an Open/Create followed by above; not in Text_IO
    procedure Set_Input  (Name : String := "<SELECTION>");
    procedure Set_Output (Name : String := ">>FILE NAME<<");
    procedure Set_Error  (Name : String := ">>FILE NAME<<");

    function Standard_Input  return File_Type;
    function Standard_Output return File_Type;
    function Standard_Error  return File_Type;
    function Standard_Error  return Text_Io.File_Type;

    function Current_Input  return File_Type;
    function Current_Output return File_Type;
    function Current_Error  return File_Type;
    function Current_Error  return Text_Io.File_Type;

    -- For each default files, f, Set_f pushes that File_Type entry on a stack
    -- for the job.  Pop_f removes the top of the stack.  Reset is equivalent
    -- to a Close and a Pop.
    --
    -- All open files in the default file stack at job termination are closed.

    procedure Reset_Error;
    procedure Reset_Input;
    procedure Reset_Output;

    procedure Pop_Error;
    procedure Pop_Input;
    procedure Pop_Output;


    -- Specification of line and page lengths

    procedure Set_Line_Length (File : File_Type; To : Count);
    procedure Set_Line_Length (To : Count);

    procedure Set_Page_Length (File : File_Type; To : Count);
    procedure Set_Page_Length (To : Count);

    function Line_Length (File : File_Type) return Count;
    function Line_Length                    return Count;

    function Page_Length (File : File_Type) return Count;
    function Page_Length                    return Count;


    -- Column, Line and Page Control

    procedure New_Line (File : File_Type; Spacing : Positive_Count := 1);
    procedure New_Line (Spacing : Positive_Count := 1);

    procedure Skip_Line (File : File_Type; Spacing : Positive_Count := 1);
    procedure Skip_Line (Spacing : Positive_Count := 1);

    function End_Of_Line (File : File_Type) return Boolean;
    function End_Of_Line                    return Boolean;

    procedure New_Page (File : File_Type);
    procedure New_Page;

    procedure Skip_Page (File : File_Type);
    procedure Skip_Page;

    function End_Of_Page (File : File_Type) return Boolean;
    function End_Of_Page                    return Boolean;

    function End_Of_File (File : File_Type) return Boolean;
    function End_Of_File                    return Boolean;


    procedure Set_Col (File : File_Type; To : Positive_Count);
    procedure Set_Col (To : Positive_Count);

    procedure Set_Line (File : File_Type; To : Positive_Count);
    procedure Set_Line (To : Positive_Count);

    function Col (File : File_Type) return Positive_Count;
    function Col                    return Positive_Count;

    function Line (File : File_Type) return Positive_Count;
    function Line                    return Positive_Count;

    function Page (File : File_Type) return Positive_Count;
    function Page                    return Positive_Count;


    -- Character Input-Output

    procedure Get (File : File_Type; Item : out Character);
    procedure Get (Item : out Character);

    procedure Put  (File : File_Type; Item : Character);
    procedure Put  (Item : Character);
    procedure Echo (Item : Character);


    -- String Input-Output

    procedure Get (File : File_Type; Item : out String);
    procedure Get (Item : out String);

    procedure Put  (File : File_Type; Item : String);
    procedure Put  (Item : String);
    procedure Echo (Item : String := "");

    procedure Get_Line
                 (File : File_Type; Item : out String; Last : out Natural);
    procedure Get_Line (Item : out String; Last : out Natural);

    procedure Put_Line  (File : File_Type; Item : String);
    procedure Put_Line  (Item : String);
    procedure Echo_Line (Item : String := "");

    -- String Input-Output not in Text_IO

    function Get_Line (File : File_Type) return String;
    function Get_Line                    return String;

    procedure Get (File        :     File_Type;
                   Item        : out String;
                   Last        : out Natural;
                   End_Of_Line : out Boolean;
                   End_Of_Page : out Boolean;
                   End_Of_File : out Boolean);
    -- Get all or part of a line.
    -- End_Of_Line iff Item contains the end of line (possibly null)
    -- End_Of_Page iff End_Of_Line and this is the last line of the page
    -- End_Of_File iff End_Of_Page and this is the last page of the file
    --
    -- The intent if for each call to return as many characters from the
    -- line as fit, but Last /= Item'Last doesn't implies End_Of_Line.


    -- equivalents for instantiations of the type-specific generics

    -- Integer Input-Output; equivalent to an instantiation of Integer_IO

    procedure Get (File : File_Type; Item : out Integer; Width : Field := 0);

    procedure Get (Item : out Integer; Width : Field := 0);

    procedure Put (File  : File_Type;
                   Item  : Integer;
                   Width : Field       := 0;
                   Base  : Number_Base := 10);

    procedure Put (Item  : Integer;
                   Width : Field       := 0;
                   Base  : Number_Base := 10);

    procedure Echo (Item  : Integer;
                    Width : Field       := 0;
                    Base  : Number_Base := 10);


    -- Float Input-Output; equivalent to an instantiation of Float_IO

    procedure Get (File : File_Type; Item : out Float; Width : Field := 0);
    procedure Get (Item : out Float; Width : Field := 0);

    procedure Put (File : File_Type;
                   Item : Float;
                   Fore : Field := 2;
                   Aft  : Field := 14;
                   Exp  : Field := 3);

    procedure Put (Item : Float;
                   Fore : Field := 2;
                   Aft  : Field := 14;
                   Exp  : Field := 3);

    procedure Echo (Item : Float;
                    Fore : Field := 2;
                    Aft  : Field := 14;
                    Exp  : Field := 3);

    -- Boolean Input-Output; equivalent to an instantiation of Enumeration_IO

    procedure Get (File : File_Type; Item : out Boolean);
    procedure Get (Item : out Boolean);

    procedure Put (File : File_Type; Item : Boolean; Width : Field := 0);

    procedure Put (Item : Boolean; Width : Field := 0);

    procedure Echo (Item : Boolean; Width : Field := 0);

    -- Generic package for Input-Output of Integer Types

    generic
        type Num is range <>;
    package Integer_Io is

        Default_Width : Field       := Num'Width;
        Default_Base  : Number_Base := 10;

        procedure Get (File : File_Type; Item : out Num; Width : Field := 0);

        procedure Get (Item : out Num; Width : Field := 0);

        procedure Put (File  : File_Type;
                       Item  : Num;
                       Width : Field       := Default_Width;
                       Base  : Number_Base := Default_Base);

        procedure Put (Item  : Num;
                       Width : Field       := Default_Width;
                       Base  : Number_Base := Default_Base);

        procedure Get (From : String; Item : out Num; Last : out Positive);

        procedure Put (To   : out String;
                       Item :     Num;
                       Base :     Number_Base := Default_Base);
    end Integer_Io;


    -- Generic package for Input-Output of Floating Point Types

    generic
        type Num is digits <>;
    package Float_Io is

        Default_Fore : Field := 2;
        Default_Aft  : Field := Num'Digits - 1;
        Default_Exp  : Field := 3;


        procedure Get (File : File_Type; Item : out Num; Width : Field := 0);
        procedure Get (Item : out Num; Width : Field := 0);

        procedure Put (File : File_Type;
                       Item : Num;
                       Fore : Field := Default_Fore;
                       Aft  : Field := Default_Aft;
                       Exp  : Field := Default_Exp);

        procedure Put (Item : Num;
                       Fore : Field := Default_Fore;
                       Aft  : Field := Default_Aft;
                       Exp  : Field := Default_Exp);

        procedure Get (From : String; Item : out Num; Last : out Positive);

        procedure Put (To   : out String;
                       Item :     Num;
                       Aft  :     Field := Default_Aft;
                       Exp  :     Field := Default_Exp);
    end Float_Io;


    -- Generic package for Input-Output of Fixed Point Types

    generic
        type Num is delta <>;
    package Fixed_Io is

        Default_Fore : Field := Num'Fore;
        Default_Aft  : Field := Num'Aft;
        Default_Exp  : Field := 0;

        procedure Get (File : File_Type; Item : out Num; Width : Field := 0);

        procedure Get (Item : out Num; Width : Field := 0);

        procedure Put (File : File_Type;
                       Item : Num;
                       Fore : Field := Default_Fore;
                       Aft  : Field := Default_Aft;
                       Exp  : Field := Default_Exp);

        procedure Put (Item : Num;
                       Fore : Field := Default_Fore;
                       Aft  : Field := Default_Aft;
                       Exp  : Field := Default_Exp);

        procedure Get (From : String; Item : out Num; Last : out Positive);

        procedure Put (To   : out String;
                       Item :     Num;
                       Aft  :     Field := Default_Aft;
                       Exp  :     Field := Default_Exp);
    end Fixed_Io;


    -- Generic package for Input-Output of Enumeration Types

    generic
        type Enum is (<>);
    package Enumeration_Io is

        Default_Width   : Field    := 0;
        Default_Setting : Type_Set := Upper_Case;

        procedure Get (File : File_Type; Item : out Enum);
        procedure Get (Item : out Enum);

        procedure Put (File  : File_Type;
                       Item  : Enum;
                       Width : Field    := Default_Width;
                       Set   : Type_Set := Default_Setting);

        procedure Put (Item  : Enum;
                       Width : Field    := Default_Width;
                       Set   : Type_Set := Default_Setting);

        procedure Get (From : String; Item : out Enum; Last : out Positive);

        procedure Put (To   : out String;
                       Item :     Enum;
                       Set  :     Type_Set := Default_Setting);
    end Enumeration_Io;


    -- Interchange with other system file_types
    --
    -- Compatibility with Device_Independendent_IO is solely for the purpose
    -- of allowing access to device-specific options at open.
    --
    -- Interchange of Get/Put and Read/Write operations between IO and
    -- Device_Independent_IO is undefined due to internal buffering in IO,
    -- though Flush can be used on output to clear the buffer.
    --
    -- Free interchange of operations with Text_IO is supported.

    function Convert (File : File_Type)         return Text_Io.File_Type;
    function Convert (File : Text_Io.File_Type) return File_Type;

    function Convert (File : File_Type) return Device_Independent_Io.File_Type;
    function Convert (File : Device_Independent_Io.File_Type) return File_Type;

    function "=" (L, R : File_Mode) return Boolean renames Text_Io."=";
    function "=" (L, R : Type_Set)  return Boolean renames Text_Io."=";
    function "<" (L, R : Count)     return Boolean renames Text_Io."<";
    function "=" (L, R : Count)     return Boolean renames Text_Io."=";
    function ">" (L, R : Count)     return Boolean renames Text_Io.">";

    -- Operate on multiple input files matching a wildcard

    generic
        with procedure Process    (File : in out File_Type) is <>;
        with procedure Note_Error (Message : String)        is Io.Put_Line;
    procedure Wildcard_Iterator (Names : String);
    -- Calls Process once with an open File corresponding to each of Names
    -- Name errors and unhandled expections are reported through Note_Error.
    -- Closes File after each call to Process, if not already closed.

    procedure Convert (From :        Device_Independent_Io.File_Type;
                       To   : in out Text_Io.File_Type);
    -- Conversion form that allows changing limited private file_type

    -- File management logical overloads.  Each procedure duplicates one
    -- above, but with direct control over the Action.ID used.
    procedure Create (File      : in out File_Type;
                      Mode      :        File_Mode := Out_File;
                      Name      :        String    := "";
                      Form      :        String    := "";
                      Action_Id :        Action.Id);

    procedure Open (File      : in out File_Type;
                    Mode      :        File_Mode := Out_File;
                    Name      :        String;
                    Form      :        String    := "";
                    Action_Id :        Action.Id);

    procedure Open (File      : in out File_Type;
                    Mode      :        File_Mode;
                    Object    :        Directory.Version;
                    Form      :        String := "";
                    Action_Id :        Action.Id);

    procedure Append (File      : in out File_Type;
                      Name      :        String;
                      Form      :        String := "";
                      Action_Id :        Action.Id);

    procedure Append (File      : in out File_Type;
                      Object    :        Directory.Version;
                      Form      :        String := "";
                      Action_Id :        Action.Id);

    function Get_Action (File : File_Type) return Action.Id;

    -- Exceptions

    Status_Error : exception renames Io_Exceptions.Status_Error;
    Mode_Error   : exception renames Io_Exceptions.Mode_Error;
    Name_Error   : exception renames Io_Exceptions.Name_Error;
    Use_Error    : exception renames Io_Exceptions.Use_Error;
    Device_Error : exception renames Io_Exceptions.Device_Error;
    End_Error    : exception renames Io_Exceptions.End_Error;
    Data_Error   : exception renames Io_Exceptions.Data_Error;
    Layout_Error : exception renames Io_Exceptions.Layout_Error;

end Io;