ICU 75.1 75.1
Loading...
Searching...
No Matches
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
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 ********************************************************************/
44typedef void* UReplaceable;
45
53typedef struct UReplaceableCallbacks {
54
63 int32_t (*length)(const UReplaceable* rep);
64
76 UChar (*charAt)(const UReplaceable* rep,
77 int32_t offset);
78
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
154
156
157#endif
A set of function pointers that transliterators use to manipulate a UReplaceable.
Definition urep.h:53
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
int32_t(* length)(const UReplaceable *rep)
Function pointer that returns the number of UChar code units in this text.
Definition urep.h:63
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
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
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
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
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
Definition umachine.h:427
#define U_CDECL_END
This is used to end a declaration of a library private ICU C API.
Definition umachine.h:86
char16_t UChar
The base type for UTF-16 code units and pointers.
Definition umachine.h:378
#define U_CDECL_BEGIN
This is used to begin a declaration of a library private ICU C API.
Definition umachine.h:85
void * UReplaceable
An opaque replaceable text object.
Definition urep.h:44
Basic definitions for ICU, for both C and C++ APIs.