ICU 60.2 60.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

urep.h
Go to the documentation of this file.
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 ******************************************************************************
5 * Copyright (C) 1997-2010, International Business Machines
6 * Corporation and others. All Rights Reserved.
7 ******************************************************************************
8 * Date Name Description
9 * 06/23/00 aliu Creation.
10 ******************************************************************************
11 */
12
13 #ifndef __UREP_H
14 #define __UREP_H
15
16 #include "unicode/utypes.h"
17
18 U_CDECL_BEGIN
19
20 /********************************************************************
21 * General Notes
22 ********************************************************************
23 * TODO
24 * Add usage scenario
25 * Add test code
26 * Talk about pinning
27 * Talk about "can truncate result if out of memory"
28 */
29
30 /********************************************************************
31 * Data Structures
32 ********************************************************************/
44 typedef void* UReplaceable;
45
53 typedef struct UReplaceableCallbacks {
54
63 int32_t (*length)(const UReplaceable* rep);
64
76 UChar (*charAt)(const UReplaceable* rep,
77 int32_t offset);
78
89 UChar32 (*char32At)(const UReplaceable* rep,
90 int32_t offset);
91
108 void (*replace)(UReplaceable* rep,
109 int32_t start,
110 int32_t limit,
111 const UChar* text,
112 int32_t textLength);
113
127 void (*extract)(UReplaceable* rep,
128 int32_t start,
129 int32_t limit,
130 UChar* dst);
131
148 void (*copy)(UReplaceable* rep,
149 int32_t start,
150 int32_t limit,
151 int32_t dest);
152
153 } UReplaceableCallbacks;
154
155 U_CDECL_END
156
157 #endif
UReplaceableCallbacks::extract
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:127
UReplaceable
void * UReplaceable
An opaque replaceable text object.
Definition: urep.h:44
UReplaceableCallbacks::char32At
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:89
UReplaceableCallbacks::copy
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:148
U_CDECL_BEGIN
#define U_CDECL_BEGIN
This is used to begin a declaration of a library private ICU C API.
Definition: umachine.h:84
UReplaceableCallbacks::length
int32_t(* length)(const UReplaceable *rep)
Function pointer that returns the number of UChar code units in this text.
Definition: urep.h:63
UChar32
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
Definition: umachine.h:396
UReplaceableCallbacks
struct UReplaceableCallbacks UReplaceableCallbacks
A set of function pointers that transliterators use to manipulate a UReplaceable. ...
UReplaceableCallbacks
A set of function pointers that transliterators use to manipulate a UReplaceable. ...
Definition: urep.h:53
UChar
uint16_t UChar
The base type for UTF-16 code units and pointers.
Definition: umachine.h:349
U_CDECL_END
#define U_CDECL_END
This is used to end a declaration of a library private ICU C API.
Definition: umachine.h:85
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
UReplaceableCallbacks::replace
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:108
UReplaceableCallbacks::charAt
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:76