annotate dwtx/dwtxhelper/mangoicu/UBreakIterator.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 040da1cb0d76
children f05207c07a98
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 UBreakIterator.d
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
4
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
5 Copyright (c) 2004 Kris Bell
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
6
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
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.
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
10
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
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: 89
diff changeset
12 purpose, including commercial applications, and to alter it and/or
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
13 redistribute it freely, subject to the following restrictions:
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
14
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
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: 89
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: 89
diff changeset
17 software in a product, an acknowledgment within documentation of
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
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
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
20 2. Altered source versions must be plainly marked as such, and must
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
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
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
33 @version Initial version, November 2004
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
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
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
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: 89
diff changeset
37 project (http://oss.software.ibm.com/icu/). Below is the license
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
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
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
48 Copyright (c) 1995-2003 International Business Machines Corporation and
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
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
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
80 All trademarks and registered trademarks mentioned herein are the
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
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
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
85 module dwtx.dwtxhelper.mangoicu.UBreakIterator;
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
86
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
87 private import dwtx.dwtxhelper.mangoicu.ICU;
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
88
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
89 public import dwtx.dwtxhelper.mangoicu.ULocale,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
90 dwtx.dwtxhelper.mangoicu.UText,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
91 dwtx.dwtxhelper.mangoicu.UString;
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
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
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
95 // /*******************************************************************************
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
96 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
97 // *******************************************************************************/
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
98 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
99 // class UCharacterIterator : UBreakIterator
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
100 // {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
101 // /***********************************************************************
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
102 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
103 // ***********************************************************************/
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
104 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
105 // this (inout ULocale locale, UStringView text = null)
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
106 // {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
107 // super (Type.Character, locale, text);
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
108 // }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
109 // }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
110 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
111 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
112 // /*******************************************************************************
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
113 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
114 // *******************************************************************************/
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
115 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
116 // class UWordIterator : UBreakIterator
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
117 // {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
118 // public enum Break
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
119 // {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
120 // None = 0,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
121 // NoneLimit = 100,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
122 // Number = 100,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
123 // NumberLimit = 200,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
124 // Letter = 200,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
125 // LetterLimit = 300,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
126 // Kana = 300,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
127 // KanaLimit = 400,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
128 // Ideo = 400,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
129 // IdeoLimit = 500
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
130 // }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
131 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
132 // /***********************************************************************
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
133 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
134 // ***********************************************************************/
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
135 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
136 // this (inout ULocale locale, UStringView text = null)
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
137 // {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
138 // super (Type.Word, locale, text);
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
139 // }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
140 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
141 // /***********************************************************************
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
142 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
143 // Return the status from the break rule that determined
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
144 // the most recently returned break position.
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
145 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
146 // ***********************************************************************/
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
147 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
148 // void getStatus (inout Break b)
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
149 // {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
150 // b = cast(Break) super.getStatus();
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
151 // }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
152 // }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
153 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
154 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
155 // /*******************************************************************************
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
156 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
157 // *******************************************************************************/
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
158 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
159 // class ULineIterator : UBreakIterator
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
160 // {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
161 // public enum Break
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
162 // {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
163 // Soft = 0,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
164 // SoftLimit = 100,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
165 // Hard = 100,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
166 // HardLimit = 200
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
167 // }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
168 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
169 // /***********************************************************************
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
170 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
171 // ***********************************************************************/
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
172 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
173 // this (inout ULocale locale, UStringView text = null)
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
174 // {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
175 // super (Type.Line, locale, text);
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
176 // }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
177 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
178 // /***********************************************************************
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
179 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
180 // Return the status from the break rule that determined
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
181 // the most recently returned break position.
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
182 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
183 // ***********************************************************************/
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
184 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
185 // void getStatus (inout Break b)
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
186 // {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
187 // b = cast(Break) super.getStatus();
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
188 // }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
189 // }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
190 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
191 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
192 // /*******************************************************************************
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
193 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
194 // *******************************************************************************/
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
195 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
196 // class USentenceIterator : UBreakIterator
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
197 // {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
198 // public enum Break
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
199 // {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
200 // Term = 0,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
201 // TermLimit = 100,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
202 // Sep = 100,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
203 // Limit = 200
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
204 // }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
205 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
206 // /***********************************************************************
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
207 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
208 // ***********************************************************************/
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
209 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
210 // this (inout ULocale locale, UStringView text = null)
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
211 // {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
212 // super (Type.Sentence, locale, text);
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
213 // }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
214 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
215 // /***********************************************************************
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
216 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
217 // Return the status from the break rule that determined
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
218 // the most recently returned break position.
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
219 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
220 // ***********************************************************************/
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
221 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
222 // void getStatus (inout Break b)
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
223 // {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
224 // b = cast(Break) super.getStatus();
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
225 // }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
226 // }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
227 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
228 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
229 // /*******************************************************************************
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
230 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
231 // *******************************************************************************/
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
232 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
233 // class UTitleIterator : UBreakIterator
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
234 // {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
235 // /***********************************************************************
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
236 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
237 // ***********************************************************************/
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
238 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
239 // this (inout ULocale locale, UStringView text = null)
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
240 // {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
241 // super (Type.Title, locale, text);
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
242 // }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
243 // }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
244 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
245 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
246 // /*******************************************************************************
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
247 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
248 // *******************************************************************************/
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
249 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
250 // class URuleIterator : UBreakIterator
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
251 // {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
252 // /***********************************************************************
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
253 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
254 // Open a new UBreakIterator for locating text boundaries
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
255 // using specified breaking rules
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
256 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
257 // ***********************************************************************/
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
258 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
259 // this (UStringView rules, UStringView text = null)
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
260 // {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
261 // UErrorCode e;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
262 //
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
263 // handle = ubrk_openRules (rules.get.ptr, rules.length, text.get.ptr, text.length, null, e);
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
264 // testError (e, "failed to open rule iterator");
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
265 // }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
266 // }
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
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 /*******************************************************************************
040da1cb0d76 Add a local copy of 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
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
271 BreakIterator defines methods for finding the location of boundaries
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
272 in text. Pointer to a UBreakIterator maintain a current position and
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
273 scan over text returning the index of characters where boundaries occur.
040da1cb0d76 Add a local copy of 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
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
275 Line boundary analysis determines where a text string can be broken
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
276 when line-wrapping. The mechanism correctly handles punctuation and
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
277 hyphenated words.
040da1cb0d76 Add a local copy of 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
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
279 Sentence boundary analysis allows selection with correct interpretation
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
280 of periods within numbers and abbreviations, and trailing punctuation
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
281 marks such as quotation marks and parentheses.
040da1cb0d76 Add a local copy of 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
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
283 Word boundary analysis is used by search and replace functions, as well
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
284 as within text editing applications that allow the user to select words
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
285 with a double click. Word selection provides correct interpretation of
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
286 punctuation marks within and following words. Characters that are not
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
287 part of a word, such as symbols or punctuation marks, have word-breaks
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
288 on both sides.
040da1cb0d76 Add a local copy of 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
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
290 Character boundary analysis allows users to interact with characters
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
291 as they expect to, for example, when moving the cursor through a text
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
292 string. Character boundary analysis provides correct navigation of
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
293 through character strings, regardless of how the character is stored.
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
294 For example, an accented character might be stored as a base character
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
295 and a diacritical mark. What users consider to be a character can differ
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
296 between languages.
040da1cb0d76 Add a local copy of 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
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
298 Title boundary analysis locates all positions, typically starts of
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
299 words, that should be set to Title Case when title casing the text.
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
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 See <A HREF="http://oss.software.ibm.com/icu/apiref/ubrk_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
302 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
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 *******************************************************************************/
040da1cb0d76 Add a local copy of 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
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
306 struct UBreakIterator
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
307 {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
308 typedef void _UBreakIterator;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
309 alias _UBreakIterator* Handle;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
310 Handle handle;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
311 UText ut;
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
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 // this is returned by next(), previous() etc ...
040da1cb0d76 Add a local copy of 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 const uint Done = uint.max;
040da1cb0d76 Add a local copy of 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
040da1cb0d76 Add a local copy of 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 /***********************************************************************
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
317
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
318 internal types passed to C API
040da1cb0d76 Add a local copy of 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 ***********************************************************************/
040da1cb0d76 Add a local copy of 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
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
322 private enum Type
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
323 {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
324 Character,
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
325 Word,
040da1cb0d76 Add a local copy of 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 Line,
040da1cb0d76 Add a local copy of 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 Sentence,
040da1cb0d76 Add a local copy of 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 Title
040da1cb0d76 Add a local copy of 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
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
332 public enum WordBreak
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
333 {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
334 None = 0,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
335 NoneLimit = 100,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
336 Number = 100,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
337 NumberLimit = 200,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
338 Letter = 200,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
339 LetterLimit = 300,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
340 Kana = 300,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
341 KanaLimit = 400,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
342 Ideo = 400,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
343 IdeoLimit = 500
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
344 }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
345 public enum LineBreak
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
346 {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
347 Soft = 0,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
348 SoftLimit = 100,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
349 Hard = 100,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
350 HardLimit = 200
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
351 }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
352 public enum SentenceBreak
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
353 {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
354 Term = 0,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
355 TermLimit = 100,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
356 Sep = 100,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
357 Limit = 200
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
358 }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
359
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
360
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
361 /***********************************************************************
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
362
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
363 Open a new UBreakIterator for locating text boundaries for
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
364 a specified locale. A UBreakIterator may be used for detecting
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
365 character, line, word, and sentence breaks in text.
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
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 ***********************************************************************/
040da1cb0d76 Add a local copy of 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
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
369 static UBreakIterator openWordIterator( ULocale locale, char[] str ){
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
370 UBreakIterator res;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
371 res.ut.openUTF8(str);
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
372 auto e = ICU.UErrorCode.OK;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
373 res.handle = ubrk_open( Type.Word, locale.name.ptr, null, 0, e);
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
374 ICU.testError (e, "failed to open word iterator");
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
375 ubrk_setUText( res.handle, & res.ut, e);
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
376 ICU.testError (e, "failed to set text in iterator");
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
377 return res;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
378 }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
379
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
380 static UBreakIterator openLineIterator( ULocale locale, char[] str ){
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
381 UBreakIterator res;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
382 res.ut.openUTF8(str);
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
383 auto e = ICU.UErrorCode.OK;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
384 res.handle = ubrk_open( Type.Line, locale.name.ptr, null, 0, e);
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
385 ICU.testError (e, "failed to open line iterator");
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
386 ubrk_setUText( res.handle, & res.ut, e);
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
387 ICU.testError (e, "failed to set text in iterator");
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
388 return res;
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
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
040da1cb0d76 Add a local copy of 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
040da1cb0d76 Add a local copy of 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 Close a UBreakIterator
040da1cb0d76 Add a local copy of 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
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
397 void close ()
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
398 {
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
399 ut.close();
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
400 ubrk_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
401 }
040da1cb0d76 Add a local copy of 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 /***********************************************************************
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
404
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
405 Sets an existing iterator to point to a new piece of text
040da1cb0d76 Add a local copy of 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
040da1cb0d76 Add a local copy of 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
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
409 void setText (UStringView text)
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
410 {
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
411 ICU.UErrorCode e;
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
412 ubrk_setText (handle, text.get.ptr, text.length, e);
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
413 ICU.testError (e, "failed to set iterator text");
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
414 }
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
415
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
416 void setText (char[] text)
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
417 {
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
418 auto e = ICU.UErrorCode.OK;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
419 ut.openUTF8(text);
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
420 ubrk_setUText( handle, & ut, e);
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
421 ICU.testError (e, "failed to set text in iterator");
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
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 /***********************************************************************
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
425
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
426 Determine the most recently-returned text boundary
040da1cb0d76 Add a local copy of 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
040da1cb0d76 Add a local copy of 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 uint current ()
040da1cb0d76 Add a local copy of 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 {
040da1cb0d76 Add a local copy of 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 return ubrk_current (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
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 /***********************************************************************
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
436
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
437 Determine the text boundary following the current text
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
438 boundary, or UBRK_DONE if all text boundaries have been
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
439 returned.
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
440
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
441 If offset is specified, determines the text boundary
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
442 following the current text boundary: The value returned
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
443 is always greater than offset, or Done
040da1cb0d76 Add a local copy of 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
040da1cb0d76 Add a local copy of 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 ***********************************************************************/
040da1cb0d76 Add a local copy of 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
040da1cb0d76 Add a local copy of 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 uint next (uint offset = uint.max)
040da1cb0d76 Add a local copy of 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 if (offset == uint.max)
040da1cb0d76 Add a local copy of 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 return ubrk_next (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
451 return ubrk_following (handle, offset);
040da1cb0d76 Add a local copy of 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 }
040da1cb0d76 Add a local copy of 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
040da1cb0d76 Add a local copy of 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 /***********************************************************************
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
455
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
456 Determine the text boundary preceding the current text
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
457 boundary, or Done if all text boundaries have been returned.
040da1cb0d76 Add a local copy of 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
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
459 If offset is specified, determines the text boundary preceding
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
460 the specified offset. The value returned is always smaller than
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
461 offset, or Done.
040da1cb0d76 Add a local copy of 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
040da1cb0d76 Add a local copy of 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 uint previous (uint offset = uint.max)
040da1cb0d76 Add a local copy of 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 {
040da1cb0d76 Add a local copy of 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 if (offset == uint.max)
040da1cb0d76 Add a local copy of 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 return ubrk_previous (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
469 return ubrk_preceding (handle, offset);
040da1cb0d76 Add a local copy of 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 }
040da1cb0d76 Add a local copy of 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
040da1cb0d76 Add a local copy of 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 /***********************************************************************
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
473
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
474 Determine the index of the first character in the text
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
475 being scanned. This is not always the same as index 0
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
476 of the text.
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
477
040da1cb0d76 Add a local copy of 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 ***********************************************************************/
040da1cb0d76 Add a local copy of 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
040da1cb0d76 Add a local copy of 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 uint first ()
040da1cb0d76 Add a local copy of 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 {
040da1cb0d76 Add a local copy of 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 return ubrk_first (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
483 }
040da1cb0d76 Add a local copy of 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
040da1cb0d76 Add a local copy of 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 /***********************************************************************
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
486
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
487 Determine the index immediately beyond the last character
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
488 in the text being scanned. This is not the same as the last
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
489 character
040da1cb0d76 Add a local copy of 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 ***********************************************************************/
040da1cb0d76 Add a local copy of 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 uint last ()
040da1cb0d76 Add a local copy of 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 {
040da1cb0d76 Add a local copy of 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 return ubrk_last (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
496 }
040da1cb0d76 Add a local copy of 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
040da1cb0d76 Add a local copy of 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 /***********************************************************************
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
499
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
500 Returns true if the specfied position is a boundary position.
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
501 As a side effect, leaves the iterator pointing to the first
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
502 boundary position at or after "offset".
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
503
040da1cb0d76 Add a local copy of 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 ***********************************************************************/
040da1cb0d76 Add a local copy of 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
040da1cb0d76 Add a local copy of 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 bool isBoundary (uint offset)
040da1cb0d76 Add a local copy of 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 {
040da1cb0d76 Add a local copy of 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 return ubrk_isBoundary (handle, offset) != 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
509 }
040da1cb0d76 Add a local copy of 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
040da1cb0d76 Add a local copy of 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 /***********************************************************************
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
512
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
513 Return the status from the break rule that determined
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
514 the most recently returned break position.
040da1cb0d76 Add a local copy of 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
040da1cb0d76 Add a local copy of 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 void getStatus (inout uint s)
040da1cb0d76 Add a local copy of 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 {
040da1cb0d76 Add a local copy of 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 s = getStatus ();
040da1cb0d76 Add a local copy of 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 /***********************************************************************
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
524
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
525 Return the status from the break rule that determined
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
526 the most recently returned break position.
040da1cb0d76 Add a local copy of 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
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
528 The values appear in the rule source within brackets,
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
529 {123}, for example. For rules that do not specify a status,
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
530 a default value of 0 is returned.
040da1cb0d76 Add a local copy of 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
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
532 For word break iterators, the possible values are defined
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
533 in enum UWordBreak
040da1cb0d76 Add a local copy of 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
040da1cb0d76 Add a local copy of 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 private uint getStatus ()
040da1cb0d76 Add a local copy of 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 {
040da1cb0d76 Add a local copy of 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 return ubrk_getRuleStatus (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
540 }
040da1cb0d76 Add a local copy of 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 /***********************************************************************
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
544
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
545 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
546 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
547 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
548
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
549 ***********************************************************************/
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
550
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
551 private static void* library;
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
552
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
553 /***********************************************************************
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
554
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
555 ***********************************************************************/
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
556
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
557 private static extern (C)
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
558 {
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
559 Handle function (uint, char*, wchar*, uint, inout ICU.UErrorCode) ubrk_open;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
560 Handle function (wchar*, uint, wchar*, uint, void*, inout ICU.UErrorCode) ubrk_openRules;
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
561 void function (Handle) ubrk_close;
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
562 void function (Handle, wchar*, uint, inout ICU.UErrorCode) ubrk_setText;
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
563 uint function (Handle) ubrk_current;
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
564 uint function (Handle) ubrk_next;
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
565 uint function (Handle) ubrk_previous;
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
566 uint function (Handle) ubrk_first;
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
567 uint function (Handle) ubrk_last;
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
568 uint function (Handle, uint) ubrk_preceding;
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
569 uint function (Handle, uint) ubrk_following;
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
570 byte function (Handle, uint) ubrk_isBoundary;
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
571 uint function (Handle) ubrk_getRuleStatus;
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
572 Handle function (Handle, void *, int *, inout ICU.UErrorCode) ubrk_safeClone;
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
573 void function (Handle, UText*, inout ICU.UErrorCode) ubrk_setUText;
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
574 }
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
575
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
576 /***********************************************************************
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
577
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
578 ***********************************************************************/
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
579
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
580 static FunctionLoader.Bind[] targets =
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
581 [
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
582 {cast(void**) &ubrk_open, "ubrk_open"},
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
583 {cast(void**) &ubrk_close, "ubrk_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
584 {cast(void**) &ubrk_openRules, "ubrk_openRules"},
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
585 {cast(void**) &ubrk_setText, "ubrk_setText"},
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
586 {cast(void**) &ubrk_current, "ubrk_current"},
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
587 {cast(void**) &ubrk_next, "ubrk_next"},
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
588 {cast(void**) &ubrk_previous, "ubrk_previous"},
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
589 {cast(void**) &ubrk_first, "ubrk_first"},
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
590 {cast(void**) &ubrk_last, "ubrk_last"},
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
591 {cast(void**) &ubrk_preceding, "ubrk_preceding"},
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
592 {cast(void**) &ubrk_following, "ubrk_following"},
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
593 {cast(void**) &ubrk_isBoundary, "ubrk_isBoundary"},
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
594 {cast(void**) &ubrk_getRuleStatus, "ubrk_getRuleStatus"},
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
595 {cast(void**) &ubrk_setUText, "ubrk_setUText"},
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
596 {cast(void**) &ubrk_safeClone, "ubrk_safeClone"},
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
597 ];
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
598
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
599 /**********************************************************************
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
600
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
601 **********************************************************************/
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
602
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
603 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
604 {
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
605 library = FunctionLoader.bind (ICU.icuuc, targets);
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
606 }
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
607
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
608 /**********************************************************************
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
609
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
610 **********************************************************************/
91
11e8159caf7a make the mango icu fork work.
Frank Benoit <benoit@tionex.de>
parents: 89
diff changeset
611
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
612 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
613 {
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
614 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
615 }
040da1cb0d76 Add a local copy of the mango ICU binding to work out the utf8 usability. Will hopefully go back into mango.
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
616 }