urep.h
Go to the documentation of this file.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
* Copyright (C) 1997-2010, International Business Machines
* Corporation and others. All Rights Reserved.
******************************************************************************
* Date Name Description
* 06/23/00 aliu Creation.
******************************************************************************
*/
#ifndef __UREP_H
#define __UREP_H
#include "unicode/utypes.h"
U_CDECL_BEGIN
/********************************************************************
* General Notes
********************************************************************
* TODO
* Add usage scenario
* Add test code
* Talk about pinning
* Talk about "can truncate result if out of memory"
*/
/********************************************************************
* Data Structures
********************************************************************/
typedef void* UReplaceable;
typedef struct UReplaceableCallbacks {
int32_t (*length)(const UReplaceable* rep);
UChar (*charAt)(const UReplaceable* rep,
int32_t offset);
UChar32 (*char32At)(const UReplaceable* rep,
int32_t offset);
void (*replace)(UReplaceable* rep,
int32_t start,
int32_t limit,
const UChar* text,
int32_t textLength);
void (*extract)(UReplaceable* rep,
int32_t start,
int32_t limit,
UChar* dst);
void (*copy)(UReplaceable* rep,
int32_t start,
int32_t limit,
int32_t dest);
} UReplaceableCallbacks;
U_CDECL_END
#endif
UReplaceableCallbacks
A set of function pointers that transliterators use to manipulate a UReplaceable.
Definition: urep.h:53
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
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
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::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
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::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
UChar32
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
Definition: umachine.h:435
U_CDECL_END
#define U_CDECL_END
This is used to end a declaration of a library private ICU C API.
Definition: umachine.h:86
UChar
char16_t UChar
The base type for UTF-16 code units and pointers.
Definition: umachine.h:386
U_CDECL_BEGIN
#define U_CDECL_BEGIN
This is used to begin a declaration of a library private ICU C API.
Definition: umachine.h:85
UReplaceable
void * UReplaceable
An opaque replaceable text object.
Definition: urep.h:44
UReplaceableCallbacks
struct UReplaceableCallbacks UReplaceableCallbacks
A set of function pointers that transliterators use to manipulate a UReplaceable.
utypes.h
Basic definitions for ICU, for both C and C++ APIs.