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: ┃ B T

⟦bbd7a7641⟧ TextFile

    Length: 2861 (0xb2d)
    Types: TextFile
    Names: »B«

Derivation

└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 

TextFile

package body Tiny_File is

    Current_Char : Character;
    Look_Ahead : Boolean := False;

    procedure Open (The_File : in out Text_Io.File_Type;
                    With_Name : String;
                    Input_Mode : Boolean := True) is
    begin
        if Input_Mode then
            Text_Io.Open (The_File, Text_Io.In_File, With_Name);
        else
            Text_Io.Open (The_File, Text_Io.Out_File, With_Name);
        end if;
        Look_Ahead := False;
    end Open;

    procedure Create (The_File : in out Text_Io.File_Type;
                      With_Name : String;
                      Output_Mode : Boolean := True) is
    begin
        if Output_Mode then
            Text_Io.Create (The_File, Text_Io.Out_File, With_Name);
        else
            Text_Io.Create (The_File, Text_Io.In_File, With_Name);
        end if;
    end Create;

    function Get (The_File : Text_Io.File_Type) return Character is
    begin
        if Look_Ahead then
            Look_Ahead := False;
        else
            if At_End (The_File) then
                Current_Char := Ascii.Eot;
            else
                if Text_Io.End_Of_Line (The_File) then
                    Text_Io.Skip_Line (The_File);
                    Current_Char := Ascii.Cr;
                else
                    Text_Io.Get (The_File, Current_Char);
                end if;
            end if;
        end if;
        return Current_Char;
    end Get;

    procedure Unget (The_File : Text_Io.File_Type) is
    begin
        Look_Ahead := True;
    end Unget;

    procedure Put (The_File : Text_Io.File_Type; The_Char : Character) is
    begin
        Text_Io.Put (The_File, The_Char);
    end Put;

    procedure Put (The_File : Text_Io.File_Type; The_String : String) is
    begin
        Text_Io.Put (The_File, The_String);
    end Put;

    procedure Put_Line (The_File : Text_Io.File_Type; The_String : String) is
    begin
        Text_Io.Put_Line (The_File, The_String);
    end Put_Line;

    procedure Set_Col (The_File : Text_Io.File_Type; To : Natural) is
    begin
        Text_Io.Set_Col (The_File, Text_Io.Positive_Count (To));
    end Set_Col;

    procedure Set_Line (The_File : Text_Io.File_Type; To : Natural) is
    begin
        Text_Io.Set_Line (The_File, Text_Io.Positive_Count (To));
    end Set_Line;

    procedure New_Line (The_File : Text_Io.File_Type; Spacing : Natural := 1) is
    begin
        Text_Io.New_Line (The_File, Text_Io.Positive_Count (Spacing));
    end New_Line;

    function At_End (The_File : Text_Io.File_Type) return Boolean is
    begin
        if Look_Ahead then
            return False;
        else
            return Text_Io.End_Of_File (The_File);
        end if;
    end At_End;

    procedure Close (The_File : in out Text_Io.File_Type) is
    begin
        Text_Io.Close (The_File);
    end Close;

end Tiny_File;