FSF GCC merge 02/23/03
[official-gcc.git] / gcc / ada / a-tiflio.adb
blob4c92a5c38d73164bf648405a07ef1ea2394d0175
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT RUNTIME COMPONENTS --
4 -- --
5 -- A D A . T E X T _ I O . F L O A T _ I O --
6 -- --
7 -- B o d y --
8 -- --
9 -- --
10 -- Copyright (C) 1992-1999 Free Software Foundation, Inc. --
11 -- --
12 -- GNAT is free software; you can redistribute it and/or modify it under --
13 -- terms of the GNU General Public License as published by the Free Soft- --
14 -- ware Foundation; either version 2, or (at your option) any later ver- --
15 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
16 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
17 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
18 -- for more details. You should have received a copy of the GNU General --
19 -- Public License distributed with GNAT; see file COPYING. If not, write --
20 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
21 -- MA 02111-1307, USA. --
22 -- --
23 -- As a special exception, if other files instantiate generics from this --
24 -- unit, or you link this unit with other files to produce an executable, --
25 -- this unit does not by itself cause the resulting executable to be --
26 -- covered by the GNU General Public License. This exception does not --
27 -- however invalidate any other reasons why the executable file might be --
28 -- covered by the GNU Public License. --
29 -- --
30 -- GNAT was originally developed by the GNAT team at New York University. --
31 -- Extensive contributions were provided by Ada Core Technologies Inc. --
32 -- --
33 ------------------------------------------------------------------------------
35 with Ada.Text_IO.Float_Aux;
37 package body Ada.Text_IO.Float_IO is
39 package Aux renames Ada.Text_IO.Float_Aux;
41 ---------
42 -- Get --
43 ---------
45 procedure Get
46 (File : in File_Type;
47 Item : out Num;
48 Width : in Field := 0)
50 pragma Unsuppress (Range_Check);
52 begin
53 Aux.Get (File, Long_Long_Float (Item), Width);
55 exception
56 when Constraint_Error => raise Data_Error;
57 end Get;
59 procedure Get
60 (Item : out Num;
61 Width : in Field := 0)
63 pragma Unsuppress (Range_Check);
65 begin
66 Aux.Get (Current_In, Long_Long_Float (Item), Width);
68 exception
69 when Constraint_Error => raise Data_Error;
70 end Get;
72 procedure Get
73 (From : in String;
74 Item : out Num;
75 Last : out Positive)
77 pragma Unsuppress (Range_Check);
79 begin
80 Aux.Gets (From, Long_Long_Float (Item), Last);
82 exception
83 when Constraint_Error => raise Data_Error;
84 end Get;
86 ---------
87 -- Put --
88 ---------
90 procedure Put
91 (File : in File_Type;
92 Item : in Num;
93 Fore : in Field := Default_Fore;
94 Aft : in Field := Default_Aft;
95 Exp : in Field := Default_Exp)
97 begin
98 Aux.Put (File, Long_Long_Float (Item), Fore, Aft, Exp);
99 end Put;
101 procedure Put
102 (Item : in Num;
103 Fore : in Field := Default_Fore;
104 Aft : in Field := Default_Aft;
105 Exp : in Field := Default_Exp)
107 begin
108 Aux.Put (Current_Out, Long_Long_Float (Item), Fore, Aft, Exp);
109 end Put;
111 procedure Put
112 (To : out String;
113 Item : in Num;
114 Aft : in Field := Default_Aft;
115 Exp : in Field := Default_Exp)
117 begin
118 Aux.Puts (To, Long_Long_Float (Item), Aft, Exp);
119 end Put;
121 end Ada.Text_IO.Float_IO;