with Text_Io, String_Access_Class; package body Transaction_Template is Input_Buffer_Size : constant Positive := Length + 1; Text_File : Text_Io.File_Type; Input_Buffer : String_Access_Class.String_Access; Transaction_Length : Positive; procedure Destructor is begin String_Access_Class.Free (Input_Buffer); end Destructor; procedure Open (Transaction_File : in String; Form : in String := "") is begin Text_Io.Open (Text_File, Mode => Text_Io.In_File, Name => Transaction_File, Form => Form); end Open; procedure Close is begin Destructor; Text_Io.Close (Text_File); end Close; function Is_Next_Transaction return Transaction is use Text_Io; begin Get_Line (Text_File, Input_Buffer.all, Transaction_Length); if Transaction_Length = Input_Buffer_Size then Skip_Line (Text_File); raise Size_Error; else if Transaction_Length = Length then return Convert_To_Transaction (Input_Buffer (1 .. Length)); else for This_Pad_Index in Transaction_Length + 1 .. Length loop Input_Buffer (This_Pad_Index) := Pad_Character; end loop; raise Size_Error; end if; end if; end Is_Next_Transaction; function Is_Raw_Transaction return Text is begin return Input_Buffer (1 .. Length); end Is_Raw_Transaction; function Is_At_End_Of_File return Boolean is begin return Text_Io.End_Of_File (Text_File); end Is_At_End_Of_File; begin Input_Buffer := new String (1 .. Input_Buffer_Size); end Transaction_Template; -- Note: -- ~~~~ -- 1. Explain why Input_Buffer is greater by one.