Text_IO Facilities for Unbounded Strings (GNAT Reference Manual) (original) (raw)
11.5.6 Text_IO Facilities for Unbounded Strings ¶
The package Ada.Strings.Unbounded.Text_IO
in library files a-suteio.ads/adb
contains some GNAT-specific subprograms useful for Text_IO operations on unbounded strings:
- function Get_Line (File : File_Type) return Unbounded_String; Reads a line from the specified file and returns the result as an unbounded string.
- procedure Put (File : File_Type; U : Unbounded_String); Writes the value of the given unbounded string to the specified file Similar to the effect of
Put (To_String (U))
except that an extra copy is avoided. - procedure Put_Line (File : File_Type; U : Unbounded_String); Writes the value of the given unbounded string to the specified file, followed by a
New_Line
. Similar to the effect ofPut_Line (To_String (U))
except that an extra copy is avoided.
In the above procedures, File
is of type Ada.Text_IO.File_Type
and is optional. If the parameter is omitted, then the standard input or output file is referenced as appropriate.
The package Ada.Strings.Wide_Unbounded.Wide_Text_IO
in library files a-swuwti.ads
and a-swuwti.adb
provides similar extendedWide_Text_IO
functionality for unbounded wide strings.
The package Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO
in library files a-szuzti.ads
and a-szuzti.adb
provides similar extendedWide_Wide_Text_IO
functionality for unbounded wide wide strings.