00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef UTRANS_H
00012 #define UTRANS_H
00013
00014 #include "unicode/utypes.h"
00015 #include "unicode/urep.h"
00016 #include "unicode/parseerr.h"
00017
00018
00019
00020
00021
00039
00040
00041
00042
00050 typedef void* UTransliterator;
00051
00060 typedef enum _UTransDirection {
00061
00068 UTRANS_FORWARD,
00069
00076 UTRANS_REVERSE
00077
00078 } UTransDirection;
00079
00102 typedef struct _UTransPosition {
00103
00111 int32_t contextStart;
00112
00120 int32_t contextLimit;
00121
00128 int32_t start;
00129
00136 int32_t limit;
00137
00138 } UTransPosition;
00139
00140
00141
00142
00143
00167 U_CAPI UTransliterator* U_EXPORT2
00168 utrans_open(const char* id,
00169 UTransDirection dir,
00170 const UChar* rules,
00171 int32_t rulesLength,
00172 UParseError* parseError,
00173 UErrorCode* status);
00174
00190 U_CAPI UTransliterator* U_EXPORT2
00191 utrans_openInverse(const UTransliterator* trans,
00192 UErrorCode* status);
00193
00204 U_CAPI UTransliterator* U_EXPORT2
00205 utrans_clone(const UTransliterator* trans,
00206 UErrorCode* status);
00207
00214 U_CAPI void U_EXPORT2
00215 utrans_close(UTransliterator* trans);
00216
00231 U_CAPI int32_t U_EXPORT2
00232 utrans_getID(const UTransliterator* trans,
00233 char* buf,
00234 int32_t bufCapacity);
00235
00250 U_CAPI void U_EXPORT2
00251 utrans_register(UTransliterator* adoptedTrans,
00252 UErrorCode* status);
00253
00262 U_CAPI void U_EXPORT2
00263 utrans_unregister(const char* id);
00264
00283 U_CAPI void U_EXPORT2
00284 utrans_setFilter(UTransliterator* trans,
00285 const UChar* filterPattern,
00286 int32_t filterPatternLen,
00287 UErrorCode* status);
00288
00294 U_CAPI int32_t U_EXPORT2
00295 utrans_countAvailableIDs(void);
00296
00314 U_CAPI int32_t U_EXPORT2
00315 utrans_getAvailableID(int32_t index,
00316 char* buf,
00317 int32_t bufCapacity);
00318
00319
00320
00321
00322
00346 U_CAPI void U_EXPORT2
00347 utrans_trans(const UTransliterator* trans,
00348 UReplaceable* rep,
00349 UReplaceableCallbacks* repFunc,
00350 int32_t start,
00351 int32_t* limit,
00352 UErrorCode* status);
00353
00397 U_CAPI void U_EXPORT2
00398 utrans_transIncremental(const UTransliterator* trans,
00399 UReplaceable* rep,
00400 UReplaceableCallbacks* repFunc,
00401 UTransPosition* pos,
00402 UErrorCode* status);
00403
00435 U_CAPI void U_EXPORT2
00436 utrans_transUChars(const UTransliterator* trans,
00437 UChar* text,
00438 int32_t* textLength,
00439 int32_t textCapacity,
00440 int32_t start,
00441 int32_t* limit,
00442 UErrorCode* status);
00443
00470 U_CAPI void U_EXPORT2
00471 utrans_transIncrementalUChars(const UTransliterator* trans,
00472 UChar* text,
00473 int32_t* textLength,
00474 int32_t textCapacity,
00475 UTransPosition* pos,
00476 UErrorCode* status);
00477
00478
00479
00484 #ifdef U_USE_DEPRECATED_FORMAT_API
00485
00486 #if ((U_ICU_VERSION_MAJOR_NUM != 2) || (U_ICU_VERSION_MINOR_NUM != 2))
00487 # error "ICU version has changed. Please redefine the macros under U_USE_DEPRECATED_FORMAT_API pre-processor definition"
00488 #else
00489 U_CAPI UTransliterator* U_EXPORT2
00490 utrans_openRules(const char* id,
00491 const UChar* rules,
00492 int32_t rulesLength,
00493 UTransDirection dir,
00494 UParseError* parseErr,
00495 UErrorCode* status){
00496 return utrans_open(id,dir,rules,rulesLength,parseErr,status);
00497 }
00498
00499 # define utrans_open_2_2(id,dir,status) utrans_open(id,dir,NULL,0,NULL,status)
00500
00501 #endif
00502 #endif
00503
00504
00505 #endif