00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef UTRANS_H
00014 #define UTRANS_H
00015
00016 #include "unicode/utypes.h"
00017
00018 #if !UCONFIG_NO_TRANSLITERATION
00019
00020 #include "unicode/localpointer.h"
00021 #include "unicode/urep.h"
00022 #include "unicode/parseerr.h"
00023 #include "unicode/uenum.h"
00024 #include "unicode/uset.h"
00025
00026
00027
00028
00029
00059
00060
00061
00062
00070 typedef void* UTransliterator;
00071
00080 typedef enum UTransDirection {
00081
00088 UTRANS_FORWARD,
00089
00096 UTRANS_REVERSE
00097
00098 } UTransDirection;
00099
00122 typedef struct UTransPosition {
00123
00132 int32_t contextStart;
00133
00142 int32_t contextLimit;
00143
00151 int32_t start;
00152
00160 int32_t limit;
00161
00162 } UTransPosition;
00163
00164
00165
00166
00167
00191 U_STABLE UTransliterator* U_EXPORT2
00192 utrans_openU(const UChar *id,
00193 int32_t idLength,
00194 UTransDirection dir,
00195 const UChar *rules,
00196 int32_t rulesLength,
00197 UParseError *parseError,
00198 UErrorCode *pErrorCode);
00199
00215 U_STABLE UTransliterator* U_EXPORT2
00216 utrans_openInverse(const UTransliterator* trans,
00217 UErrorCode* status);
00218
00229 U_STABLE UTransliterator* U_EXPORT2
00230 utrans_clone(const UTransliterator* trans,
00231 UErrorCode* status);
00232
00239 U_STABLE void U_EXPORT2
00240 utrans_close(UTransliterator* trans);
00241
00242 #if U_SHOW_CPLUSPLUS_API
00243
00244 U_NAMESPACE_BEGIN
00245
00255 U_DEFINE_LOCAL_OPEN_POINTER(LocalUTransliteratorPointer, UTransliterator, utrans_close);
00256
00257 U_NAMESPACE_END
00258
00259 #endif
00260
00275 U_STABLE const UChar * U_EXPORT2
00276 utrans_getUnicodeID(const UTransliterator *trans,
00277 int32_t *resultLength);
00278
00293 U_STABLE void U_EXPORT2
00294 utrans_register(UTransliterator* adoptedTrans,
00295 UErrorCode* status);
00296
00306 U_STABLE void U_EXPORT2
00307 utrans_unregisterID(const UChar* id, int32_t idLength);
00308
00327 U_STABLE void U_EXPORT2
00328 utrans_setFilter(UTransliterator* trans,
00329 const UChar* filterPattern,
00330 int32_t filterPatternLen,
00331 UErrorCode* status);
00332
00340 U_STABLE int32_t U_EXPORT2
00341 utrans_countAvailableIDs(void);
00342
00352 U_STABLE UEnumeration * U_EXPORT2
00353 utrans_openIDs(UErrorCode *pErrorCode);
00354
00355
00356
00357
00358
00382 U_STABLE void U_EXPORT2
00383 utrans_trans(const UTransliterator* trans,
00384 UReplaceable* rep,
00385 const UReplaceableCallbacks* repFunc,
00386 int32_t start,
00387 int32_t* limit,
00388 UErrorCode* status);
00389
00433 U_STABLE void U_EXPORT2
00434 utrans_transIncremental(const UTransliterator* trans,
00435 UReplaceable* rep,
00436 const UReplaceableCallbacks* repFunc,
00437 UTransPosition* pos,
00438 UErrorCode* status);
00439
00470 U_STABLE void U_EXPORT2
00471 utrans_transUChars(const UTransliterator* trans,
00472 UChar* text,
00473 int32_t* textLength,
00474 int32_t textCapacity,
00475 int32_t start,
00476 int32_t* limit,
00477 UErrorCode* status);
00478
00505 U_STABLE void U_EXPORT2
00506 utrans_transIncrementalUChars(const UTransliterator* trans,
00507 UChar* text,
00508 int32_t* textLength,
00509 int32_t textCapacity,
00510 UTransPosition* pos,
00511 UErrorCode* status);
00512
00530 U_STABLE int32_t U_EXPORT2
00531 utrans_toRules( const UTransliterator* trans,
00532 UBool escapeUnprintable,
00533 UChar* result, int32_t resultLength,
00534 UErrorCode* status);
00535
00555 U_STABLE USet* U_EXPORT2
00556 utrans_getSourceSet(const UTransliterator* trans,
00557 UBool ignoreFilter,
00558 USet* fillIn,
00559 UErrorCode* status);
00560
00561
00562
00563 #ifndef U_HIDE_DEPRECATED_API
00564
00565
00566
00590 U_DEPRECATED UTransliterator* U_EXPORT2
00591 utrans_open(const char* id,
00592 UTransDirection dir,
00593 const UChar* rules,
00594 int32_t rulesLength,
00595 UParseError* parseError,
00596 UErrorCode* status);
00597
00613 U_DEPRECATED int32_t U_EXPORT2
00614 utrans_getID(const UTransliterator* trans,
00615 char* buf,
00616 int32_t bufCapacity);
00617
00627 U_DEPRECATED void U_EXPORT2
00628 utrans_unregister(const char* id);
00629
00648 U_DEPRECATED int32_t U_EXPORT2
00649 utrans_getAvailableID(int32_t index,
00650 char* buf,
00651 int32_t bufCapacity);
00652
00653 #endif
00654
00655 #endif
00656
00657 #endif