Mercurial > projects > dwt-addons
annotate dwtx/dwtxhelper/mangoicu/UResourceBundle.d @ 89:040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 22 Jun 2008 22:57:31 +0200 |
parents | |
children | 11e8159caf7a |
rev | line source |
---|---|
89
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1 /******************************************************************************* |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3 @file UResourceBundle.d |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
5 Copyright (c) 2004 Kris Bell |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
6 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
7 This software is provided 'as-is', without any express or implied |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
8 warranty. In no event will the authors be held liable for damages |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
9 of any kind arising from the use of this software. |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
10 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
11 Permission is hereby granted to anyone to use this software for any |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
12 purpose, including commercial applications, and to alter it and/or |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
13 redistribute it freely, subject to the following restrictions: |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
14 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
15 1. The origin of this software must not be misrepresented; you must |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
16 not claim that you wrote the original software. If you use this |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
17 software in a product, an acknowledgment within documentation of |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
18 said product would be appreciated but is not required. |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
19 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
20 2. Altered source versions must be plainly marked as such, and must |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
21 not be misrepresented as being the original software. |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
22 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
23 3. This notice may not be removed or altered from any distribution |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
24 of the source. |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
25 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
26 4. Derivative works are permitted, but they must carry this notice |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
27 in full and credit the original source. |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
28 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
29 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
30 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
31 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
32 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
33 @version Initial version, November 2004 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
34 @author Kris |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
35 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
36 Note that this package and documentation is built around the ICU |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
37 project (http://oss.software.ibm.com/icu/). Below is the license |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
38 statement as specified by that software: |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
39 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
40 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
41 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
42 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
43 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
44 ICU License - ICU 1.8.1 and later |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
45 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
46 COPYRIGHT AND PERMISSION NOTICE |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
47 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
48 Copyright (c) 1995-2003 International Business Machines Corporation and |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
49 others. |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
50 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
51 All rights reserved. |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
52 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
53 Permission is hereby granted, free of charge, to any person obtaining a |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
54 copy of this software and associated documentation files (the |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
55 "Software"), to deal in the Software without restriction, including |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
56 without limitation the rights to use, copy, modify, merge, publish, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
57 distribute, and/or sell copies of the Software, and to permit persons |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
58 to whom the Software is furnished to do so, provided that the above |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
59 copyright notice(s) and this permission notice appear in all copies of |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
60 the Software and that both the above copyright notice(s) and this |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
61 permission notice appear in supporting documentation. |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
62 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
63 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
64 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
65 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
66 OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
67 HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
68 INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
69 FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
70 NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
71 WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
72 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
73 Except as contained in this notice, the name of a copyright holder |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
74 shall not be used in advertising or otherwise to promote the sale, use |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
75 or other dealings in this Software without prior written authorization |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
76 of the copyright holder. |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
77 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
78 ---------------------------------------------------------------------- |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
79 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
80 All trademarks and registered trademarks mentioned herein are the |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
81 property of their respective owners. |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
82 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
83 *******************************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
84 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
85 module dwtx.dwthelper.mangoicu.UResourceBundle; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
86 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
87 private import dwtx.dwthelper.mangoicu.ICU, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
88 dwtx.dwthelper.mangoicu.UString; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
89 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
90 public import dwtx.dwthelper.mangoicu.ULocale; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
91 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
92 /******************************************************************************* |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
93 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
94 API representing a collection of resource information pertaining to |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
95 a given locale. A resource bundle provides a way of accessing locale- |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
96 specific information in a data file. You create a resource bundle that |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
97 manages the resources for a given locale and then ask it for individual |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
98 resources. |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
99 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
100 Resource bundles in ICU4C are currently defined using text files which |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
101 conform to the following BNF definition. More on resource bundle concepts |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
102 and syntax can be found in the Users Guide. |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
103 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
104 See <A HREF="http://oss.software.ibm.com/icu/apiref/ures_8h.html"> |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
105 this page</A> for full details. |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
106 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
107 *******************************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
108 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
109 class UResourceBundle : ICU |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
110 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
111 private Handle handle; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
112 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
113 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
114 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
115 Internals opened up to the public |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
116 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
117 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
118 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
119 // Numeric constants for types of resource items |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
120 public enum ResType |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
121 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
122 None = -1, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
123 String = 0, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
124 Binary = 1, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
125 Table = 2, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
126 Alias = 3, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
127 Int = 7, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
128 Array = 8, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
129 IntVector = 14 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
130 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
131 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
132 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
133 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
134 private constructor for internal use only |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
135 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
136 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
137 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
138 private this (Handle handle) |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
139 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
140 this.handle = handle; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
141 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
142 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
143 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
144 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
145 Constructs a resource bundle for the locale-specific bundle |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
146 in the specified path. |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
147 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
148 locale This is the locale this resource bundle is for. To |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
149 get resources for the French locale, for example, you |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
150 would create a ResourceBundle passing ULocale::FRENCH |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
151 for the "locale" parameter, and all subsequent calls |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
152 to that resource bundle will return resources that |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
153 pertain to the French locale. If the caller passes a |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
154 Locale.Default parameter, the default locale for the |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
155 system (as returned by ULocale.getDefault()) will be |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
156 used. Passing Locale.Root will cause the root-locale |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
157 to be used. |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
158 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
159 path This is a full pathname in the platform-specific |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
160 format for the directory containing the resource |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
161 data files we want to load resources from. We use |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
162 locale IDs to generate filenames, and the filenames |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
163 have this string prepended to them before being passed |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
164 to the C++ I/O functions. Therefore, this string must |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
165 always end with a directory delimiter (whatever that |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
166 is for the target OS) for this class to work correctly. |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
167 A null value will open the default ICU data-files |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
168 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
169 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
170 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
171 this (inout ULocale locale, char[] path = null) |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
172 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
173 Error e; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
174 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
175 handle = ures_open (toString(path), toString(locale.name), e); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
176 testError (e, "failed to open resource bundle"); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
177 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
178 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
179 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
180 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
181 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
182 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
183 ~this () |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
184 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
185 ures_close (handle); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
186 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
187 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
188 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
189 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
190 Returns the size of a resource. Size for scalar types is |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
191 always 1, and for vector/table types is the number of child |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
192 resources. |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
193 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
194 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
195 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
196 uint getSize () |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
197 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
198 return ures_getSize (handle); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
199 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
200 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
201 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
202 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
203 Returns a signed integer from a resource. This integer is |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
204 originally 28 bit and the sign gets propagated. |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
205 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
206 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
207 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
208 int getInt () |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
209 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
210 Error e; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
211 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
212 int x = ures_getInt (handle, e); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
213 testError (e, "failed to get resource integer"); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
214 return x; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
215 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
216 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
217 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
218 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
219 Returns a string from a string resource type |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
220 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
221 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
222 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
223 UText getString () |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
224 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
225 Error e; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
226 uint len; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
227 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
228 wchar* x = ures_getString (handle, len, e); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
229 testError (e, "failed to get resource string"); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
230 return new UText (x[0..len]); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
231 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
232 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
233 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
234 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
235 Returns the string in a given resource at the specified |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
236 index |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
237 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
238 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
239 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
240 UText getString (uint index) |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
241 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
242 Error e; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
243 uint len; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
244 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
245 wchar* x = ures_getStringByIndex (handle, index, len, e); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
246 testError (e, "failed to get resource string"); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
247 return new UText (x[0..len]); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
248 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
249 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
250 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
251 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
252 Returns a string in a resource that has a given key. This |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
253 procedure works only with table resources. |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
254 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
255 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
256 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
257 UText getString (char[] key) |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
258 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
259 Error e; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
260 uint len; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
261 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
262 wchar* x = ures_getStringByKey (handle, toString(key), len, e); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
263 testError (e, "failed to get resource string"); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
264 return new UText (x[0..len]); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
265 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
266 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
267 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
268 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
269 Returns the next string in a resource or NULL if there are |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
270 no more resources to iterate over |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
271 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
272 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
273 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
274 UText getNextString () |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
275 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
276 Error e; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
277 uint len; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
278 char* key; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
279 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
280 wchar* x = ures_getNextString (handle, len, key, e); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
281 testError (e, "failed to get next resource string"); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
282 return new UText (x[0..len]); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
283 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
284 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
285 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
286 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
287 Returns a binary data from a resource. Can be used at most |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
288 primitive resource types (binaries, strings, ints) |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
289 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
290 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
291 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
292 void[] getBinary () |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
293 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
294 Error e; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
295 uint len; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
296 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
297 void* x = ures_getBinary (handle, len, e); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
298 testError (e, "failed to get binary resource"); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
299 return x[0..len]; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
300 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
301 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
302 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
303 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
304 Returns an integer vector from a resource |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
305 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
306 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
307 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
308 int[] getIntVector () |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
309 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
310 Error e; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
311 uint len; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
312 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
313 int* x = ures_getIntVector (handle, len, e); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
314 testError (e, "failed to get vector resource"); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
315 return x[0..len]; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
316 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
317 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
318 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
319 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
320 Checks whether the resource has another element to |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
321 iterate over |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
322 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
323 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
324 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
325 bool hasNext () |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
326 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
327 return ures_hasNext (handle) != 0; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
328 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
329 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
330 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
331 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
332 Resets the internal context of a resource so that |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
333 iteration starts from the first element |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
334 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
335 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
336 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
337 void resetIterator () |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
338 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
339 ures_resetIterator (handle); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
340 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
341 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
342 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
343 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
344 Returns the next resource in a given resource or NULL if |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
345 there are no more resources |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
346 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
347 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
348 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
349 UResourceBundle getNextResource () |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
350 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
351 Error e; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
352 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
353 return get (ures_getNextResource (handle, null, e), e); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
354 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
355 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
356 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
357 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
358 Returns a resource that has a given key. This procedure |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
359 works only with table resources. |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
360 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
361 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
362 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
363 UResourceBundle getResource (char[] key) |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
364 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
365 Error e; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
366 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
367 return get (ures_getByKey (handle, toString(key), null, e), e); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
368 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
369 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
370 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
371 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
372 Returns the resource at the specified index |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
373 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
374 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
375 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
376 UResourceBundle getResource (uint index) |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
377 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
378 Error e; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
379 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
380 return get (ures_getByIndex (handle, index, null, e), e); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
381 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
382 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
383 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
384 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
385 Return the version number associated with this ResourceBundle |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
386 as a UVersionInfo array |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
387 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
388 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
389 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
390 void getVersion (inout Version info) |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
391 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
392 ures_getVersion (handle, info); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
393 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
394 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
395 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
396 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
397 Return the ULocale associated with this ResourceBundle |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
398 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
399 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
400 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
401 void getLocale (inout ULocale locale) |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
402 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
403 Error e; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
404 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
405 locale.name = toArray (ures_getLocale (handle, e)); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
406 testError (e, "failed to get resource locale"); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
407 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
408 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
409 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
410 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
411 Returns the key associated with this resource. Not all |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
412 the resources have a key - only those that are members |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
413 of a table. |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
414 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
415 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
416 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
417 char[] getKey () |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
418 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
419 return toArray (ures_getKey (handle)); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
420 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
421 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
422 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
423 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
424 Returns the type of a resource. Available types are |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
425 defined in enum UResType |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
426 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
427 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
428 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
429 ResType getType () |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
430 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
431 return cast(ResType) ures_getType (handle); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
432 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
433 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
434 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
435 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
436 Worker function for constructing internal ResourceBundle |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
437 instances. Returns null when the provided handle is null. |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
438 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
439 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
440 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
441 private static final UResourceBundle get (Handle handle, inout Error e) |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
442 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
443 testError (e, "failed to create resource bundle"); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
444 if (handle) |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
445 return new UResourceBundle (handle); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
446 return null; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
447 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
448 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
449 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
450 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
451 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
452 Bind the ICU functions from a shared library. This is |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
453 complicated by the issues regarding D and DLLs on the |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
454 Windows platform |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
455 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
456 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
457 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
458 private static void* library; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
459 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
460 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
461 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
462 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
463 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
464 private static extern (C) |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
465 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
466 Handle function (char*, char*, inout Error) ures_open; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
467 void function (Handle) ures_close; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
468 char* function (Handle, inout Error) ures_getLocale; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
469 void function (Handle, inout Version) ures_getVersion; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
470 uint function (Handle) ures_getSize; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
471 int function (Handle, inout Error) ures_getInt; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
472 wchar* function (Handle, inout uint, inout Error) ures_getString; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
473 wchar* function (Handle, uint, inout uint, inout Error) ures_getStringByIndex; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
474 wchar* function (Handle, char*, inout uint, inout Error) ures_getStringByKey; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
475 void* function (Handle, inout uint, inout Error) ures_getBinary; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
476 int* function (Handle, inout uint, inout Error) ures_getIntVector; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
477 byte function (Handle) ures_hasNext; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
478 void function (Handle) ures_resetIterator; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
479 wchar* function (Handle, inout uint, inout char*, inout Error) ures_getNextString; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
480 char* function (Handle) ures_getKey; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
481 int function (Handle) ures_getType; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
482 Handle function (Handle, Handle, inout Error) ures_getNextResource; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
483 Handle function (Handle, uint, Handle, inout Error) ures_getByIndex; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
484 Handle function (Handle, char*, Handle, inout Error) ures_getByKey; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
485 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
486 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
487 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
488 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
489 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
490 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
491 static FunctionLoader.Bind[] targets = |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
492 [ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
493 {cast(void**) &ures_open, "ures_open"}, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
494 {cast(void**) &ures_close, "ures_close"}, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
495 {cast(void**) &ures_getLocale, "ures_getLocale"}, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
496 {cast(void**) &ures_getVersion, "ures_getVersion"}, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
497 {cast(void**) &ures_getSize, "ures_getSize"}, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
498 {cast(void**) &ures_getInt, "ures_getInt"}, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
499 {cast(void**) &ures_getString, "ures_getString"}, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
500 {cast(void**) &ures_getStringByIndex, "ures_getStringByIndex"}, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
501 {cast(void**) &ures_getStringByKey, "ures_getStringByKey"}, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
502 {cast(void**) &ures_getBinary, "ures_getBinary"}, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
503 {cast(void**) &ures_hasNext, "ures_hasNext"}, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
504 {cast(void**) &ures_resetIterator, "ures_resetIterator"}, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
505 {cast(void**) &ures_getNextString, "ures_getNextString"}, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
506 {cast(void**) &ures_getKey, "ures_getKey"}, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
507 {cast(void**) &ures_getType, "ures_getType"}, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
508 {cast(void**) &ures_getNextResource, "ures_getNextResource"}, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
509 {cast(void**) &ures_getByIndex, "ures_getByIndex"}, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
510 {cast(void**) &ures_getByKey, "ures_getByKey"}, |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
511 ]; |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
512 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
513 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
514 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
515 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
516 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
517 static this () |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
518 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
519 library = FunctionLoader.bind (icuuc, targets); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
520 //test (); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
521 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
522 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
523 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
524 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
525 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
526 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
527 static ~this () |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
528 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
529 FunctionLoader.unbind (library); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
530 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
531 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
532 /*********************************************************************** |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
533 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
534 ***********************************************************************/ |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
535 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
536 static void test() |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
537 { |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
538 UResourceBundle b = new UResourceBundle (ULocale.Default); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
539 UText t = b.getNextString(); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
540 UResourceBundle b1 = b.getNextResource (); |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
541 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
542 } |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
543 |
040da1cb0d76
Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
544 |