| 1 |
------------------------------------------------------------------------------ |
| 2 |
-- -- |
| 3 |
-- GNAT RUN-TIME COMPONENTS -- |
| 4 |
-- -- |
| 5 |
-- A D A . T E X T _ I O . E N U M E R A T I O N _ I O -- |
| 6 |
-- -- |
| 7 |
-- S p e c -- |
| 8 |
-- -- |
| 9 |
-- This specification is derived from the Ada Reference Manual for use with -- |
| 10 |
-- GNAT. In accordance with the copyright of that document, you can freely -- |
| 11 |
-- copy and modify this specification, provided that if you redistribute a -- |
| 12 |
-- modified version, any changes that you have made are clearly indicated. -- |
| 13 |
-- -- |
| 14 |
------------------------------------------------------------------------------ |
| 15 |
|
| 16 |
-- In Ada 95, the package Ada.Text_IO.Enumeration_IO is a subpackage of |
| 17 |
-- Text_IO. This is for compatibility with Ada 83. In GNAT we make it a |
| 18 |
-- child package to avoid loading the necessary code if Enumeration_IO is |
| 19 |
-- not instantiated. See routine Rtsfind.Check_Text_IO_Special_Unit for a |
| 20 |
-- description of how we patch up the difference in semantics so that it |
| 21 |
-- is invisible to the Ada programmer. |
| 22 |
|
| 23 |
private generic |
| 24 |
type Enum is (<>); |
| 25 |
|
| 26 |
package Ada.Text_IO.Enumeration_IO with |
| 27 |
Always_Terminates |
| 28 |
is |
| 29 |
|
| 30 |
Default_Width : Field := 0; |
| 31 |
Default_Setting : Type_Set := Upper_Case; |
| 32 |
|
| 33 |
procedure Get (File : File_Type; Item : out Enum) with |
| 34 |
Pre => Is_Open (File) and then Mode (File) = In_File, |
| 35 |
Global => (In_Out => File_System), |
| 36 |
Exceptional_Cases => (Data_Error | End_Error => Standard.True); |
| 37 |
|
| 38 |
procedure Get (Item : out Enum) with |
| 39 |
Post => |
| 40 |
Line_Length'Old = Line_Length |
| 41 |
and Page_Length'Old = Page_Length, |
| 42 |
Global => (In_Out => File_System), |
| 43 |
Exceptional_Cases => (Data_Error | End_Error => Standard.True); |
| 44 |
|
| 45 |
procedure Put |
| 46 |
(File : File_Type; |
| 47 |
Item : Enum; |
| 48 |
Width : Field := Default_Width; |
| 49 |
Set : Type_Set := Default_Setting) |
| 50 |
with |
| 51 |
Pre => Is_Open (File) and then Mode (File) /= In_File, |
| 52 |
Post => |
| 53 |
Line_Length (File)'Old = Line_Length (File) |
| 54 |
and Page_Length (File)'Old = Page_Length (File), |
| 55 |
Global => (In_Out => File_System), |
| 56 |
Exceptional_Cases => (Layout_Error => Line_Length (File) /= 0); |
| 57 |
|
| 58 |
procedure Put |
| 59 |
(Item : Enum; |
| 60 |
Width : Field := Default_Width; |
| 61 |
Set : Type_Set := Default_Setting) |
| 62 |
with |
| 63 |
Post => |
| 64 |
Line_Length'Old = Line_Length |
| 65 |
and Page_Length'Old = Page_Length, |
| 66 |
Global => (In_Out => File_System), |
| 67 |
Exceptional_Cases => (Layout_Error => Ada.Text_IO.Line_Length /= 0); |
| 68 |
|
| 69 |
procedure Get |
| 70 |
(From : String; |
| 71 |
Item : out Enum; |
| 72 |
Last : out Positive) |
| 73 |
with |
| 74 |
Global => null, |
| 75 |
Exceptional_Cases => (Data_Error => Standard.True); |
| 76 |
|
| 77 |
procedure Put |
| 78 |
(To : out String; |
| 79 |
Item : Enum; |
| 80 |
Set : Type_Set := Default_Setting) |
| 81 |
with |
| 82 |
Global => null, |
| 83 |
Exceptional_Cases => (Layout_Error => Standard.True); |
| 84 |
|
| 85 |
end Ada.Text_IO.Enumeration_IO; |