annotate com.ibm.icu/src/com/ibm/icu/mangoicu/ULocale.d @ 120:536e43f63c81

Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661 ===D2=== * added [Try]Immutable/Const/Shared templates to work with differenses in D1/D2 instead of version statements used these templates to work with strict type storage rules of dmd-2.053 * com.ibm.icu now also compilable with D2, but not tested yet * small fixes Snippet288 - shared data is in TLS ===Phobos=== * fixed critical bugs in Phobos implemention completely incorrect segfault prone fromStringz (Linux's port ruthless killer) terrible, incorrect StringBuffer realization (StyledText killer) * fixed small bugs as well Snippet72 - misprint in the snippet * implemented missed functionality for Phobos ByteArrayOutputStream implemented (image loading available) formatting correctly works for all DWT's cases As a result, folowing snippets now works with Phobos (Snippet### - what is fixed): Snippet24, 42, 111, 115, 130, 235, 276 - bad string formatting Snippet48, 282 - crash on image loading Snippet163, 189, 211, 213, 217, 218, 222 - crash on copy/cut in StyledText Snippet244 - hang-up ===Tango=== * few changes for the latest Tango trunc-r5661 * few small performance improvments ===General=== * implMissing-s for only one version changed to implMissingInTango/InPhobos * incorrect calls to Format in toString-s fixed * fixed loading \uXXXX characters in ResourceBundle * added good UTF-8 support for StyledText, TextLayout (Win32) and friends UTF functions revised and tested. It is now in java.nonstandard.*Utf modules StyledText and TextLayout (Win32) modules revised for UTF-8 support * removed small diferences in most identical files in *.swt.* folders *.swt.internal.image, *.swt.events and *.swt.custom are identical in Win32/Linux32 now 179 of 576 (~31%) files in *.swt.* folders are fully identical * Win32: snippets now have right subsystem, pretty icons and native system style controls * small fixes in snippets Snippet44 - it's not Snippet44 Snippet212 - functions work with different images and offsets arrays Win32: Snippet282 - crash on close if the button has an image Snippet293 - setGrayed is commented and others Win32: As a result, folowing snippets now works Snippet68 - color doesn't change Snippet163, 189, 211, 213, 217, 218, 222 - UTF-8 issues (see above) Snippet193 - no tabel headers
author Denis Shelomovskij <verylonglogin.reg@gmail.com>
date Sat, 09 Jul 2011 15:50:20 +0300
parents ebefa5c2eab4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1 /*******************************************************************************
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3 @file ULocale.d
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
5 Copyright (c) 2004 Kris Bell
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
6
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
7 This software is provided 'as-is', without any express or implied
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
8 warranty. In no event will the authors be held liable for damages
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
9 of any kind arising from the use of this software.
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
10
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
11 Permission is hereby granted to anyone to use this software for any
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
12 purpose, including commercial applications, and to alter it and/or
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
13 redistribute it freely, subject to the following restrictions:
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
14
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
15 1. The origin of this software must not be misrepresented; you must
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
16 not claim that you wrote the original software. If you use this
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
17 software in a product, an acknowledgment within documentation of
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
18 said product would be appreciated but is not required.
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
19
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
20 2. Altered source versions must be plainly marked as such, and must
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
21 not be misrepresented as being the original software.
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
22
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
23 3. This notice may not be removed or altered from any distribution
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
24 of the source.
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
25
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
26 4. Derivative works are permitted, but they must carry this notice
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
27 in full and credit the original source.
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
28
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
29
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
30 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
31
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
32
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
33 @version Initial version, October 2004
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
34 @author Kris
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
35
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
36 Note that this package and documentation is built around the ICU
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
37 project (http://oss.software.ibm.com/icu/). Below is the license
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
38 statement as specified by that software:
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
39
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
40
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
41 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
42
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
43
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
44 ICU License - ICU 1.8.1 and later
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
45
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
46 COPYRIGHT AND PERMISSION NOTICE
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
47
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
48 Copyright (c) 1995-2003 International Business Machines Corporation and
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
49 others.
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
50
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
51 All rights reserved.
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
52
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
53 Permission is hereby granted, free of charge, to any person obtaining a
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
54 copy of this software and associated documentation files (the
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
55 "Software"), to deal in the Software without restriction, including
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
56 without limitation the rights to use, copy, modify, merge, publish,
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
57 distribute, and/or sell copies of the Software, and to permit persons
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
58 to whom the Software is furnished to do so, provided that the above
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
59 copyright notice(s) and this permission notice appear in all copies of
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
60 the Software and that both the above copyright notice(s) and this
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
61 permission notice appear in supporting documentation.
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
62
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
63 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
64 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
65 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
66 OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
67 HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
68 INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
69 FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
70 NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
71 WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
72
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
73 Except as contained in this notice, the name of a copyright holder
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
74 shall not be used in advertising or otherwise to promote the sale, use
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
75 or other dealings in this Software without prior written authorization
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
76 of the copyright holder.
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
77
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
78 ----------------------------------------------------------------------
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
79
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
80 All trademarks and registered trademarks mentioned herein are the
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
81 property of their respective owners.
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
82
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
83 *******************************************************************************/
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
84
92
ebefa5c2eab4 moving ICU bindings to com.ibm.icu
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
85 module com.ibm.icu.mangoicu.ULocale;
16
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
86
92
ebefa5c2eab4 moving ICU bindings to com.ibm.icu
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
87 private import com.ibm.icu.mangoicu.ICU;
21
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 16
diff changeset
88 private import java.lang.util;
16
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
89
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
90 /*******************************************************************************
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
91
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
92 Note that this is a struct rather than a class. This is so
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
93 that one can easily construct these on the stack, plus the
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
94 'convenience' instances can be created statically.
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
95
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
96 *******************************************************************************/
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
97
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
98 struct ULocale
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
99 {
120
536e43f63c81 Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents: 92
diff changeset
100 public String name;
16
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
101
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
102 /***********************************************************************
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
103
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
104 ***********************************************************************/
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
105
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
106 public static ULocale Root = {""};
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
107 public static ULocale Default = {null};
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
108 public static ULocale English = {"en"};
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
109 public static ULocale Chinese = {"zh"};
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
110 public static ULocale French = {"fr"};
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
111 public static ULocale German = {"de"};
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
112 public static ULocale Italian = {"it"};
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
113 public static ULocale Japanese = {"ja"};
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
114 public static ULocale Korean = {"ko"};
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
115 public static ULocale SimplifiedChinese = {"zh_CN"};
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
116 public static ULocale TraditionalChinese = {"zh_TW"};
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
117 public static ULocale Canada = {"en_CA"};
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
118 public static ULocale CanadaFrench = {"fr_CA"};
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
119 public static ULocale China = {"zh_CN"};
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
120 public static ULocale PRC = {"zh_CN"};
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
121 public static ULocale France = {"fr_FR"};
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
122 public static ULocale Germany = {"de_DE"};
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
123 public static ULocale Italy = {"it_IT"};
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
124 public static ULocale Japan = {"jp_JP"};
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
125 public static ULocale Korea = {"ko_KR"};
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
126 public static ULocale Taiwan = {"zh_TW"};
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
127 public static ULocale UK = {"en_GB"};
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
128 public static ULocale US = {"en_US"};
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
129
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
130 /***********************************************************************
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
131
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
132 ***********************************************************************/
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
133
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
134 public enum Type
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
135 {
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
136 Actual = 0,
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
137 Valid = 1,
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
138 Requested = 2,
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
139 }
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
140
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
141 /***********************************************************************
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
142
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
143 ***********************************************************************/
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
144
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
145 public const uint LanguageCapacity = 12;
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
146 public const uint CountryCapacity = 4;
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
147 public const uint FullNameCapacity = 56;
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
148 public const uint ScriptCapacity = 6;
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
149 public const uint KeywordsCapacity = 50;
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
150 public const uint KeywordAndValuesCapacity = 100;
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
151 public const char KeywordItemSeparator = ':';
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
152 public const char KeywordSeparator = '@';
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
153 public const char KeywordAssign = '=';
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
154
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
155
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
156 /***********************************************************************
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
157
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
158 ***********************************************************************/
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
159
120
536e43f63c81 Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents: 92
diff changeset
160 static void getDefault (ref ULocale locale)
16
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
161 {
120
536e43f63c81 Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents: 92
diff changeset
162 locale.name = cast(String)ICU.toArray (uloc_getDefault());
16
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
163 if (! locale.name)
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
164 ICU.exception ("failed to get default locale");
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
165 }
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
166
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
167 /***********************************************************************
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
168
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
169 ***********************************************************************/
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
170
120
536e43f63c81 Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents: 92
diff changeset
171 static void setDefault (ref ULocale locale)
16
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
172 {
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
173 ICU.UErrorCode e;
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
174
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
175 uloc_setDefault (ICU.toString(locale.name), e);
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
176
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
177 if (ICU.isError (e))
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
178 ICU.exception ("invalid locale '"~locale.name~"'");
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
179 }
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
180
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
181
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
182
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
183 /***********************************************************************
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
184
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
185 Bind the ICU functions from a shared library. This is
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
186 complicated by the issues regarding D and DLLs on the
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
187 Windows platform
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
188
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
189 ***********************************************************************/
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
190
120
536e43f63c81 Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents: 92
diff changeset
191 mixin(/*ICU.*/genICUNative!("uc"
536e43f63c81 Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents: 92
diff changeset
192 ,"char* function ()", "uloc_getDefault"
536e43f63c81 Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents: 92
diff changeset
193 ,"void function (char*, ref ICU.UErrorCode)", "uloc_setDefault"
536e43f63c81 Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents: 92
diff changeset
194 ));
16
dbfb303e8fb0 first complete successful compile (win-only)
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
195 }