Main Page | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

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 
00021 /********************************************************************
00022  * General Notes
00023  ********************************************************************
00024  */
00042 /********************************************************************
00043  * Data Structures
00044  ********************************************************************/
00045 
00053 typedef void* UTransliterator;
00054 
00063 typedef enum UTransDirection {
00064     
00071     UTRANS_FORWARD,
00072 
00079     UTRANS_REVERSE
00080 
00081 } UTransDirection;
00082 
00105 typedef struct UTransPosition {
00106 
00115     int32_t contextStart;
00116     
00125     int32_t contextLimit;
00126     
00134     int32_t start;
00135     
00143     int32_t limit;
00144 
00145 } UTransPosition;
00146 
00147 /********************************************************************
00148  * General API
00149  ********************************************************************/
00150 
00174 U_CAPI UTransliterator* U_EXPORT2 
00175 utrans_open(const char* id,
00176             UTransDirection dir,
00177             const UChar* rules,         /* may be Null */
00178             int32_t rulesLength,        /* -1 if null-terminated */ 
00179             UParseError* parseError,    /* may be Null */
00180             UErrorCode* status);
00181 
00197 U_CAPI UTransliterator* U_EXPORT2 
00198 utrans_openInverse(const UTransliterator* trans,
00199                    UErrorCode* status);
00200 
00211 U_CAPI UTransliterator* U_EXPORT2 
00212 utrans_clone(const UTransliterator* trans,
00213              UErrorCode* status);
00214 
00221 U_CAPI void U_EXPORT2 
00222 utrans_close(UTransliterator* trans);
00223 
00238 U_CAPI int32_t U_EXPORT2 
00239 utrans_getID(const UTransliterator* trans,
00240              char* buf,
00241              int32_t bufCapacity);
00242 
00257 U_CAPI void U_EXPORT2 
00258 utrans_register(UTransliterator* adoptedTrans,
00259                 UErrorCode* status);
00260 
00269 U_CAPI void U_EXPORT2 
00270 utrans_unregister(const char* id);
00271 
00290 U_CAPI void U_EXPORT2 
00291 utrans_setFilter(UTransliterator* trans,
00292                  const UChar* filterPattern,
00293                  int32_t filterPatternLen,
00294                  UErrorCode* status);
00295 
00301 U_CAPI int32_t U_EXPORT2 
00302 utrans_countAvailableIDs(void);
00303 
00321 U_CAPI int32_t U_EXPORT2 
00322 utrans_getAvailableID(int32_t index,
00323                       char* buf,
00324                       int32_t bufCapacity);
00325 
00326 /********************************************************************
00327  * Transliteration API
00328  ********************************************************************/
00329 
00353 U_CAPI void U_EXPORT2 
00354 utrans_trans(const UTransliterator* trans,
00355              UReplaceable* rep,
00356              UReplaceableCallbacks* repFunc,
00357              int32_t start,
00358              int32_t* limit,
00359              UErrorCode* status);
00360 
00404 U_CAPI void U_EXPORT2 
00405 utrans_transIncremental(const UTransliterator* trans,
00406                         UReplaceable* rep,
00407                         UReplaceableCallbacks* repFunc,
00408                         UTransPosition* pos,
00409                         UErrorCode* status);
00410 
00442 U_CAPI void U_EXPORT2 
00443 utrans_transUChars(const UTransliterator* trans,
00444                    UChar* text,
00445                    int32_t* textLength,
00446                    int32_t textCapacity,
00447                    int32_t start,
00448                    int32_t* limit,
00449                    UErrorCode* status);
00450 
00477 U_CAPI void U_EXPORT2 
00478 utrans_transIncrementalUChars(const UTransliterator* trans,
00479                               UChar* text,
00480                               int32_t* textLength,
00481                               int32_t textCapacity,
00482                               UTransPosition* pos,
00483                               UErrorCode* status);
00484 
00485 
00486 /********************* Obsolete API ************************************/
00491 #ifdef U_USE_DEPRECATED_FORMAT_API
00492 
00493 #if ((U_ICU_VERSION_MAJOR_NUM != 2) || (U_ICU_VERSION_MINOR_NUM != 2))
00494 #   error "ICU version has changed. Please redefine the macros under U_USE_DEPRECATED_FORMAT_API pre-processor definition"
00495 #else 
00496     U_CAPI UTransliterator* U_EXPORT2 
00497     utrans_openRules(const char* id,
00498                      const UChar* rules,
00499                      int32_t rulesLength, /* -1 if null-terminated */
00500                      UTransDirection dir,
00501                      UParseError* parseErr, /* may be NULL */
00502                      UErrorCode* status){
00503         return utrans_open(id,dir,rules,rulesLength,parseErr,status);
00504     }
00505 
00506 #   define utrans_open_2_2(id,dir,status) utrans_open(id,dir,NULL,0,NULL,status)
00507 
00508 #endif
00509 #endif
00510 /********************* End **********************************************/
00511 
00512 #endif /* #if !UCONFIG_NO_TRANSLITERATION */
00513 
00514 #endif

Generated on Wed Sep 3 17:47:10 2003 for ICU 2.6 by doxygen 1.3.2