|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: B T
Length: 3052 (0xbec)
Types: TextFile
Names: »B«
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
└─⟦129cab021⟧ »DATA«
└─⟦this⟧
with Text_Io;
package body File is
F : Text_Io.File_Type;
Current_Char : Character;
Unget_Request : Boolean;
-- creation du fichier
-- ===================
procedure Create (File_Name : String) is
begin
Text_Io.Create (File => F, Name => File_Name);
Unget_Request := False;
end Create;
-- ouverture du fichier
-- ====================
procedure Open (File_Name : String) is
begin
Text_Io.Open (F, Text_Io.In_File, File_Name);
Unget_Request := False;
end Open;
-- fermeture du fichier
-- ====================
procedure Close is
begin
Text_Io.Close (F);
end Close;
-- renvoi VRAI si fin de fichier atteinte
-- ======================================
function Is_At_End_File return Boolean is
begin
if Unget_Request then
return False;
elsif Text_Io.End_Of_File (F) then
return True;
else
return False;
end if;
end Is_At_End_File;
-- renvoi VRAI si fin de ligne du fichier atteinte
-- ===============================================
function Is_At_End_Line return Boolean is
begin
if Unget_Request then
return False;
elsif Text_Io.End_Of_Line (F) then
return True;
else
return False;
end if;
end Is_At_End_Line;
-- avance dans le fichier avec lecture du caractere
-- ================================================
procedure Next is
begin
if Unget_Request then
Unget_Request := False;
else
Text_Io.Get (F, Current_Char);
end if;
end Next;
-- retourne le caractere courant du fichier
-- ========================================
function Value return Character is
begin
return Current_Char;
end Value;
-- avance d'un caractere dans le fichier et retourne le caractere courant
-- ======================================================================
function Get return Character is
begin
Next;
return Value;
end Get;
-- recule d'un caractere dans le fichier
-- =====================================
procedure Unget is
begin
Unget_Request := True;
end Unget;
-- avance d'une position dans le fichier et retourne le caractere CR
-- =================================================================
function Get_Cr return Character is
begin
Text_Io.Skip_Line (F);
Current_Char := Ascii.Cr;
return Current_Char;
end Get_Cr;
-- ecriture d'une chaine de caracteres dans le fichier
-- ===================================================
procedure Write (Item : String) is
begin
Text_Io.Put (F, Item);
end Write;
-- passage a la ligne suivante dans le fichier
-- ===========================================
procedure New_Line is
begin
Text_Io.New_Line (F);
end New_Line;
end File;