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

⟦aa2b3e3b1⟧ TextFile

    Length: 2293 (0x8f5)
    Types: TextFile
    Names: »B«

Derivation

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

TextFile

package body Fichier_Io is
    procedure Open (Fichier_Source : in out Text_Io.File_Type;
                    Name : in String := "Chtiny_Talk") is
    begin
        Text_Io.Open (Fichier_Source, Text_Io.In_File, Name);
        Look_Ahead := False;
    end Open;

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

    function At_Line (Fichier_Source : in Text_Io.File_Type) return Boolean is
    begin
        if (Look_Ahead) then
            return False;
        else
            return Text_Io.End_Of_Line (Fichier_Source);
        end if;
    end At_Line;

    procedure Next (Fichier_Source : in Text_Io.File_Type) is
        use Object;
    begin
        if (Look_Ahead) then
            Look_Ahead := False;
            if Current_Char = Ascii.Cr then
                Current_Line_Number := Current_Line_Number + 1;
            end if;
        elsif At_Line (Fichier_Source) then
            Current_Char := Ascii.Cr;
            Current_Line_Number := Current_Line_Number + 1;
            Text_Io.Skip_Line (Fichier_Source);
        else
            Text_Io.Get (Fichier_Source, Current_Char);
        end if;
    end Next;

    function Get (Fichier_Source : in Text_Io.File_Type) return Character is
    begin  
        Next (Fichier_Source);
        return Value (Fichier_Source);
    end Get;

    procedure Unget (Fichier_Source : in Text_Io.File_Type) is
        use Object;
    begin
        Look_Ahead := True;
        if Current_Char = Ascii.Cr then
            Current_Line_Number := Current_Line_Number - 1;
        end if;
    end Unget;

    function Value (Fichier_Source : in Text_Io.File_Type) return Character is
    begin
        return Current_Char;
    end Value;

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

    function Get_Line_Number return Object.Index is
    begin
        return Current_Line_Number;
    end Get_Line_Number;

    procedure Put_Line_Number (Value : Object.Index) is
    begin
        Current_Line_Number := Value;
    end Put_Line_Number;

end Fichier_Io;