ICU 4.8.1.1  4.8.1.1
utrans.h
Go to the documentation of this file.
00001 /*
00002 *******************************************************************************
00003 *   Copyright (C) 1997-2010, International Business Machines
00004 *   Corporation and others.  All Rights Reserved.
00005 *******************************************************************************
00006 *   Date        Name        Description
00007 *   06/21/00    aliu        Creation.
00008 *******************************************************************************
00009 */
00010 
00011 #ifndef UTRANS_H
00012 #define UTRANS_H
00013 
00014 #include "unicode/utypes.h"
00015 
00016 #if !UCONFIG_NO_TRANSLITERATION
00017 
00018 #include "unicode/localpointer.h"
00019 #include "unicode/urep.h"
00020 #include "unicode/parseerr.h"
00021 #include "unicode/uenum.h"
00022 
00023 /********************************************************************
00024  * General Notes
00025  ********************************************************************
00026  */
00056 /********************************************************************
00057  * Data Structures
00058  ********************************************************************/
00059 
00067 typedef void* UTransliterator;
00068 
00077 typedef enum UTransDirection {
00078     
00085     UTRANS_FORWARD,
00086 
00093     UTRANS_REVERSE
00094 
00095 } UTransDirection;
00096 
00119 typedef struct UTransPosition {
00120 
00129     int32_t contextStart;
00130     
00139     int32_t contextLimit;
00140     
00148     int32_t start;
00149     
00157     int32_t limit;
00158 
00159 } UTransPosition;
00160 
00161 /********************************************************************
00162  * General API
00163  ********************************************************************/
00164 
00188 U_STABLE UTransliterator* U_EXPORT2
00189 utrans_openU(const UChar *id,
00190              int32_t idLength,
00191              UTransDirection dir,
00192              const UChar *rules,
00193              int32_t rulesLength,
00194              UParseError *parseError,
00195              UErrorCode *pErrorCode);
00196 
00212 U_STABLE UTransliterator* U_EXPORT2 
00213 utrans_openInverse(const UTransliterator* trans,
00214                    UErrorCode* status);
00215 
00226 U_STABLE UTransliterator* U_EXPORT2 
00227 utrans_clone(const UTransliterator* trans,
00228              UErrorCode* status);
00229 
00236 U_STABLE void U_EXPORT2 
00237 utrans_close(UTransliterator* trans);
00238 
00239 #if U_SHOW_CPLUSPLUS_API
00240 
00241 U_NAMESPACE_BEGIN
00242 
00252 U_DEFINE_LOCAL_OPEN_POINTER(LocalUTransliteratorPointer, UTransliterator, utrans_close);
00253 
00254 U_NAMESPACE_END
00255 
00256 #endif
00257 
00272 U_STABLE const UChar * U_EXPORT2
00273 utrans_getUnicodeID(const UTransliterator *trans,
00274                     int32_t *resultLength);
00275 
00290 U_STABLE void U_EXPORT2 
00291 utrans_register(UTransliterator* adoptedTrans,
00292                 UErrorCode* status);
00293 
00303 U_STABLE void U_EXPORT2
00304 utrans_unregisterID(const UChar* id, int32_t idLength);
00305 
00324 U_STABLE void U_EXPORT2 
00325 utrans_setFilter(UTransliterator* trans,
00326                  const UChar* filterPattern,
00327                  int32_t filterPatternLen,
00328                  UErrorCode* status);
00329 
00337 U_STABLE int32_t U_EXPORT2 
00338 utrans_countAvailableIDs(void);
00339 
00349 U_STABLE UEnumeration * U_EXPORT2
00350 utrans_openIDs(UErrorCode *pErrorCode);
00351 
00352 /********************************************************************
00353  * Transliteration API
00354  ********************************************************************/
00355 
00379 U_STABLE void U_EXPORT2 
00380 utrans_trans(const UTransliterator* trans,
00381              UReplaceable* rep,
00382              UReplaceableCallbacks* repFunc,
00383              int32_t start,
00384              int32_t* limit,
00385              UErrorCode* status);
00386 
00430 U_STABLE void U_EXPORT2 
00431 utrans_transIncremental(const UTransliterator* trans,
00432                         UReplaceable* rep,
00433                         UReplaceableCallbacks* repFunc,
00434                         UTransPosition* pos,
00435                         UErrorCode* status);
00436 
00468 U_STABLE void U_EXPORT2 
00469 utrans_transUChars(const UTransliterator* trans,
00470                    UChar* text,
00471                    int32_t* textLength,
00472                    int32_t textCapacity,
00473                    int32_t start,
00474                    int32_t* limit,
00475                    UErrorCode* status);
00476 
00503 U_STABLE void U_EXPORT2 
00504 utrans_transIncrementalUChars(const UTransliterator* trans,
00505                               UChar* text,
00506                               int32_t* textLength,
00507                               int32_t textCapacity,
00508                               UTransPosition* pos,
00509                               UErrorCode* status);
00510 
00511 /* deprecated API ----------------------------------------------------------- */
00512 
00513 /* see utrans.h documentation for why these functions are deprecated */
00514 
00538 U_DEPRECATED UTransliterator* U_EXPORT2 
00539 utrans_open(const char* id,
00540             UTransDirection dir,
00541             const UChar* rules,         /* may be Null */
00542             int32_t rulesLength,        /* -1 if null-terminated */ 
00543             UParseError* parseError,    /* may be Null */
00544             UErrorCode* status);
00545 
00561 U_DEPRECATED int32_t U_EXPORT2 
00562 utrans_getID(const UTransliterator* trans,
00563              char* buf,
00564              int32_t bufCapacity);
00565 
00575 U_DEPRECATED void U_EXPORT2 
00576 utrans_unregister(const char* id);
00577 
00596 U_DEPRECATED int32_t U_EXPORT2 
00597 utrans_getAvailableID(int32_t index,
00598                       char* buf,
00599                       int32_t bufCapacity);
00600 
00601 #endif /* #if !UCONFIG_NO_TRANSLITERATION */
00602 
00603 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines