OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / ada / a-chahan.ads
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 --                                                                          --
10 --          Copyright (C) 1992-1997 Free Software Foundation, Inc.          --
11 --                                                                          --
12 -- This specification is derived from the Ada Reference Manual for use with --
13 -- GNAT. The copyright notice above, and the license provisions that follow --
14 -- apply solely to the  contents of the part following the private keyword. --
15 --                                                                          --
16 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
17 -- terms of the  GNU General Public License as published  by the Free Soft- --
18 -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
19 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
20 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
21 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
22 -- for  more details.  You should have  received  a copy of the GNU General --
23 -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
24 -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
25 -- MA 02111-1307, USA.                                                      --
26 --                                                                          --
27 -- As a special exception,  if other files  instantiate  generics from this --
28 -- unit, or you link  this unit with other files  to produce an executable, --
29 -- this  unit  does not  by itself cause  the resulting  executable  to  be --
30 -- covered  by the  GNU  General  Public  License.  This exception does not --
31 -- however invalidate  any other reasons why  the executable file  might be --
32 -- covered by the  GNU Public License.                                      --
33 --                                                                          --
34 -- GNAT was originally developed  by the GNAT team at  New York University. --
35 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
36 --                                                                          --
37 ------------------------------------------------------------------------------
38
39
40 package Ada.Characters.Handling is
41 pragma Preelaborate (Handling);
42
43    ----------------------------------------
44    -- Character Classification Functions --
45    ----------------------------------------
46
47    function Is_Control           (Item : in Character) return Boolean;
48    function Is_Graphic           (Item : in Character) return Boolean;
49    function Is_Letter            (Item : in Character) return Boolean;
50    function Is_Lower             (Item : in Character) return Boolean;
51    function Is_Upper             (Item : in Character) return Boolean;
52    function Is_Basic             (Item : in Character) return Boolean;
53    function Is_Digit             (Item : in Character) return Boolean;
54    function Is_Decimal_Digit     (Item : in Character) return Boolean
55                                                           renames Is_Digit;
56    function Is_Hexadecimal_Digit (Item : in Character) return Boolean;
57    function Is_Alphanumeric      (Item : in Character) return Boolean;
58    function Is_Special           (Item : in Character) return Boolean;
59
60    ---------------------------------------------------
61    -- Conversion Functions for Character and String --
62    ---------------------------------------------------
63
64    function To_Lower (Item : in Character) return Character;
65    function To_Upper (Item : in Character) return Character;
66    function To_Basic (Item : in Character) return Character;
67
68    function To_Lower (Item : in String) return String;
69    function To_Upper (Item : in String) return String;
70    function To_Basic (Item : in String) return String;
71
72    ----------------------------------------------------------------------
73    -- Classifications of and Conversions Between Character and ISO 646 --
74    ----------------------------------------------------------------------
75
76    subtype ISO_646 is
77      Character range Character'Val (0) .. Character'Val (127);
78
79    function Is_ISO_646 (Item : in Character) return Boolean;
80    function Is_ISO_646 (Item : in String)    return Boolean;
81
82    function To_ISO_646
83      (Item       : in Character;
84       Substitute : in ISO_646 := ' ')
85       return       ISO_646;
86
87    function To_ISO_646
88      (Item      : in String;
89       Substitute : in ISO_646 := ' ')
90       return       String;
91
92    ------------------------------------------------------
93    -- Classifications of Wide_Character and Characters --
94    ------------------------------------------------------
95
96    function Is_Character (Item : in Wide_Character) return Boolean;
97    function Is_String    (Item : in Wide_String)    return Boolean;
98
99    ------------------------------------------------------
100    -- Conversions between Wide_Character and Character --
101    ------------------------------------------------------
102
103    function To_Character
104      (Item       : in Wide_Character;
105       Substitute : in Character := ' ')
106       return       Character;
107
108    function To_String
109      (Item       : in Wide_String;
110       Substitute : in Character := ' ')
111       return       String;
112
113    function To_Wide_Character (Item : in Character) return Wide_Character;
114    function To_Wide_String    (Item : in String)    return Wide_String;
115
116 private
117    pragma Inline (Is_Control);
118    pragma Inline (Is_Graphic);
119    pragma Inline (Is_Letter);
120    pragma Inline (Is_Lower);
121    pragma Inline (Is_Upper);
122    pragma Inline (Is_Basic);
123    pragma Inline (Is_Digit);
124    pragma Inline (Is_Hexadecimal_Digit);
125    pragma Inline (Is_Alphanumeric);
126    pragma Inline (Is_Special);
127    pragma Inline (To_Lower);
128    pragma Inline (To_Upper);
129    pragma Inline (To_Basic);
130    pragma Inline (Is_ISO_646);
131    pragma Inline (Is_Character);
132    pragma Inline (To_Character);
133    pragma Inline (To_Wide_Character);
134
135 end Ada.Characters.Handling;