|
||||
Warning, file /include/unicode/utrans.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 // © 2016 and later: Unicode, Inc. and others. 0002 // License & terms of use: http://www.unicode.org/copyright.html 0003 /* 0004 ******************************************************************************* 0005 * Copyright (C) 1997-2011,2014-2015 International Business Machines 0006 * Corporation and others. All Rights Reserved. 0007 ******************************************************************************* 0008 * Date Name Description 0009 * 06/21/00 aliu Creation. 0010 ******************************************************************************* 0011 */ 0012 0013 #ifndef UTRANS_H 0014 #define UTRANS_H 0015 0016 #include "unicode/utypes.h" 0017 0018 #if !UCONFIG_NO_TRANSLITERATION 0019 0020 #include "unicode/urep.h" 0021 #include "unicode/parseerr.h" 0022 #include "unicode/uenum.h" 0023 #include "unicode/uset.h" 0024 0025 #if U_SHOW_CPLUSPLUS_API 0026 #include "unicode/localpointer.h" 0027 #endif // U_SHOW_CPLUSPLUS_API 0028 0029 /******************************************************************** 0030 * General Notes 0031 ******************************************************************** 0032 */ 0033 /** 0034 * \file 0035 * \brief C API: Transliterator 0036 * 0037 * <h2> Transliteration </h2> 0038 * The data structures and functions described in this header provide 0039 * transliteration services. Transliteration services are implemented 0040 * as C++ classes. The comments and documentation in this header 0041 * assume the reader is familiar with the C++ headers translit.h and 0042 * associated documentation. 0043 * 0044 * A significant but incomplete subset of the C++ transliteration 0045 * services are available to C code through this header. In order to 0046 * access more complex transliteration services, refer to the C++ 0047 * headers and documentation. 0048 * 0049 * There are two sets of functions for working with transliterator IDs: 0050 * 0051 * An old, deprecated set uses char * IDs, which works for true and pure 0052 * identifiers that these APIs were designed for, 0053 * for example "Cyrillic-Latin". 0054 * It does not work when the ID contains filters ("[:Script=Cyrl:]") 0055 * or even a complete set of rules because then the ID string contains more 0056 * than just "invariant" characters (see utypes.h). 0057 * 0058 * A new set of functions replaces the old ones and uses UChar * IDs, 0059 * paralleling the UnicodeString IDs in the C++ API. (New in ICU 2.8.) 0060 */ 0061 0062 /******************************************************************** 0063 * Data Structures 0064 ********************************************************************/ 0065 0066 /** 0067 * An opaque transliterator for use in C. Open with utrans_openxxx() 0068 * and close with utrans_close() when done. Equivalent to the C++ class 0069 * Transliterator and its subclasses. 0070 * @see Transliterator 0071 * @stable ICU 2.0 0072 */ 0073 typedef void* UTransliterator; 0074 0075 /** 0076 * Direction constant indicating the direction in a transliterator, 0077 * e.g., the forward or reverse rules of a RuleBasedTransliterator. 0078 * Specified when a transliterator is opened. An "A-B" transliterator 0079 * transliterates A to B when operating in the forward direction, and 0080 * B to A when operating in the reverse direction. 0081 * @stable ICU 2.0 0082 */ 0083 typedef enum UTransDirection { 0084 0085 /** 0086 * UTRANS_FORWARD means from <source> to <target> for a 0087 * transliterator with ID <source>-<target>. For a transliterator 0088 * opened using a rule, it means forward direction rules, e.g., 0089 * "A > B". 0090 */ 0091 UTRANS_FORWARD, 0092 0093 /** 0094 * UTRANS_REVERSE means from <target> to <source> for a 0095 * transliterator with ID <source>-<target>. For a transliterator 0096 * opened using a rule, it means reverse direction rules, e.g., 0097 * "A < B". 0098 */ 0099 UTRANS_REVERSE 0100 0101 } UTransDirection; 0102 0103 /** 0104 * Position structure for utrans_transIncremental() incremental 0105 * transliteration. This structure defines two substrings of the text 0106 * being transliterated. The first region, [contextStart, 0107 * contextLimit), defines what characters the transliterator will read 0108 * as context. The second region, [start, limit), defines what 0109 * characters will actually be transliterated. The second region 0110 * should be a subset of the first. 0111 * 0112 * <p>After a transliteration operation, some of the indices in this 0113 * structure will be modified. See the field descriptions for 0114 * details. 0115 * 0116 * <p>contextStart <= start <= limit <= contextLimit 0117 * 0118 * <p>Note: All index values in this structure must be at code point 0119 * boundaries. That is, none of them may occur between two code units 0120 * of a surrogate pair. If any index does split a surrogate pair, 0121 * results are unspecified. 0122 * 0123 * @stable ICU 2.0 0124 */ 0125 typedef struct UTransPosition { 0126 0127 /** 0128 * Beginning index, inclusive, of the context to be considered for 0129 * a transliteration operation. The transliterator will ignore 0130 * anything before this index. INPUT/OUTPUT parameter: This parameter 0131 * is updated by a transliteration operation to reflect the maximum 0132 * amount of antecontext needed by a transliterator. 0133 * @stable ICU 2.4 0134 */ 0135 int32_t contextStart; 0136 0137 /** 0138 * Ending index, exclusive, of the context to be considered for a 0139 * transliteration operation. The transliterator will ignore 0140 * anything at or after this index. INPUT/OUTPUT parameter: This 0141 * parameter is updated to reflect changes in the length of the 0142 * text, but points to the same logical position in the text. 0143 * @stable ICU 2.4 0144 */ 0145 int32_t contextLimit; 0146 0147 /** 0148 * Beginning index, inclusive, of the text to be transliterated. 0149 * INPUT/OUTPUT parameter: This parameter is advanced past 0150 * characters that have already been transliterated by a 0151 * transliteration operation. 0152 * @stable ICU 2.4 0153 */ 0154 int32_t start; 0155 0156 /** 0157 * Ending index, exclusive, of the text to be transliterated. 0158 * INPUT/OUTPUT parameter: This parameter is updated to reflect 0159 * changes in the length of the text, but points to the same 0160 * logical position in the text. 0161 * @stable ICU 2.4 0162 */ 0163 int32_t limit; 0164 0165 } UTransPosition; 0166 0167 /******************************************************************** 0168 * General API 0169 ********************************************************************/ 0170 0171 /** 0172 * Open a custom transliterator, given a custom rules string 0173 * OR 0174 * a system transliterator, given its ID. 0175 * Any non-NULL result from this function should later be closed with 0176 * utrans_close(). 0177 * 0178 * @param id a valid transliterator ID 0179 * @param idLength the length of the ID string, or -1 if NUL-terminated 0180 * @param dir the desired direction 0181 * @param rules the transliterator rules. See the C++ header rbt.h for 0182 * rules syntax. If NULL then a system transliterator matching 0183 * the ID is returned. 0184 * @param rulesLength the length of the rules, or -1 if the rules 0185 * are NUL-terminated. 0186 * @param parseError a pointer to a UParseError struct to receive the details 0187 * of any parsing errors. This parameter may be NULL if no 0188 * parsing error details are desired. 0189 * @param pErrorCode a pointer to the UErrorCode 0190 * @return a transliterator pointer that may be passed to other 0191 * utrans_xxx() functions, or NULL if the open call fails. 0192 * @stable ICU 2.8 0193 */ 0194 U_CAPI UTransliterator* U_EXPORT2 0195 utrans_openU(const UChar *id, 0196 int32_t idLength, 0197 UTransDirection dir, 0198 const UChar *rules, 0199 int32_t rulesLength, 0200 UParseError *parseError, 0201 UErrorCode *pErrorCode); 0202 0203 /** 0204 * Open an inverse of an existing transliterator. For this to work, 0205 * the inverse must be registered with the system. For example, if 0206 * the Transliterator "A-B" is opened, and then its inverse is opened, 0207 * the result is the Transliterator "B-A", if such a transliterator is 0208 * registered with the system. Otherwise the result is NULL and a 0209 * failing UErrorCode is set. Any non-NULL result from this function 0210 * should later be closed with utrans_close(). 0211 * 0212 * @param trans the transliterator to open the inverse of. 0213 * @param status a pointer to the UErrorCode 0214 * @return a pointer to a newly-opened transliterator that is the 0215 * inverse of trans, or NULL if the open call fails. 0216 * @stable ICU 2.0 0217 */ 0218 U_CAPI UTransliterator* U_EXPORT2 0219 utrans_openInverse(const UTransliterator* trans, 0220 UErrorCode* status); 0221 0222 /** 0223 * Create a copy of a transliterator. Any non-NULL result from this 0224 * function should later be closed with utrans_close(). 0225 * 0226 * @param trans the transliterator to be copied. 0227 * @param status a pointer to the UErrorCode 0228 * @return a transliterator pointer that may be passed to other 0229 * utrans_xxx() functions, or NULL if the clone call fails. 0230 * @stable ICU 2.0 0231 */ 0232 U_CAPI UTransliterator* U_EXPORT2 0233 utrans_clone(const UTransliterator* trans, 0234 UErrorCode* status); 0235 0236 /** 0237 * Close a transliterator. Any non-NULL pointer returned by 0238 * utrans_openXxx() or utrans_clone() should eventually be closed. 0239 * @param trans the transliterator to be closed. 0240 * @stable ICU 2.0 0241 */ 0242 U_CAPI void U_EXPORT2 0243 utrans_close(UTransliterator* trans); 0244 0245 #if U_SHOW_CPLUSPLUS_API 0246 0247 U_NAMESPACE_BEGIN 0248 0249 /** 0250 * \class LocalUTransliteratorPointer 0251 * "Smart pointer" class, closes a UTransliterator via utrans_close(). 0252 * For most methods see the LocalPointerBase base class. 0253 * 0254 * @see LocalPointerBase 0255 * @see LocalPointer 0256 * @stable ICU 4.4 0257 */ 0258 U_DEFINE_LOCAL_OPEN_POINTER(LocalUTransliteratorPointer, UTransliterator, utrans_close); 0259 0260 U_NAMESPACE_END 0261 0262 #endif 0263 0264 /** 0265 * Return the programmatic identifier for this transliterator. 0266 * If this identifier is passed to utrans_openU(), it will open 0267 * a transliterator equivalent to this one, if the ID has been 0268 * registered. 0269 * 0270 * @param trans the transliterator to return the ID of. 0271 * @param resultLength pointer to an output variable receiving the length 0272 * of the ID string; can be NULL 0273 * @return the NUL-terminated ID string. This pointer remains 0274 * valid until utrans_close() is called on this transliterator. 0275 * 0276 * @stable ICU 2.8 0277 */ 0278 U_CAPI const UChar * U_EXPORT2 0279 utrans_getUnicodeID(const UTransliterator *trans, 0280 int32_t *resultLength); 0281 0282 /** 0283 * Register an open transliterator with the system. When 0284 * utrans_open() is called with an ID string that is equal to that 0285 * returned by utrans_getID(adoptedTrans,...), then 0286 * utrans_clone(adoptedTrans,...) is returned. 0287 * 0288 * <p>NOTE: After this call the system owns the adoptedTrans and will 0289 * close it. The user must not call utrans_close() on adoptedTrans. 0290 * 0291 * @param adoptedTrans a transliterator, typically the result of 0292 * utrans_openRules(), to be registered with the system. 0293 * @param status a pointer to the UErrorCode 0294 * @stable ICU 2.0 0295 */ 0296 U_CAPI void U_EXPORT2 0297 utrans_register(UTransliterator* adoptedTrans, 0298 UErrorCode* status); 0299 0300 /** 0301 * Unregister a transliterator from the system. After this call the 0302 * system will no longer recognize the given ID when passed to 0303 * utrans_open(). If the ID is invalid then nothing is done. 0304 * 0305 * @param id an ID to unregister 0306 * @param idLength the length of id, or -1 if id is zero-terminated 0307 * @stable ICU 2.8 0308 */ 0309 U_CAPI void U_EXPORT2 0310 utrans_unregisterID(const UChar* id, int32_t idLength); 0311 0312 /** 0313 * Set the filter used by a transliterator. A filter can be used to 0314 * make the transliterator pass certain characters through untouched. 0315 * The filter is expressed using a UnicodeSet pattern. If the 0316 * filterPattern is NULL or the empty string, then the transliterator 0317 * will be reset to use no filter. 0318 * 0319 * @param trans the transliterator 0320 * @param filterPattern a pattern string, in the form accepted by 0321 * UnicodeSet, specifying which characters to apply the 0322 * transliteration to. May be NULL or the empty string to indicate no 0323 * filter. 0324 * @param filterPatternLen the length of filterPattern, or -1 if 0325 * filterPattern is zero-terminated 0326 * @param status a pointer to the UErrorCode 0327 * @see UnicodeSet 0328 * @stable ICU 2.0 0329 */ 0330 U_CAPI void U_EXPORT2 0331 utrans_setFilter(UTransliterator* trans, 0332 const UChar* filterPattern, 0333 int32_t filterPatternLen, 0334 UErrorCode* status); 0335 0336 /** 0337 * Return the number of system transliterators. 0338 * It is recommended to use utrans_openIDs() instead. 0339 * 0340 * @return the number of system transliterators. 0341 * @stable ICU 2.0 0342 */ 0343 U_CAPI int32_t U_EXPORT2 0344 utrans_countAvailableIDs(void); 0345 0346 /** 0347 * Return a UEnumeration for the available transliterators. 0348 * 0349 * @param pErrorCode Pointer to the UErrorCode in/out parameter. 0350 * @return UEnumeration for the available transliterators. 0351 * Close with uenum_close(). 0352 * 0353 * @stable ICU 2.8 0354 */ 0355 U_CAPI UEnumeration * U_EXPORT2 0356 utrans_openIDs(UErrorCode *pErrorCode); 0357 0358 /******************************************************************** 0359 * Transliteration API 0360 ********************************************************************/ 0361 0362 /** 0363 * Transliterate a segment of a UReplaceable string. The string is 0364 * passed in as a UReplaceable pointer rep and a UReplaceableCallbacks 0365 * function pointer struct repFunc. Functions in the repFunc struct 0366 * will be called in order to modify the rep string. 0367 * 0368 * @param trans the transliterator 0369 * @param rep a pointer to the string. This will be passed to the 0370 * repFunc functions. 0371 * @param repFunc a set of function pointers that will be used to 0372 * modify the string pointed to by rep. 0373 * @param start the beginning index, inclusive; <code>0 <= start <= 0374 * limit</code>. 0375 * @param limit pointer to the ending index, exclusive; <code>start <= 0376 * limit <= repFunc->length(rep)</code>. Upon return, *limit will 0377 * contain the new limit index. The text previously occupying 0378 * <code>[start, limit)</code> has been transliterated, possibly to a 0379 * string of a different length, at <code>[start, 0380 * </code><em>new-limit</em><code>)</code>, where <em>new-limit</em> 0381 * is the return value. 0382 * @param status a pointer to the UErrorCode 0383 * @stable ICU 2.0 0384 */ 0385 U_CAPI void U_EXPORT2 0386 utrans_trans(const UTransliterator* trans, 0387 UReplaceable* rep, 0388 const UReplaceableCallbacks* repFunc, 0389 int32_t start, 0390 int32_t* limit, 0391 UErrorCode* status); 0392 0393 /** 0394 * Transliterate the portion of the UReplaceable text buffer that can 0395 * be transliterated unambiguously. This method is typically called 0396 * after new text has been inserted, e.g. as a result of a keyboard 0397 * event. The transliterator will try to transliterate characters of 0398 * <code>rep</code> between <code>index.cursor</code> and 0399 * <code>index.limit</code>. Characters before 0400 * <code>index.cursor</code> will not be changed. 0401 * 0402 * <p>Upon return, values in <code>index</code> will be updated. 0403 * <code>index.start</code> will be advanced to the first 0404 * character that future calls to this method will read. 0405 * <code>index.cursor</code> and <code>index.limit</code> will 0406 * be adjusted to delimit the range of text that future calls to 0407 * this method may change. 0408 * 0409 * <p>Typical usage of this method begins with an initial call 0410 * with <code>index.start</code> and <code>index.limit</code> 0411 * set to indicate the portion of <code>text</code> to be 0412 * transliterated, and <code>index.cursor == index.start</code>. 0413 * Thereafter, <code>index</code> can be used without 0414 * modification in future calls, provided that all changes to 0415 * <code>text</code> are made via this method. 0416 * 0417 * <p>This method assumes that future calls may be made that will 0418 * insert new text into the buffer. As a result, it only performs 0419 * unambiguous transliterations. After the last call to this method, 0420 * there may be untransliterated text that is waiting for more input 0421 * to resolve an ambiguity. In order to perform these pending 0422 * transliterations, clients should call utrans_trans() with a start 0423 * of index.start and a limit of index.end after the last call to this 0424 * method has been made. 0425 * 0426 * @param trans the transliterator 0427 * @param rep a pointer to the string. This will be passed to the 0428 * repFunc functions. 0429 * @param repFunc a set of function pointers that will be used to 0430 * modify the string pointed to by rep. 0431 * @param pos a struct containing the start and limit indices of the 0432 * text to be read and the text to be transliterated 0433 * @param status a pointer to the UErrorCode 0434 * @stable ICU 2.0 0435 */ 0436 U_CAPI void U_EXPORT2 0437 utrans_transIncremental(const UTransliterator* trans, 0438 UReplaceable* rep, 0439 const UReplaceableCallbacks* repFunc, 0440 UTransPosition* pos, 0441 UErrorCode* status); 0442 0443 /** 0444 * Transliterate a segment of a UChar* string. The string is passed 0445 * in in a UChar* buffer. The string is modified in place. If the 0446 * result is longer than textCapacity, it is truncated. The actual 0447 * length of the result is returned in *textLength, if textLength is 0448 * non-NULL. *textLength may be greater than textCapacity, but only 0449 * textCapacity UChars will be written to *text, including the zero 0450 * terminator. 0451 * 0452 * @param trans the transliterator 0453 * @param text a pointer to a buffer containing the text to be 0454 * transliterated on input and the result text on output. 0455 * @param textLength a pointer to the length of the string in text. 0456 * If the length is -1 then the string is assumed to be 0457 * zero-terminated. Upon return, the new length is stored in 0458 * *textLength. If textLength is NULL then the string is assumed to 0459 * be zero-terminated. 0460 * @param textCapacity the length of the text buffer 0461 * @param start the beginning index, inclusive; <code>0 <= start <= 0462 * limit</code>. 0463 * @param limit pointer to the ending index, exclusive; <code>start <= 0464 * limit <= repFunc->length(rep)</code>. Upon return, *limit will 0465 * contain the new limit index. The text previously occupying 0466 * <code>[start, limit)</code> has been transliterated, possibly to a 0467 * string of a different length, at <code>[start, 0468 * </code><em>new-limit</em><code>)</code>, where <em>new-limit</em> 0469 * is the return value. 0470 * @param status a pointer to the UErrorCode 0471 * @stable ICU 2.0 0472 */ 0473 U_CAPI void U_EXPORT2 0474 utrans_transUChars(const UTransliterator* trans, 0475 UChar* text, 0476 int32_t* textLength, 0477 int32_t textCapacity, 0478 int32_t start, 0479 int32_t* limit, 0480 UErrorCode* status); 0481 0482 /** 0483 * Transliterate the portion of the UChar* text buffer that can be 0484 * transliterated unambiguously. See utrans_transIncremental(). The 0485 * string is passed in in a UChar* buffer. The string is modified in 0486 * place. If the result is longer than textCapacity, it is truncated. 0487 * The actual length of the result is returned in *textLength, if 0488 * textLength is non-NULL. *textLength may be greater than 0489 * textCapacity, but only textCapacity UChars will be written to 0490 * *text, including the zero terminator. See utrans_transIncremental() 0491 * for usage details. 0492 * 0493 * @param trans the transliterator 0494 * @param text a pointer to a buffer containing the text to be 0495 * transliterated on input and the result text on output. 0496 * @param textLength a pointer to the length of the string in text. 0497 * If the length is -1 then the string is assumed to be 0498 * zero-terminated. Upon return, the new length is stored in 0499 * *textLength. If textLength is NULL then the string is assumed to 0500 * be zero-terminated. 0501 * @param textCapacity the length of the text buffer 0502 * @param pos a struct containing the start and limit indices of the 0503 * text to be read and the text to be transliterated 0504 * @param status a pointer to the UErrorCode 0505 * @see utrans_transIncremental 0506 * @stable ICU 2.0 0507 */ 0508 U_CAPI void U_EXPORT2 0509 utrans_transIncrementalUChars(const UTransliterator* trans, 0510 UChar* text, 0511 int32_t* textLength, 0512 int32_t textCapacity, 0513 UTransPosition* pos, 0514 UErrorCode* status); 0515 0516 /** 0517 * Create a rule string that can be passed to utrans_openU to recreate this 0518 * transliterator. 0519 * 0520 * @param trans The transliterator 0521 * @param escapeUnprintable if true then convert unprintable characters to their 0522 * hex escape representations, \\uxxxx or \\Uxxxxxxxx. 0523 * Unprintable characters are those other than 0524 * U+000A, U+0020..U+007E. 0525 * @param result A pointer to a buffer to receive the rules. 0526 * @param resultLength The maximum size of result. 0527 * @param status A pointer to the UErrorCode. In case of error status, the 0528 * contents of result are undefined. 0529 * @return int32_t The length of the rule string (may be greater than resultLength, 0530 * in which case an error is returned). 0531 * @stable ICU 53 0532 */ 0533 U_CAPI int32_t U_EXPORT2 0534 utrans_toRules( const UTransliterator* trans, 0535 UBool escapeUnprintable, 0536 UChar* result, int32_t resultLength, 0537 UErrorCode* status); 0538 0539 /** 0540 * Returns the set of all characters that may be modified in the input text by 0541 * this UTransliterator, optionally ignoring the transliterator's current filter. 0542 * @param trans The transliterator. 0543 * @param ignoreFilter If false, the returned set incorporates the 0544 * UTransliterator's current filter; if the filter is changed, 0545 * the return value of this function will change. If true, the 0546 * returned set ignores the effect of the UTransliterator's 0547 * current filter. 0548 * @param fillIn Pointer to a USet object to receive the modifiable characters 0549 * set. Previous contents of fillIn are lost. <em>If fillIn is 0550 * NULL, then a new USet is created and returned. The caller 0551 * owns the result and must dispose of it by calling uset_close.</em> 0552 * @param status A pointer to the UErrorCode. 0553 * @return USet* Either fillIn, or if fillIn is NULL, a pointer to a 0554 * newly-allocated USet that the user must close. In case of 0555 * error, NULL is returned. 0556 * @stable ICU 53 0557 */ 0558 U_CAPI USet* U_EXPORT2 0559 utrans_getSourceSet(const UTransliterator* trans, 0560 UBool ignoreFilter, 0561 USet* fillIn, 0562 UErrorCode* status); 0563 0564 /* deprecated API ----------------------------------------------------------- */ 0565 0566 #ifndef U_HIDE_DEPRECATED_API 0567 0568 /* see utrans.h documentation for why these functions are deprecated */ 0569 0570 /** 0571 * Deprecated, use utrans_openU() instead. 0572 * Open a custom transliterator, given a custom rules string 0573 * OR 0574 * a system transliterator, given its ID. 0575 * Any non-NULL result from this function should later be closed with 0576 * utrans_close(). 0577 * 0578 * @param id a valid ID, as returned by utrans_getAvailableID() 0579 * @param dir the desired direction 0580 * @param rules the transliterator rules. See the C++ header rbt.h 0581 * for rules syntax. If NULL then a system transliterator matching 0582 * the ID is returned. 0583 * @param rulesLength the length of the rules, or -1 if the rules 0584 * are zero-terminated. 0585 * @param parseError a pointer to a UParseError struct to receive the 0586 * details of any parsing errors. This parameter may be NULL if no 0587 * parsing error details are desired. 0588 * @param status a pointer to the UErrorCode 0589 * @return a transliterator pointer that may be passed to other 0590 * utrans_xxx() functions, or NULL if the open call fails. 0591 * @deprecated ICU 2.8 Use utrans_openU() instead, see utrans.h 0592 */ 0593 U_DEPRECATED UTransliterator* U_EXPORT2 0594 utrans_open(const char* id, 0595 UTransDirection dir, 0596 const UChar* rules, /* may be Null */ 0597 int32_t rulesLength, /* -1 if null-terminated */ 0598 UParseError* parseError, /* may be Null */ 0599 UErrorCode* status); 0600 0601 /** 0602 * Deprecated, use utrans_getUnicodeID() instead. 0603 * Return the programmatic identifier for this transliterator. 0604 * If this identifier is passed to utrans_open(), it will open 0605 * a transliterator equivalent to this one, if the ID has been 0606 * registered. 0607 * @param trans the transliterator to return the ID of. 0608 * @param buf the buffer in which to receive the ID. This may be 0609 * NULL, in which case no characters are copied. 0610 * @param bufCapacity the capacity of the buffer. Ignored if buf is 0611 * NULL. 0612 * @return the actual length of the ID, not including 0613 * zero-termination. This may be greater than bufCapacity. 0614 * @deprecated ICU 2.8 Use utrans_getUnicodeID() instead, see utrans.h 0615 */ 0616 U_DEPRECATED int32_t U_EXPORT2 0617 utrans_getID(const UTransliterator* trans, 0618 char* buf, 0619 int32_t bufCapacity); 0620 0621 /** 0622 * Deprecated, use utrans_unregisterID() instead. 0623 * Unregister a transliterator from the system. After this call the 0624 * system will no longer recognize the given ID when passed to 0625 * utrans_open(). If the id is invalid then nothing is done. 0626 * 0627 * @param id a zero-terminated ID 0628 * @deprecated ICU 2.8 Use utrans_unregisterID() instead, see utrans.h 0629 */ 0630 U_DEPRECATED void U_EXPORT2 0631 utrans_unregister(const char* id); 0632 0633 /** 0634 * Deprecated, use utrans_openIDs() instead. 0635 * Return the ID of the index-th system transliterator. The result 0636 * is placed in the given buffer. If the given buffer is too small, 0637 * the initial substring is copied to buf. The result in buf is 0638 * always zero-terminated. 0639 * 0640 * @param index the number of the transliterator to return. Must 0641 * satisfy 0 <= index < utrans_countAvailableIDs(). If index is out 0642 * of range then it is treated as if it were 0. 0643 * @param buf the buffer in which to receive the ID. This may be 0644 * NULL, in which case no characters are copied. 0645 * @param bufCapacity the capacity of the buffer. Ignored if buf is 0646 * NULL. 0647 * @return the actual length of the index-th ID, not including 0648 * zero-termination. This may be greater than bufCapacity. 0649 * @deprecated ICU 2.8 Use utrans_openIDs() instead, see utrans.h 0650 */ 0651 U_DEPRECATED int32_t U_EXPORT2 0652 utrans_getAvailableID(int32_t index, 0653 char* buf, 0654 int32_t bufCapacity); 0655 0656 #endif /* U_HIDE_DEPRECATED_API */ 0657 0658 #endif /* #if !UCONFIG_NO_TRANSLITERATION */ 0659 0660 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |