ICU 57.1 57.1
urep.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/23/00 aliu Creation.
8******************************************************************************
9*/
10
11#ifndef __UREP_H
12#define __UREP_H
13
14#include "unicode/utypes.h"
15
17
18/********************************************************************
19 * General Notes
20 ********************************************************************
21 * TODO
22 * Add usage scenario
23 * Add test code
24 * Talk about pinning
25 * Talk about "can truncate result if out of memory"
26 */
27
28/********************************************************************
29 * Data Structures
30 ********************************************************************/
42typedef void* UReplaceable;
43
51typedef struct UReplaceableCallbacks {
52
61 int32_t (*length)(const UReplaceable* rep);
62
74 UChar (*charAt)(const UReplaceable* rep,
75 int32_t offset);
76
88 int32_t offset);
89
106 void (*replace)(UReplaceable* rep,
107 int32_t start,
108 int32_t limit,
109 const UChar* text,
110 int32_t textLength);
111
125 void (*extract)(UReplaceable* rep,
126 int32_t start,
127 int32_t limit,
128 UChar* dst);
129
146 void (*copy)(UReplaceable* rep,
147 int32_t start,
148 int32_t limit,
149 int32_t dest);
150
152
154
155#endif
A set of function pointers that transliterators use to manipulate a UReplaceable.
Definition urep.h:51
void(* extract)(UReplaceable *rep, int32_t start, int32_t limit, UChar *dst)
Function pointer that copies the characters in the range [start, limit) into the array dst.
Definition urep.h:125
int32_t(* length)(const UReplaceable *rep)
Function pointer that returns the number of UChar code units in this text.
Definition urep.h:61
void(* replace)(UReplaceable *rep, int32_t start, int32_t limit, const UChar *text, int32_t textLength)
Function pointer that replaces text between start and limit in this text with the given text.
Definition urep.h:106
void(* copy)(UReplaceable *rep, int32_t start, int32_t limit, int32_t dest)
Function pointer that copies text between start and limit in this text to another index in the text.
Definition urep.h:146
UChar32(* char32At)(const UReplaceable *rep, int32_t offset)
Function pointer that returns a UChar32 code point at the given offset into this text.
Definition urep.h:87
UChar(* charAt)(const UReplaceable *rep, int32_t offset)
Function pointer that returns a UChar code units at the given offset into this text; 0 <= offset < n,...
Definition urep.h:74
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
Definition umachine.h:332
#define U_CDECL_END
This is used to end a declaration of a library private ICU C API.
Definition umachine.h:83
#define U_CDECL_BEGIN
This is used to begin a declaration of a library private ICU C API.
Definition umachine.h:82
uint16_t UChar
Define UChar to be UCHAR_TYPE, if that is #defined (for example, to char16_t), or wchar_t if that is ...
Definition umachine.h:312
void * UReplaceable
An opaque replaceable text object.
Definition urep.h:42
Basic definitions for ICU, for both C and C++ APIs.