Merge from the pain train
[official-gcc.git] / gcc / ada / a-chahan.ads
blobca29d75241974e6ba077a64ee51d70af217ce3eb
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT RUN-TIME COMPONENTS --
4 -- --
5 -- A D A . C H A R A C T E R S . H A N D L I N G --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
10 -- --
11 -- This specification is derived from the Ada Reference Manual for use with --
12 -- GNAT. The copyright notice above, and the license provisions that follow --
13 -- apply solely to the contents of the part following the private keyword. --
14 -- --
15 -- GNAT is free software; you can redistribute it and/or modify it under --
16 -- terms of the GNU General Public License as published by the Free Soft- --
17 -- ware Foundation; either version 2, or (at your option) any later ver- --
18 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
19 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
20 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
21 -- for more details. You should have received a copy of the GNU General --
22 -- Public License distributed with GNAT; see file COPYING. If not, write --
23 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
24 -- MA 02111-1307, USA. --
25 -- --
26 -- As a special exception, if other files instantiate generics from this --
27 -- unit, or you link this unit with other files to produce an executable, --
28 -- this unit does not by itself cause the resulting executable to be --
29 -- covered by the GNU General Public License. This exception does not --
30 -- however invalidate any other reasons why the executable file might be --
31 -- covered by the GNU Public License. --
32 -- --
33 -- GNAT was originally developed by the GNAT team at New York University. --
34 -- Extensive contributions were provided by Ada Core Technologies Inc. --
35 -- --
36 ------------------------------------------------------------------------------
39 package Ada.Characters.Handling is
40 pragma Preelaborate (Handling);
42 ----------------------------------------
43 -- Character Classification Functions --
44 ----------------------------------------
46 function Is_Control (Item : Character) return Boolean;
47 function Is_Graphic (Item : Character) return Boolean;
48 function Is_Letter (Item : Character) return Boolean;
49 function Is_Lower (Item : Character) return Boolean;
50 function Is_Upper (Item : Character) return Boolean;
51 function Is_Basic (Item : Character) return Boolean;
52 function Is_Digit (Item : Character) return Boolean;
53 function Is_Decimal_Digit (Item : Character) return Boolean
54 renames Is_Digit;
55 function Is_Hexadecimal_Digit (Item : Character) return Boolean;
56 function Is_Alphanumeric (Item : Character) return Boolean;
57 function Is_Special (Item : Character) return Boolean;
59 ---------------------------------------------------
60 -- Conversion Functions for Character and String --
61 ---------------------------------------------------
63 function To_Lower (Item : Character) return Character;
64 function To_Upper (Item : Character) return Character;
65 function To_Basic (Item : Character) return Character;
67 function To_Lower (Item : String) return String;
68 function To_Upper (Item : String) return String;
69 function To_Basic (Item : String) return String;
71 ----------------------------------------------------------------------
72 -- Classifications of and Conversions Between Character and ISO 646 --
73 ----------------------------------------------------------------------
75 subtype ISO_646 is
76 Character range Character'Val (0) .. Character'Val (127);
78 function Is_ISO_646 (Item : Character) return Boolean;
79 function Is_ISO_646 (Item : String) return Boolean;
81 function To_ISO_646
82 (Item : Character;
83 Substitute : ISO_646 := ' ') return ISO_646;
85 function To_ISO_646
86 (Item : String;
87 Substitute : ISO_646 := ' ') return String;
89 ------------------------------------------------------
90 -- Classifications of Wide_Character and Characters --
91 ------------------------------------------------------
93 function Is_Character (Item : Wide_Character) return Boolean;
94 function Is_Character (Item : Wide_Wide_Character) return Boolean;
95 function Is_String (Item : Wide_String) return Boolean;
96 function Is_String (Item : Wide_Wide_String) return Boolean;
97 function Is_Wide_Character (Item : Wide_Wide_Character) return Boolean;
98 function Is_Wide_String (Item : Wide_Wide_String) return Boolean;
100 ---------------------------------------------------------------------------
101 -- Conversions between Wide_Wide_Character, Wide_Character and Character --
102 ---------------------------------------------------------------------------
104 function To_Character
105 (Item : Wide_Character;
106 Substitute : Character := ' ') return Character;
108 function To_Character
109 (Item : Wide_Wide_Character;
110 Substitute : Character := ' ') return Character;
112 function To_String
113 (Item : Wide_String;
114 Substitute : Character := ' ') return String;
116 function To_String
117 (Item : Wide_Wide_String;
118 Substitute : Character := ' ') return String;
120 function To_Wide_Character
121 (Item : Character) return Wide_Character;
122 function To_Wide_Character
123 (Item : Wide_Wide_Character;
124 Substitute : Wide_Character := ' ') return Wide_Character;
126 function To_Wide_String
127 (Item : String) return Wide_String;
128 function To_Wide_String
129 (Item : Wide_Wide_String;
130 Substitute : Wide_Character := ' ') return Wide_String;
132 function To_Wide_Wide_Character
133 (Item : Character) return Wide_Wide_Character;
134 function To_Wide_Wide_Character
135 (Item : Wide_Character) return Wide_Wide_Character;
137 function To_Wide_Wide_String
138 (Item : String) return Wide_Wide_String;
139 function To_Wide_Wide_String
140 (Item : Wide_String) return Wide_Wide_String;
142 private
143 pragma Inline (Is_Control);
144 pragma Inline (Is_Graphic);
145 pragma Inline (Is_Letter);
146 pragma Inline (Is_Lower);
147 pragma Inline (Is_Upper);
148 pragma Inline (Is_Basic);
149 pragma Inline (Is_Digit);
150 pragma Inline (Is_Hexadecimal_Digit);
151 pragma Inline (Is_Alphanumeric);
152 pragma Inline (Is_Special);
153 pragma Inline (To_Lower);
154 pragma Inline (To_Upper);
155 pragma Inline (To_Basic);
156 pragma Inline (Is_ISO_646);
157 pragma Inline (Is_Character);
158 pragma Inline (To_Character);
159 pragma Inline (To_Wide_Character);
160 pragma Inline (To_Wide_Wide_Character);
162 end Ada.Characters.Handling;