ICU 4.8.1.1  4.8.1.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
utrans.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************
3 * Copyright (C) 1997-2010, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 *******************************************************************************
6 * Date Name Description
7 * 06/21/00 aliu Creation.
8 *******************************************************************************
9 */
10 
11 #ifndef UTRANS_H
12 #define UTRANS_H
13 
14 #include "unicode/utypes.h"
15 
16 #if !UCONFIG_NO_TRANSLITERATION
17 
18 #include "unicode/localpointer.h"
19 #include "unicode/urep.h"
20 #include "unicode/parseerr.h"
21 #include "unicode/uenum.h"
22 
23 /********************************************************************
24  * General Notes
25  ********************************************************************
26  */
56 /********************************************************************
57  * Data Structures
58  ********************************************************************/
59 
67 typedef void* UTransliterator;
68 
77 typedef enum UTransDirection {
78 
86 
94 
96 
119 typedef struct UTransPosition {
120 
129  int32_t contextStart;
130 
139  int32_t contextLimit;
140 
148  int32_t start;
149 
157  int32_t limit;
158 
160 
161 /********************************************************************
162  * General API
163  ********************************************************************/
164 
189 utrans_openU(const UChar *id,
190  int32_t idLength,
191  UTransDirection dir,
192  const UChar *rules,
193  int32_t rulesLength,
194  UParseError *parseError,
195  UErrorCode *pErrorCode);
196 
214  UErrorCode* status);
215 
227 utrans_clone(const UTransliterator* trans,
228  UErrorCode* status);
229 
236 U_STABLE void U_EXPORT2
238 
239 #if U_SHOW_CPLUSPLUS_API
240 
242 
252 U_DEFINE_LOCAL_OPEN_POINTER(LocalUTransliteratorPointer, UTransliterator, utrans_close);
253 
255 
256 #endif
257 
272 U_STABLE const UChar * U_EXPORT2
274  int32_t *resultLength);
275 
290 U_STABLE void U_EXPORT2
291 utrans_register(UTransliterator* adoptedTrans,
292  UErrorCode* status);
293 
303 U_STABLE void U_EXPORT2
304 utrans_unregisterID(const UChar* id, int32_t idLength);
305 
324 U_STABLE void U_EXPORT2
326  const UChar* filterPattern,
327  int32_t filterPatternLen,
328  UErrorCode* status);
329 
337 U_STABLE int32_t U_EXPORT2
339 
350 utrans_openIDs(UErrorCode *pErrorCode);
351 
352 /********************************************************************
353  * Transliteration API
354  ********************************************************************/
355 
379 U_STABLE void U_EXPORT2
380 utrans_trans(const UTransliterator* trans,
381  UReplaceable* rep,
382  UReplaceableCallbacks* repFunc,
383  int32_t start,
384  int32_t* limit,
385  UErrorCode* status);
386 
430 U_STABLE void U_EXPORT2
432  UReplaceable* rep,
433  UReplaceableCallbacks* repFunc,
434  UTransPosition* pos,
435  UErrorCode* status);
436 
468 U_STABLE void U_EXPORT2
470  UChar* text,
471  int32_t* textLength,
472  int32_t textCapacity,
473  int32_t start,
474  int32_t* limit,
475  UErrorCode* status);
476 
503 U_STABLE void U_EXPORT2
505  UChar* text,
506  int32_t* textLength,
507  int32_t textCapacity,
508  UTransPosition* pos,
509  UErrorCode* status);
510 
511 /* deprecated API ----------------------------------------------------------- */
512 
513 /* see utrans.h documentation for why these functions are deprecated */
514 
539 utrans_open(const char* id,
540  UTransDirection dir,
541  const UChar* rules, /* may be Null */
542  int32_t rulesLength, /* -1 if null-terminated */
543  UParseError* parseError, /* may be Null */
544  UErrorCode* status);
545 
561 U_DEPRECATED int32_t U_EXPORT2
562 utrans_getID(const UTransliterator* trans,
563  char* buf,
564  int32_t bufCapacity);
565 
576 utrans_unregister(const char* id);
577 
596 U_DEPRECATED int32_t U_EXPORT2
597 utrans_getAvailableID(int32_t index,
598  char* buf,
599  int32_t bufCapacity);
600 
601 #endif /* #if !UCONFIG_NO_TRANSLITERATION */
602 
603 #endif