1 ------------------------------------------------------------------------------
3 -- GNAT RUN-TIME COMPONENTS --
5 -- A D A . W I D E _ C H A R A C T E R T S . U N I C O D E --
9 -- Copyright (C) 2005-2007, 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 2, 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. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
20 -- Boston, MA 02110-1301, USA. --
22 -- As a special exception, if other files instantiate generics from this --
23 -- unit, or you link this unit with other files to produce an executable, --
24 -- this unit does not by itself cause the resulting executable to be --
25 -- covered by the GNU General Public License. This exception does not --
26 -- however invalidate any other reasons why the executable file might be --
27 -- covered by the GNU Public License. --
29 -- GNAT was originally developed by the GNAT team at New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc. --
32 ------------------------------------------------------------------------------
34 package body Ada
.Wide_Characters
.Unicode
is
36 package G
renames System
.UTF_32
;
42 function Get_Category
(U
: Wide_Character) return Category
is
44 return Category
(G
.Get_Category
(Wide_Character'Pos (U
)));
51 function Is_Digit
(U
: Wide_Character) return Boolean is
53 return G
.Is_UTF_32_Digit
(Wide_Character'Pos (U
));
56 function Is_Digit
(C
: Category
) return Boolean is
58 return G
.Is_UTF_32_Digit
(G
.Category
(C
));
65 function Is_Letter
(U
: Wide_Character) return Boolean is
67 return G
.Is_UTF_32_Letter
(Wide_Character'Pos (U
));
70 function Is_Letter
(C
: Category
) return Boolean is
72 return G
.Is_UTF_32_Letter
(G
.Category
(C
));
75 ------------------------
76 -- Is_Line_Terminator --
77 ------------------------
79 function Is_Line_Terminator
(U
: Wide_Character) return Boolean is
81 return G
.Is_UTF_32_Line_Terminator
(Wide_Character'Pos (U
));
82 end Is_Line_Terminator
;
88 function Is_Mark
(U
: Wide_Character) return Boolean is
90 return G
.Is_UTF_32_Mark
(Wide_Character'Pos (U
));
93 function Is_Mark
(C
: Category
) return Boolean is
95 return G
.Is_UTF_32_Mark
(G
.Category
(C
));
102 function Is_Non_Graphic
(U
: Wide_Character) return Boolean is
104 return G
.Is_UTF_32_Non_Graphic
(Wide_Character'Pos (U
));
107 function Is_Non_Graphic
(C
: Category
) return Boolean is
109 return G
.Is_UTF_32_Non_Graphic
(G
.Category
(C
));
116 function Is_Other
(U
: Wide_Character) return Boolean is
118 return G
.Is_UTF_32_Other
(Wide_Character'Pos (U
));
121 function Is_Other
(C
: Category
) return Boolean is
123 return G
.Is_UTF_32_Other
(G
.Category
(C
));
130 function Is_Punctuation
(U
: Wide_Character) return Boolean is
132 return G
.Is_UTF_32_Punctuation
(Wide_Character'Pos (U
));
135 function Is_Punctuation
(C
: Category
) return Boolean is
137 return G
.Is_UTF_32_Punctuation
(G
.Category
(C
));
144 function Is_Space
(U
: Wide_Character) return Boolean is
146 return G
.Is_UTF_32_Space
(Wide_Character'Pos (U
));
149 function Is_Space
(C
: Category
) return Boolean is
151 return G
.Is_UTF_32_Space
(G
.Category
(C
));
158 function To_Upper_Case
159 (U
: Wide_Character) return Wide_Character
164 (G
.UTF_32_To_Upper_Case
(Wide_Character'Pos (U
)));
167 end Ada
.Wide_Characters
.Unicode
;