Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

utrans.h

Go to the documentation of this file.
00001 /*
00002 *******************************************************************************
00003 *   Copyright (C) 1997-2003, 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/urep.h"
00019 #include "unicode/parseerr.h"
00020 #include "unicode/uenum.h"
00021 
00022 /********************************************************************
00023  * General Notes
00024  ********************************************************************
00025  */
00055 /********************************************************************
00056  * Data Structures
00057  ********************************************************************/
00058 
00066 typedef void* UTransliterator;
00067 
00076 typedef enum UTransDirection {
00077     
00084     UTRANS_FORWARD,
00085 
00092     UTRANS_REVERSE
00093 
00094 } UTransDirection;
00095 
00118 typedef struct UTransPosition {
00119 
00128     int32_t contextStart;
00129     
00138     int32_t contextLimit;
00139     
00147     int32_t start;
00148     
00156     int32_t limit;
00157 
00158 } UTransPosition;
00159 
00160 /********************************************************************
00161  * General API
00162  ********************************************************************/
00163 
00187 U_CAPI UTransliterator* U_EXPORT2
00188 utrans_openU(const UChar *id,
00189              int32_t idLength,
00190              UTransDirection dir,
00191              const UChar *rules,
00192              int32_t rulesLength,
00193              UParseError *parseError,
00194              UErrorCode *pErrorCode);
00195 
00211 U_CAPI UTransliterator* U_EXPORT2 
00212 utrans_openInverse(const UTransliterator* trans,
00213                    UErrorCode* status);
00214 
00225 U_CAPI UTransliterator* U_EXPORT2 
00226 utrans_clone(const UTransliterator* trans,
00227              UErrorCode* status);
00228 
00235 U_CAPI void U_EXPORT2 
00236 utrans_close(UTransliterator* trans);
00237 
00251 U_CAPI const UChar * U_EXPORT2
00252 utrans_getUnicodeID(const UTransliterator *trans,
00253                     int32_t *resultLength);
00254 
00269 U_CAPI void U_EXPORT2 
00270 utrans_register(UTransliterator* adoptedTrans,
00271                 UErrorCode* status);
00272 
00281 U_CAPI void U_EXPORT2
00282 utrans_unregisterID(const UChar* id, int32_t idLength);
00283 
00302 U_CAPI void U_EXPORT2 
00303 utrans_setFilter(UTransliterator* trans,
00304                  const UChar* filterPattern,
00305                  int32_t filterPatternLen,
00306                  UErrorCode* status);
00307 
00315 U_CAPI int32_t U_EXPORT2 
00316 utrans_countAvailableIDs(void);
00317 
00327 U_CAPI UEnumeration * U_EXPORT2
00328 utrans_openIDs(UErrorCode *pErrorCode);
00329 
00330 /********************************************************************
00331  * Transliteration API
00332  ********************************************************************/
00333 
00357 U_CAPI void U_EXPORT2 
00358 utrans_trans(const UTransliterator* trans,
00359              UReplaceable* rep,
00360              UReplaceableCallbacks* repFunc,
00361              int32_t start,
00362              int32_t* limit,
00363              UErrorCode* status);
00364 
00408 U_CAPI void U_EXPORT2 
00409 utrans_transIncremental(const UTransliterator* trans,
00410                         UReplaceable* rep,
00411                         UReplaceableCallbacks* repFunc,
00412                         UTransPosition* pos,
00413                         UErrorCode* status);
00414 
00446 U_CAPI void U_EXPORT2 
00447 utrans_transUChars(const UTransliterator* trans,
00448                    UChar* text,
00449                    int32_t* textLength,
00450                    int32_t textCapacity,
00451                    int32_t start,
00452                    int32_t* limit,
00453                    UErrorCode* status);
00454 
00481 U_CAPI void U_EXPORT2 
00482 utrans_transIncrementalUChars(const UTransliterator* trans,
00483                               UChar* text,
00484                               int32_t* textLength,
00485                               int32_t textCapacity,
00486                               UTransPosition* pos,
00487                               UErrorCode* status);
00488 
00489 /* deprecated API ----------------------------------------------------------- */
00490 
00491 /* see utrans.h documentation for why these functions are deprecated */
00492 
00516 U_CAPI UTransliterator* U_EXPORT2 
00517 utrans_open(const char* id,
00518             UTransDirection dir,
00519             const UChar* rules,         /* may be Null */
00520             int32_t rulesLength,        /* -1 if null-terminated */ 
00521             UParseError* parseError,    /* may be Null */
00522             UErrorCode* status);
00523 
00539 U_CAPI int32_t U_EXPORT2 
00540 utrans_getID(const UTransliterator* trans,
00541              char* buf,
00542              int32_t bufCapacity);
00543 
00553 U_CAPI void U_EXPORT2 
00554 utrans_unregister(const char* id);
00555 
00574 U_CAPI int32_t U_EXPORT2 
00575 utrans_getAvailableID(int32_t index,
00576                       char* buf,
00577                       int32_t bufCapacity);
00578 
00579 #endif /* #if !UCONFIG_NO_TRANSLITERATION */
00580 
00581 #endif

Generated on Mon Nov 24 14:35:46 2003 for ICU 2.8 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001