1 ------------------------------------------------------------------------------
3 -- GNAT RUN-TIME COMPONENTS --
5 -- A D A . T E X T _ I O . M O D U L A R _ I O --
9 -- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. --
18 -- As a special exception under Section 7 of GPL version 3, you are granted --
19 -- additional permissions described in the GCC Runtime Library Exception, --
20 -- version 3.1, as published by the Free Software Foundation. --
22 -- You should have received a copy of the GNU General Public License and --
23 -- a copy of the GCC Runtime Library Exception along with this program; --
24 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
25 -- <http://www.gnu.org/licenses/>. --
27 -- GNAT was originally developed by the GNAT team at New York University. --
28 -- Extensive contributions were provided by Ada Core Technologies Inc. --
30 ------------------------------------------------------------------------------
32 with Ada
.Text_IO
.Modular_Aux
;
34 with System
.Unsigned_Types
; use System
.Unsigned_Types
;
36 package body Ada
.Text_IO
.Modular_IO
is
38 package Aux
renames Ada
.Text_IO
.Modular_Aux
;
49 pragma Unsuppress
(Range_Check
);
52 if Num
'Size > Unsigned
'Size then
53 Aux
.Get_LLU
(File
, Long_Long_Unsigned
(Item
), Width
);
55 Aux
.Get_Uns
(File
, Unsigned
(Item
), Width
);
59 when Constraint_Error
=> raise Data_Error
;
66 pragma Unsuppress
(Range_Check
);
69 if Num
'Size > Unsigned
'Size then
70 Aux
.Get_LLU
(Current_In
, Long_Long_Unsigned
(Item
), Width
);
72 Aux
.Get_Uns
(Current_In
, Unsigned
(Item
), Width
);
76 when Constraint_Error
=> raise Data_Error
;
84 pragma Unsuppress
(Range_Check
);
87 if Num
'Size > Unsigned
'Size then
88 Aux
.Gets_LLU
(From
, Long_Long_Unsigned
(Item
), Last
);
90 Aux
.Gets_Uns
(From
, Unsigned
(Item
), Last
);
94 when Constraint_Error
=> raise Data_Error
;
104 Width
: Field
:= Default_Width
;
105 Base
: Number_Base
:= Default_Base
)
108 if Num
'Size > Unsigned
'Size then
109 Aux
.Put_LLU
(File
, Long_Long_Unsigned
(Item
), Width
, Base
);
111 Aux
.Put_Uns
(File
, Unsigned
(Item
), Width
, Base
);
117 Width
: Field
:= Default_Width
;
118 Base
: Number_Base
:= Default_Base
)
121 if Num
'Size > Unsigned
'Size then
122 Aux
.Put_LLU
(Current_Out
, Long_Long_Unsigned
(Item
), Width
, Base
);
124 Aux
.Put_Uns
(Current_Out
, Unsigned
(Item
), Width
, Base
);
131 Base
: Number_Base
:= Default_Base
)
134 if Num
'Size > Unsigned
'Size then
135 Aux
.Puts_LLU
(To
, Long_Long_Unsigned
(Item
), Base
);
137 Aux
.Puts_Uns
(To
, Unsigned
(Item
), Base
);
141 end Ada
.Text_IO
.Modular_IO
;