comparison gcc/ada/libgnat/a-locale.ads @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
4 -- -- 4 -- --
5 -- A D A . L O C A L E S -- 5 -- A D A . L O C A L E S --
6 -- -- 6 -- --
7 -- S p e c -- 7 -- S p e c --
8 -- -- 8 -- --
9 -- Copyright (C) 2010-2018, Free Software Foundation, Inc. -- 9 -- Copyright (C) 2010-2019, Free Software Foundation, Inc. --
10 -- -- 10 -- --
11 -- This specification is derived from the Ada Reference Manual for use with -- 11 -- This specification is derived from the Ada Reference Manual for use with --
12 -- GNAT. In accordance with the copyright of that document, you can freely -- 12 -- GNAT. In accordance with the copyright of that document, you can freely --
13 -- copy and modify this specification, provided that if you redistribute a -- 13 -- copy and modify this specification, provided that if you redistribute a --
14 -- modified version, any changes that you have made are clearly indicated. -- 14 -- modified version, any changes that you have made are clearly indicated. --
17 17
18 package Ada.Locales is 18 package Ada.Locales is
19 pragma Preelaborate (Locales); 19 pragma Preelaborate (Locales);
20 pragma Remote_Types (Locales); 20 pragma Remote_Types (Locales);
21 21
22 -- A locale identifies a geopolitical place or region and its associated
23 -- language, which can be used to determine other internationalization-
24 -- related characteristics. The active locale is the locale associated with
25 -- the partition of the current task.
26
22 type Language_Code is new String (1 .. 3) 27 type Language_Code is new String (1 .. 3)
23 with Dynamic_Predicate => 28 with Dynamic_Predicate =>
24 (for all E of Language_Code => E in 'a' .. 'z'); 29 (for all E of Language_Code => E in 'a' .. 'z');
30 -- Lower-case string representation of an ISO 639-3 alpha-3 code that
31 -- identifies a language.
25 32
26 type Country_Code is new String (1 .. 2) 33 type Country_Code is new String (1 .. 2)
27 with Dynamic_Predicate => 34 with Dynamic_Predicate =>
28 (for all E of Country_Code => E in 'A' .. 'Z'); 35 (for all E of Country_Code => E in 'A' .. 'Z');
36 -- Upper-case string representation of an ISO 3166-1 alpha-2 code that
37 -- identifies a country.
29 38
30 Language_Unknown : constant Language_Code := "und"; 39 Language_Unknown : constant Language_Code := "und";
31 Country_Unknown : constant Country_Code := "ZZ"; 40 Country_Unknown : constant Country_Code := "ZZ";
32 41
33 function Language return Language_Code; 42 function Language return Language_Code;
43 -- Returns the code of the language associated with the active locale. If
44 -- the Language_Code associated with the active locale cannot be determined
45 -- from the environment, then Language returns Language_Unknown.
46
34 function Country return Country_Code; 47 function Country return Country_Code;
48 -- Returns the code of the country associated with the active locale. If
49 -- the Country_Code associated with the active locale cannot be determined
50 -- from the environment, then Country returns Country_Unknown.
35 51
36 end Ada.Locales; 52 end Ada.Locales;