annotate dwtx/dwtxhelper/mangoicu/UText.d @ 91:11e8159caf7a

make the mango icu fork work.
author Frank Benoit <benoit@tionex.de>
date Mon, 07 Jul 2008 15:53:07 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1 /*******************************************************************************
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3 @file UString.d
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
5 Copyright (c) 2008 Frank Benoit
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
6
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
7 This software is provided 'as-is', without any express or implied
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
8 warranty. In no event will the authors be held liable for damages
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
9 of any kind arising from the use of this software.
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
10
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
11 Permission is hereby granted to anyone to use this software for any
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
12 purpose, including commercial applications, and to alter it and/or
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
13 redistribute it freely, subject to the following restrictions:
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
14
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
15 1. The origin of this software must not be misrepresented; you must
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
16 not claim that you wrote the original software. If you use this
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
17 software in a product, an acknowledgment within documentation of
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
18 said product would be appreciated but is not required.
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
19
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
20 2. Altered source versions must be plainly marked as such, and must
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
21 not be misrepresented as being the original software.
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
22
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
23 3. This notice may not be removed or altered from any distribution
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
24 of the source.
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
25
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
26 4. Derivative works are permitted, but they must carry this notice
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
27 in full and credit the original source.
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
28
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
29
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
30 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
31
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
32
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
33 @version Initial version, July 2008
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
34 @author Frank
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
35
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
36 Note that this package and documentation is built around the ICU
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
37 project (http://oss.software.ibm.com/icu/). Below is the license
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
38 statement as specified by that software:
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
39
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
40
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
41 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
42
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
43
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
44 ICU License - ICU 1.8.1 and later
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
45
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
46 COPYRIGHT AND PERMISSION NOTICE
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
47
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
48 Copyright (c) 1995-2003 International Business Machines Corporation and
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
49 others.
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
50
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
51 All rights reserved.
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
52
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
53 Permission is hereby granted, free of charge, to any person obtaining a
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
54 copy of this software and associated documentation files (the
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
55 "Software"), to deal in the Software without restriction, including
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
56 without limitation the rights to use, copy, modify, merge, publish,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
57 distribute, and/or sell copies of the Software, and to permit persons
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
58 to whom the Software is furnished to do so, provided that the above
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
59 copyright notice(s) and this permission notice appear in all copies of
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
60 the Software and that both the above copyright notice(s) and this
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
61 permission notice appear in supporting documentation.
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
62
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
63 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
64 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
65 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
66 OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
67 HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
68 INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
69 FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
70 NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
71 WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
72
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
73 Except as contained in this notice, the name of a copyright holder
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
74 shall not be used in advertising or otherwise to promote the sale, use
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
75 or other dealings in this Software without prior written authorization
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
76 of the copyright holder.
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
77
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
78 ----------------------------------------------------------------------
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
79
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
80 All trademarks and registered trademarks mentioned herein are the
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
81 property of their respective owners.
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
82
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
83 *******************************************************************************/
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
84 module dwtx.dwtxhelper.mangoicu.UText;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
85
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
86 import dwtx.dwtxhelper.mangoicu.ICU;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
87
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
88 struct UText {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
89 // UText private fields -- start
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
90 private {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
91 uint magic = UTEXT_MAGIC;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
92 int flags = 0;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
93 int providerProperties = 0;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
94 int sizeOfStruct = UText.sizeof;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
95 long chunkNativeLimit = 0;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
96 int extraSize = 0;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
97 int nativeIndexingLimit = 0;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
98 long chunkNativeStart = 0;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
99 int chunkOffset = 0;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
100 int chunkLength = 0;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
101 wchar* chunkContents = null;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
102 void* pFuncs = null;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
103 void* pExtra = null;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
104 void* context = null;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
105 void* p = null;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
106 void* q = null;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
107 void* r = null;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
108 void* privP = null;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
109 long a = 0;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
110 int b = 0;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
111 int c = 0;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
112 long privA = 0;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
113 int privB = 0;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
114 int privC = 0;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
115 } // UText private fields -- end
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
116 // do not add any non-static fields
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
117
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
118 private enum {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
119 UTEXT_MAGIC = 0x345ad82c
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
120 }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
121 void close(){
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
122 utext_close(this);
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
123 }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
124 private void ensureStatusOk( ICU.UErrorCode status ){
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
125 if( status !is ICU.UErrorCode.OK ){
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
126 throw new Exception( "ICU Exception" );
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
127 }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
128 }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
129 void openUTF8( char[] str ){
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
130 auto status = ICU.UErrorCode.OK;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
131 utext_openUTF8(this, str.ptr, str.length, status );
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
132 ensureStatusOk( status );
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
133 }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
134
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
135
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
136 /***********************************************************************
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
137
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
138 Bind the ICU functions from a shared library. This is
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
139 complicated by the issues regarding D and DLLs on the
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
140 Windows platform
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
141
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
142 ***********************************************************************/
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
143
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
144 private static void* library;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
145
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
146 /***********************************************************************
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
147
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
148 ***********************************************************************/
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
149 static extern(System){
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
150 UText * function(UText* ut) utext_close;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
151 UText * function(UText* ut, char *s, long length, inout ICU.UErrorCode status) utext_openUTF8;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
152 // UText * function(UText* ut, UChar *s, int64_t length, inout UErrorCode status) utext_openUChars;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
153 // UText * function(UText* ut, U_NAMESPACE_QUALIFIER UnicodeString *s, inout UErrorCode status) utext_openUnicodeString;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
154 // UText * function(UText* ut, U_NAMESPACE_QUALIFIER UnicodeString *s, inout UErrorCode status) utext_openConstUnicodeString;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
155 // UText * function(UText* ut, U_NAMESPACE_QUALIFIER Replaceable *rep, inout UErrorCode status) utext_openReplaceable;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
156 // UText * function(UText* ut, U_NAMESPACE_QUALIFIER CharacterIterator *ic, inout UErrorCode status) utext_openCharacterIterator;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
157 // UText * function(UText* ut, UText *src, UBool deep, UBool readOnly, inout UErrorCode status) utext_clone;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
158 // UBool function(const UText *a, const UText *b) utext_equals;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
159 // int64_t function(UText* ut) utext_nativeLength;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
160 // UBool function(UText* ut) utext_isLengthExpensive;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
161 // UChar32 function(UText* ut, int64_t nativeIndex) utext_char32At;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
162 // UChar32 function(UText* ut) utext_current32;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
163 // UChar32 function(UText* ut) utext_next32;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
164 // UChar32 function(UText* ut) utext_previous32;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
165 // UChar32 function(UText* ut, int64_t nativeIndex) utext_next32From;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
166 // UChar32 function(UText* ut, int64_t nativeIndex) utext_previous32From;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
167 // int64_t function(UText* ut) utext_getNativeIndex;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
168 // void function(UText* ut, int64_t nativeIndex) utext_setNativeIndex;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
169 // UBool function(UText* ut, int delta) utext_moveIndex32;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
170 // int64_t function(UText* ut) utext_getPreviousNativeIndex;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
171 // int function(UText* ut, int64_t nativeStart, int64_t nativeLimit,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
172 // UChar *dest, int destCapacity,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
173 // inout UErrorCode status) utext_extract;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
174 // UBool function(UText* ut) utext_isWritable;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
175 // UBool function(UText* ut) utext_hasMetaData;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
176 // int function(UText* ut,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
177 // int64_t nativeStart, int64_t nativeLimit,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
178 // UChar *replacementText, int replacementLength,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
179 // inout UErrorCode status) utext_replace;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
180 // void function(UText* ut,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
181 // int64_t nativeStart, int64_t nativeLimit,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
182 // int64_t destIndex,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
183 // UBool move,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
184 // inout UErrorCode status) utext_copy;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
185 // void function(UText* ut) utext_freeze;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
186 // UText * function(UText* ut, int extraSpace, inout UErrorCode status) utext_setup;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
187 }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
188
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
189 /***********************************************************************
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
190
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
191 ***********************************************************************/
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
192 static FunctionLoader.Bind[] targets = [
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
193 {cast(void**) &utext_close, "utext_close"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
194 {cast(void**) &utext_openUTF8, "utext_openUTF8"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
195 // {cast(void**) &utext_openUChars, "utext_openUChars"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
196 // {cast(void**) &utext_openUnicodeString, "utext_openUnicodeString"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
197 // {cast(void**) &utext_openConstUnicodeString, "utext_openConstUnicodeString"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
198 // {cast(void**) &utext_openReplaceable, "utext_openReplaceable"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
199 // {cast(void**) &utext_openCharacterIterator, "utext_openCharacterIterator"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
200 // {cast(void**) &utext_clone, "utext_clone"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
201 // {cast(void**) &utext_equals, "utext_equals"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
202 // {cast(void**) &utext_nativeLength, "utext_nativeLength"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
203 // {cast(void**) &utext_isLengthExpensive, "utext_isLengthExpensive"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
204 // {cast(void**) &utext_char32At, "utext_char32At"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
205 // {cast(void**) &utext_current32, "utext_current32"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
206 // {cast(void**) &utext_next32, "utext_next32"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
207 // {cast(void**) &utext_next32From, "utext_next32From"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
208 // {cast(void**) &utext_previous32, "utext_previous32"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
209 // {cast(void**) &utext_previous32From, "utext_previous32From"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
210 // {cast(void**) &utext_setNativeIndex, "utext_setNativeIndex"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
211 // {cast(void**) &utext_moveIndex32, "utext_moveIndex32"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
212 // {cast(void**) &utext_getPreviousNativeIndex, "utext_getPreviousNativeIndex"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
213 // {cast(void**) &utext_extract, "utext_extract"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
214 // {cast(void**) &utext_isWritable, "utext_isWritable"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
215 // {cast(void**) &utext_hasMetaData, "utext_hasMetaData"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
216 // {cast(void**) &utext_replace, "utext_replace"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
217 // {cast(void**) &utext_copy, "utext_copy"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
218 // {cast(void**) &utext_freeze, "utext_freeze"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
219 // {cast(void**) &utext_setup, "utext_setup"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
220 ];
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
221
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
222 /***********************************************************************
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
223
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
224 ***********************************************************************/
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
225
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
226 static this ()
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
227 {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
228 library = FunctionLoader.bind (ICU.icuuc, targets);
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
229 //test ();
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
230 }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
231
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
232 /***********************************************************************
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
233
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
234 ***********************************************************************/
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
235
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
236 static ~this ()
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
237 {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
238 FunctionLoader.unbind (library);
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
239 }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
240
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
241 }