00001 /******************************************************************************* 00002 00003 @file UCollator.d 00004 00005 Copyright (c) 2004 Kris Bell 00006 00007 This software is provided 'as-is', without any express or implied 00008 warranty. In no event will the authors be held liable for damages 00009 of any kind arising from the use of this software. 00010 00011 Permission is hereby granted to anyone to use this software for any 00012 purpose, including commercial applications, and to alter it and/or 00013 redistribute it freely, subject to the following restrictions: 00014 00015 1. The origin of this software must not be misrepresented; you must 00016 not claim that you wrote the original software. If you use this 00017 software in a product, an acknowledgment within documentation of 00018 said product would be appreciated but is not required. 00019 00020 2. Altered source versions must be plainly marked as such, and must 00021 not be misrepresented as being the original software. 00022 00023 3. This notice may not be removed or altered from any distribution 00024 of the source. 00025 00026 4. Derivative works are permitted, but they must carry this notice 00027 in full and credit the original source. 00028 00029 00030 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00031 00032 00033 @version Initial version, November 2004 00034 @author Kris 00035 00036 Note that this package and documentation is built around the ICU 00037 project (http://oss.software.ibm.com/icu/). Below is the license 00038 statement as specified by that software: 00039 00040 00041 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00042 00043 00044 ICU License - ICU 1.8.1 and later 00045 00046 COPYRIGHT AND PERMISSION NOTICE 00047 00048 Copyright (c) 1995-2003 International Business Machines Corporation and 00049 others. 00050 00051 All rights reserved. 00052 00053 Permission is hereby granted, free of charge, to any person obtaining a 00054 copy of this software and associated documentation files (the 00055 "Software"), to deal in the Software without restriction, including 00056 without limitation the rights to use, copy, modify, merge, publish, 00057 distribute, and/or sell copies of the Software, and to permit persons 00058 to whom the Software is furnished to do so, provided that the above 00059 copyright notice(s) and this permission notice appear in all copies of 00060 the Software and that both the above copyright notice(s) and this 00061 permission notice appear in supporting documentation. 00062 00063 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00064 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00065 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 00066 OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 00067 HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL 00068 INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING 00069 FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 00070 NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 00071 WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 00072 00073 Except as contained in this notice, the name of a copyright holder 00074 shall not be used in advertising or otherwise to promote the sale, use 00075 or other dealings in this Software without prior written authorization 00076 of the copyright holder. 00077 00078 ---------------------------------------------------------------------- 00079 00080 All trademarks and registered trademarks mentioned herein are the 00081 property of their respective owners. 00082 00083 *******************************************************************************/ 00084 00085 module mango.icu.UCollator; 00086 00087 private import mango.icu.ICU, 00088 mango.icu.USet, 00089 mango.icu.ULocale, 00090 mango.icu.UString; 00091 00092 /******************************************************************************* 00093 00094 The API for Collator performs locale-sensitive string comparison. 00095 You use this service to build searching and sorting routines for 00096 natural language text. Important: The ICU collation service has been 00097 reimplemented in order to achieve better performance and UCA compliance. 00098 For details, see the collation design document. 00099 00100 For more information about the collation service see the users guide. 00101 00102 Collation service provides correct sorting orders for most locales 00103 supported in ICU. If specific data for a locale is not available, 00104 the orders eventually falls back to the UCA sort order. 00105 00106 Sort ordering may be customized by providing your own set of rules. 00107 For more on this subject see the Collation customization section of 00108 the users guide. 00109 00110 See <A HREF="http://oss.software.ibm.com/icu/apiref/ucol_8h.html"> 00111 this page</A> for full details. 00112 00113 *******************************************************************************/ 00114 00115 class UCollator : ICU 00116 { 00117 package Handle handle; 00118 00119 typedef void* UParseError; 00120 00121 enum Attribute 00122 { 00123 FrenchCollation, 00124 AlternateHandling, 00125 CaseFirst, 00126 CaseLevel, 00127 NormalizationMode, 00128 DecompositionMode = NormalizationMode, 00129 strength, 00130 HiraganaQuaternaryMode, 00131 NumericCollation, 00132 AttributeCount 00133 } 00134 00135 enum AttributeValue 00136 { 00137 Default = -1, 00138 Primary = 0, 00139 Secondary = 1, 00140 Tertiary = 2, 00141 DefaultStrength = Tertiary, 00142 CeStrengthLimit, 00143 Quaternary = 3, 00144 Identical = 15, 00145 strengthLimit, 00146 Off = 16, 00147 On = 17, 00148 Shifted = 20, 00149 NonIgnorable = 21, 00150 LowerFirst = 24, 00151 UpperFirst = 25, 00152 AttributeValueCount 00153 } 00154 00155 enum RuleOption 00156 { 00157 TailoringOnly, 00158 FullRules 00159 } 00160 00161 enum BoundMode 00162 { 00163 BoundLower = 0, 00164 BoundUpper = 1, 00165 BoundUpperLong = 2, 00166 BoundValueCount 00167 } 00168 00169 typedef AttributeValue Strength; 00170 00171 /*********************************************************************** 00172 00173 Open a UCollator for comparing strings. The locale specified 00174 determines the required collation rules. Special values for 00175 locales can be passed in - if ULocale.Default is passed for 00176 the locale, the default locale collation rules will be used. 00177 If ULocale.Root is passed, UCA rules will be used 00178 00179 ***********************************************************************/ 00180 00181 this (ULocale locale) 00182 { 00183 Error e; 00184 00185 handle = ucol_open (toString(locale.name), e); 00186 testError (e, "failed to open collator"); 00187 } 00188 00189 /*********************************************************************** 00190 00191 Produce a UCollator instance according to the rules supplied. 00192 00193 The rules are used to change the default ordering, defined in 00194 the UCA in a process called tailoring. For the syntax of the 00195 rules please see users guide 00196 00197 ***********************************************************************/ 00198 00199 this (UText rules, AttributeValue mode, Strength strength) 00200 { 00201 Error e; 00202 00203 handle = ucol_openRules (rules.get, rules.len, mode, strength, null, e); 00204 testError (e, "failed to open rules-based collator"); 00205 } 00206 00207 /*********************************************************************** 00208 00209 Open a collator defined by a short form string. The 00210 structure and the syntax of the string is defined in 00211 the "Naming collators" section of the users guide: 00212 http://oss.software.ibm.com/icu/userguide/Collate_Concepts.html#Naming_Collators 00213 Attributes are overriden by the subsequent attributes. 00214 So, for "S2_S3", final strength will be 3. 3066bis 00215 locale overrides individual locale parts. 00216 00217 The call to this constructor is equivalent to a plain 00218 constructor, followed by a series of calls to setAttribute 00219 and setVariableTop 00220 00221 ***********************************************************************/ 00222 00223 this (char[] shortName, bool forceDefaults) 00224 { 00225 Error e; 00226 00227 handle = ucol_openFromShortString (toString(shortName), forceDefaults, null, e); 00228 testError (e, "failed to open short-name collator"); 00229 } 00230 00231 /*********************************************************************** 00232 00233 Internal constructor invoked via USearch 00234 00235 ***********************************************************************/ 00236 00237 package this (Handle handle) 00238 { 00239 this.handle = handle; 00240 } 00241 00242 /*********************************************************************** 00243 00244 Close a UCollator 00245 00246 ***********************************************************************/ 00247 00248 ~this () 00249 { 00250 ucol_close (handle); 00251 } 00252 00253 /*********************************************************************** 00254 00255 Get a set containing the contractions defined by the 00256 collator. 00257 00258 The set includes both the UCA contractions and the 00259 contractions defined by the collator. This set will 00260 contain only strings. If a tailoring explicitly 00261 suppresses contractions from the UCA (like Russian), 00262 removed contractions will not be in the resulting set. 00263 00264 ***********************************************************************/ 00265 00266 void getContractions (USet set) 00267 { 00268 Error e; 00269 00270 ucol_getContractions (handle, set.handle, e); 00271 testError (e, "failed to get collator contractions"); 00272 } 00273 00274 /*********************************************************************** 00275 00276 Compare two strings. Return value is -, 0, + 00277 00278 ***********************************************************************/ 00279 00280 int strcoll (UText source, UText target) 00281 { 00282 return ucol_strcoll (handle, source.get, source.len, target.get, target.len); 00283 } 00284 00285 /*********************************************************************** 00286 00287 Determine if one string is greater than another. This 00288 function is equivalent to strcoll() > 1 00289 00290 ***********************************************************************/ 00291 00292 bool greater (UText source, UText target) 00293 { 00294 return cast(bool) (ucol_greater (handle, source.get, source.len, target.get, target.len) != 0); 00295 } 00296 00297 /*********************************************************************** 00298 00299 Determine if one string is greater than or equal to 00300 another. This function is equivalent to strcoll() >= 0 00301 00302 ***********************************************************************/ 00303 00304 bool greaterOrEqual (UText source, UText target) 00305 { 00306 return cast(bool) (ucol_greaterOrEqual (handle, source.get, source.len, target.get, target.len) != 0); 00307 } 00308 00309 /*********************************************************************** 00310 00311 This function is equivalent to strcoll() == 0 00312 00313 ***********************************************************************/ 00314 00315 bool equal (UText source, UText target) 00316 { 00317 return cast(bool) (ucol_equal (handle, source.get, source.len, target.get, target.len) != 0); 00318 } 00319 00320 /*********************************************************************** 00321 00322 Get the collation strength used in a UCollator. The 00323 strength influences how strings are compared. 00324 00325 ***********************************************************************/ 00326 00327 Strength getStrength () 00328 { 00329 return ucol_getStrength (handle); 00330 } 00331 00332 /*********************************************************************** 00333 00334 Set the collation strength used in this UCollator. The 00335 strength influences how strings are compared. one of 00336 Primary, Secondary, Tertiary, Quaternary, Dentical, or 00337 Default 00338 00339 ***********************************************************************/ 00340 00341 void setStrength (Strength s) 00342 { 00343 ucol_setStrength (handle, s); 00344 } 00345 00346 /*********************************************************************** 00347 00348 Get the display name for a UCollator. The display name is 00349 suitable for presentation to a user 00350 00351 ***********************************************************************/ 00352 00353 void getDisplayName (ULocale obj, ULocale display, UString dst) 00354 { 00355 uint fmt (wchar* p, uint len, inout Error e) 00356 { 00357 return ucol_getDisplayName (toString(obj.name), toString(display.name), dst.get, dst.len, e); 00358 } 00359 00360 dst.format (&fmt, "failed to get collator display name"); 00361 } 00362 00363 /*********************************************************************** 00364 00365 Returns current rules. Options define whether full rules 00366 are returned or just the tailoring. 00367 00368 ***********************************************************************/ 00369 00370 void getRules (UString dst, RuleOption o = RuleOption.FullRules) 00371 { 00372 uint fmt (wchar* p, uint len, inout Error e) 00373 { 00374 uint needed = ucol_getRulesEx (handle, o, dst.get, dst.len); 00375 if (needed > len) 00376 e = e.BufferOverflow; 00377 return needed; 00378 } 00379 00380 dst.format (&fmt, "failed to get collator rules"); 00381 } 00382 00383 /*********************************************************************** 00384 00385 Get the short definition string for a collator. 00386 00387 This API harvests the collator's locale and the attribute 00388 set and produces a string that can be used for opening a 00389 collator with the same properties using the char[] style 00390 constructor. This string will be normalized. 00391 00392 The structure and the syntax of the string is defined in the 00393 "Naming collators" section of the users guide: 00394 http://oss.software.ibm.com/icu/userguide/Collate_Concepts.html#Naming_Collators 00395 00396 ***********************************************************************/ 00397 00398 char[] getShortDefinitionString (ULocale locale = ULocale.Default) 00399 { 00400 Error e; 00401 char[64] dst; 00402 00403 uint len = ucol_getShortDefinitionString (handle, toString(locale.name), dst, dst.length, e); 00404 testError (e, "failed to get collator short name"); 00405 return dst[0..len].dup; 00406 } 00407 00408 /*********************************************************************** 00409 00410 Verifies and normalizes short definition string. Normalized 00411 short definition string has all the option sorted by the 00412 argument name, so that equivalent definition strings are the 00413 same 00414 00415 ***********************************************************************/ 00416 00417 char[] normalizeShortDefinitionString (char[] source) 00418 { 00419 Error e; 00420 char[64] dst; 00421 00422 uint len = ucol_normalizeShortDefinitionString (toString(source), dst, dst.length, null, e); 00423 testError (e, "failed to normalize collator short name"); 00424 return dst[0..len].dup; 00425 } 00426 00427 /*********************************************************************** 00428 00429 Get a sort key for a string from a UCollator. Sort keys 00430 may be compared using strcmp. 00431 00432 ***********************************************************************/ 00433 00434 ubyte[] getSortKey (UText t, ubyte[] result) 00435 { 00436 uint len = ucol_getSortKey (handle, t.get, t.len, result, result.length); 00437 if (len < result.length) 00438 return result [0..len]; 00439 return null; 00440 } 00441 00442 /*********************************************************************** 00443 00444 Merge two sort keys. The levels are merged with their 00445 corresponding counterparts (primaries with primaries, 00446 secondaries with secondaries etc.). Between the values 00447 from the same level a separator is inserted. example 00448 (uncompressed): 191B1D 01 050505 01 910505 00 and 00449 1F2123 01 050505 01 910505 00 will be merged as 00450 191B1D 02 1F212301 050505 02 050505 01 910505 02 910505 00 00451 This allows for concatenating of first and last names for 00452 sorting, among other things. If the destination buffer is 00453 not big enough, the results are undefined. If any of source 00454 lengths are zero or any of source pointers are null/undefined, 00455 result is of size zero. 00456 00457 ***********************************************************************/ 00458 00459 ubyte[] mergeSortkeys (ubyte[] left, ubyte[] right, ubyte[] result) 00460 { 00461 uint len = ucol_mergeSortkeys (left, left.length, right, right.length, result, result.length); 00462 if (len < result.length) 00463 return result [0..len]; 00464 return null; 00465 } 00466 00467 /*********************************************************************** 00468 00469 Produce a bound for a given sortkey and a number of levels. 00470 00471 Return value is always the number of bytes needed, regardless 00472 of whether the result buffer was big enough or even valid. 00473 00474 Resulting bounds can be used to produce a range of strings 00475 that are between upper and lower bounds. For example, if 00476 bounds are produced for a sortkey of string "smith", strings 00477 between upper and lower bounds with one level would include 00478 "Smith", "SMITH", "sMiTh". 00479 00480 There are two upper bounds that can be produced. If BoundUpper 00481 is produced, strings matched would be as above. However, if 00482 bound produced using BoundUpperLong is used, the above example 00483 will also match "Smithsonian" and similar. 00484 00485 ***********************************************************************/ 00486 00487 ubyte[] getBound (BoundMode mode, ubyte[] source, ubyte[] result, uint levels = 1) 00488 { 00489 Error e; 00490 00491 uint len = ucol_getBound (source, source.length, mode, levels, result, result.length, e); 00492 testError (e, "failed to get sortkey bound"); 00493 if (len < result.length) 00494 return result [0..len]; 00495 return null; 00496 } 00497 00498 /*********************************************************************** 00499 00500 Gets the version information for a Collator. 00501 00502 Version is currently an opaque 32-bit number which depends, 00503 among other things, on major versions of the collator 00504 tailoring and UCA 00505 00506 ***********************************************************************/ 00507 00508 void getVersion (inout Version v) 00509 { 00510 ucol_getVersion (handle, v); 00511 } 00512 00513 /*********************************************************************** 00514 00515 Gets the UCA version information for this Collator 00516 00517 ***********************************************************************/ 00518 00519 void getUCAVersion (inout Version v) 00520 { 00521 ucol_getUCAVersion (handle, v); 00522 } 00523 00524 /*********************************************************************** 00525 00526 Universal attribute setter 00527 00528 ***********************************************************************/ 00529 00530 void setAttribute (Attribute attr, AttributeValue value) 00531 { 00532 Error e; 00533 00534 ucol_setAttribute (handle, attr, value, e); 00535 testError (e, "failed to set collator attribute"); 00536 } 00537 00538 /*********************************************************************** 00539 00540 Universal attribute getter 00541 00542 ***********************************************************************/ 00543 00544 AttributeValue getAttribute (Attribute attr) 00545 { 00546 Error e; 00547 00548 AttributeValue v = ucol_getAttribute (handle, attr, e); 00549 testError (e, "failed to get collator attribute"); 00550 return v; 00551 } 00552 00553 /*********************************************************************** 00554 00555 Variable top is a two byte primary value which causes all 00556 the codepoints with primary values that are less or equal 00557 than the variable top to be shifted when alternate handling 00558 is set to Shifted. 00559 00560 ***********************************************************************/ 00561 00562 void setVariableTop (UText t) 00563 { 00564 Error e; 00565 00566 ucol_setVariableTop (handle, t.get, t.len, e); 00567 testError (e, "failed to set variable-top"); 00568 } 00569 00570 /*********************************************************************** 00571 00572 Sets the variable top to a collation element value 00573 supplied.Variable top is set to the upper 16 bits. 00574 Lower 16 bits are ignored. 00575 00576 ***********************************************************************/ 00577 00578 void setVariableTop (uint x) 00579 { 00580 Error e; 00581 00582 ucol_restoreVariableTop (handle, x, e); 00583 testError (e, "failed to restore variable-top"); 00584 } 00585 00586 /*********************************************************************** 00587 00588 Gets the variable top value of this Collator. Lower 16 bits 00589 are undefined and should be ignored. 00590 00591 ***********************************************************************/ 00592 00593 uint getVariableTop () 00594 { 00595 Error e; 00596 00597 uint x = ucol_getVariableTop (handle, e); 00598 testError (e, "failed to get variable-top"); 00599 return x; 00600 } 00601 00602 /*********************************************************************** 00603 00604 Gets the locale name of the collator. If the collator is 00605 instantiated from the rules, then this function will throw 00606 an exception 00607 00608 ***********************************************************************/ 00609 00610 void getLocale (ULocale locale, ULocale.Type type) 00611 { 00612 Error e; 00613 00614 locale.name = toArray (ucol_getLocaleByType (handle, type, e)); 00615 if (isError(e) || locale.name is null) 00616 exception ("failed to get collator locale"); 00617 } 00618 00619 /*********************************************************************** 00620 00621 Get the Unicode set that contains all the characters and 00622 sequences tailored in this collator. 00623 00624 ***********************************************************************/ 00625 00626 USet getTailoredSet () 00627 { 00628 Error e; 00629 00630 Handle h = ucol_getTailoredSet (handle, e); 00631 testError (e, "failed to get tailored set"); 00632 return new USet (h); 00633 } 00634 00635 00636 /*********************************************************************** 00637 00638 Bind the ICU functions from a shared library. This is 00639 complicated by the issues regarding D and DLLs on the 00640 Windows platform 00641 00642 ***********************************************************************/ 00643 00644 private static void* library; 00645 00646 /*********************************************************************** 00647 00648 ***********************************************************************/ 00649 00650 private static extern (C) 00651 { 00652 void function (Handle) ucol_close; 00653 Handle function (char *loc, inout Error e) ucol_open; 00654 Handle function (wchar* rules, uint rulesLength, AttributeValue normalizationMode, Strength strength, UParseError *parseError, inout Error e) ucol_openRules; 00655 Handle function (char *definition, byte forceDefaults, UParseError *parseError, inout Error e) ucol_openFromShortString; 00656 uint function (Handle, Handle conts, inout Error e) ucol_getContractions; 00657 int function (Handle, wchar* source, uint sourceLength, wchar* target, uint targetLength) ucol_strcoll; 00658 byte function (Handle, wchar* source, uint sourceLength, wchar* target, uint targetLength) ucol_greater; 00659 byte function (Handle, wchar* source, uint sourceLength, wchar* target, uint targetLength) ucol_greaterOrEqual; 00660 byte function (Handle, wchar* source, uint sourceLength, wchar* target, uint targetLength) ucol_equal; 00661 Strength function (Handle) ucol_getStrength; 00662 void function (Handle, Strength strength) ucol_setStrength; 00663 uint function (char *objLoc, char *dispLoc, wchar* result, uint resultLength, inout Error e) ucol_getDisplayName; 00664 uint function (Handle, char *locale, char *buffer, uint capacity, inout Error e) ucol_getShortDefinitionString; 00665 uint function (char *source, char *destination, uint capacity, UParseError *parseError, inout Error e) ucol_normalizeShortDefinitionString; 00666 uint function (Handle, wchar* source, uint sourceLength, ubyte *result, uint resultLength) ucol_getSortKey; 00667 uint function (ubyte *source, uint sourceLength, BoundMode boundType, uint noOfLevels, ubyte *result, uint resultLength, inout Error e) ucol_getBound; 00668 void function (Handle, Version info) ucol_getVersion; 00669 void function (Handle, Version info) ucol_getUCAVersion; 00670 uint function (ubyte *src1, uint src1Length, ubyte *src2, uint src2Length, ubyte *dest, uint destCapacity) ucol_mergeSortkeys; 00671 void function (Handle, Attribute attr, AttributeValue value, inout Error e) ucol_setAttribute; 00672 AttributeValue function (Handle, Attribute attr, inout Error e) ucol_getAttribute; 00673 uint function (Handle, wchar* varTop, uint len, inout Error e) ucol_setVariableTop; 00674 uint function (Handle, inout Error e) ucol_getVariableTop; 00675 void function (Handle, uint varTop, inout Error e) ucol_restoreVariableTop; 00676 uint function (Handle, RuleOption delta, wchar* buffer, uint bufferLen) ucol_getRulesEx; 00677 char* function (Handle, ULocale.Type type, inout Error e) ucol_getLocaleByType; 00678 Handle function (Handle, inout Error e) ucol_getTailoredSet; 00679 } 00680 00681 /*********************************************************************** 00682 00683 ***********************************************************************/ 00684 00685 static FunctionLoader.Bind[] targets = 00686 [ 00687 {cast(void**) &ucol_open, "ucol_open"}, 00688 {cast(void**) &ucol_close, "ucol_close"}, 00689 {cast(void**) &ucol_openRules, "ucol_openRules"}, 00690 {cast(void**) &ucol_openFromShortString, "ucol_openFromShortString"}, 00691 {cast(void**) &ucol_getContractions, "ucol_getContractions"}, 00692 {cast(void**) &ucol_strcoll, "ucol_strcoll"}, 00693 {cast(void**) &ucol_greater, "ucol_greater"}, 00694 {cast(void**) &ucol_greaterOrEqual, "ucol_greaterOrEqual"}, 00695 {cast(void**) &ucol_equal, "ucol_equal"}, 00696 {cast(void**) &ucol_getStrength, "ucol_getStrength"}, 00697 {cast(void**) &ucol_setStrength, "ucol_setStrength"}, 00698 {cast(void**) &ucol_getDisplayName, "ucol_getDisplayName"}, 00699 {cast(void**) &ucol_getShortDefinitionString, "ucol_getShortDefinitionString"}, 00700 {cast(void**) &ucol_normalizeShortDefinitionString, "ucol_normalizeShortDefinitionString"}, 00701 {cast(void**) &ucol_getSortKey, "ucol_getSortKey"}, 00702 {cast(void**) &ucol_getBound, "ucol_getBound"}, 00703 {cast(void**) &ucol_getVersion, "ucol_getVersion"}, 00704 {cast(void**) &ucol_getUCAVersion, "ucol_getUCAVersion"}, 00705 {cast(void**) &ucol_mergeSortkeys, "ucol_mergeSortkeys"}, 00706 {cast(void**) &ucol_setAttribute, "ucol_setAttribute"}, 00707 {cast(void**) &ucol_getAttribute, "ucol_getAttribute"}, 00708 {cast(void**) &ucol_setVariableTop, "ucol_setVariableTop"}, 00709 {cast(void**) &ucol_getVariableTop, "ucol_getVariableTop"}, 00710 {cast(void**) &ucol_restoreVariableTop, "ucol_restoreVariableTop"}, 00711 {cast(void**) &ucol_getRulesEx, "ucol_getRulesEx"}, 00712 {cast(void**) &ucol_getLocaleByType, "ucol_getLocaleByType"}, 00713 {cast(void**) &ucol_getTailoredSet, "ucol_getTailoredSet"}, 00714 ]; 00715 00716 /*********************************************************************** 00717 00718 ***********************************************************************/ 00719 00720 static this () 00721 { 00722 library = FunctionLoader.bind (icuin, targets); 00723 } 00724 00725 /*********************************************************************** 00726 00727 ***********************************************************************/ 00728 00729 static ~this () 00730 { 00731 FunctionLoader.unbind (library); 00732 } 00733 } 00734