A.10.12 Input-Output for Unbounded Strings
The package Text_IO.Unbounded_IO provides input-output
in human-readable form for Unbounded_Strings.
Static Semantics
The library package
Text_IO.Unbounded_IO has the following declaration:
with Ada.Strings.Unbounded;
package Ada.Text_IO.Unbounded_IO
with Global =>
in out synchronized is
procedure Put
(File :
in File_Type;
Item :
in Strings.Unbounded.Unbounded_String);
procedure Put
(Item :
in Strings.Unbounded.Unbounded_String);
procedure Put_Line
(File :
in File_Type;
Item :
in Strings.Unbounded.Unbounded_String);
procedure Put_Line
(Item :
in Strings.Unbounded.Unbounded_String);
function Get_Line
(File :
in File_Type)
return Strings.Unbounded.Unbounded_String;
function Get_Line
return Strings.Unbounded.Unbounded_String;
procedure Get_Line
(File :
in File_Type; Item :
out Strings.Unbounded.Unbounded_String);
procedure Get_Line
(Item :
out Strings.Unbounded.Unbounded_String);
end Ada.Text_IO.Unbounded_IO;
For an item of type
Unbounded_String, the following subprograms are provided:
procedure Put
(File : in File_Type;
Item : in Strings.Unbounded.Unbounded_String);
Equivalent to Text_IO.Put (File, Strings.Unbounded.To_String(Item));
procedure Put
(Item : in Strings.Unbounded.Unbounded_String);
Equivalent to Text_IO.Put (Strings.Unbounded.To_String(Item));
procedure Put_Line
(File : in File_Type;
Item : in Strings.Unbounded.Unbounded_String);
Equivalent to Text_IO.Put_Line (File, Strings.Unbounded.To_String(Item));
procedure Put_Line
(Item : in Strings.Unbounded.Unbounded_String);
Equivalent to Text_IO.Put_Line (Strings.Unbounded.To_String(Item));
function Get_Line
(File : in File_Type)
return Strings.Unbounded.Unbounded_String;
Returns Strings.Unbounded.To_Unbounded_String(Text_IO.Get_Line(File));
function Get_Line
return Strings.Unbounded.Unbounded_String;
Returns Strings.Unbounded.To_Unbounded_String(Text_IO.Get_Line);
procedure Get_Line
(File : in File_Type; Item : out Strings.Unbounded.Unbounded_String);
Equivalent to Item := Get_Line (File);
procedure Get_Line
(Item : out Strings.Unbounded.Unbounded_String);
Equivalent to Item := Get_Line;
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe