142 #if U_SHOW_CPLUSPLUS_API 186 #if U_SHOW_CPLUSPLUS_API 248 #if U_SHOW_CPLUSPLUS_API 675 int64_t nativeStart, int64_t nativeLimit,
676 UChar *dest, int32_t destCapacity,
696 #ifndef U_HIDE_INTERNAL_API 706 #define UTEXT_CURRENT32(ut) \ 707 ((ut)->chunkOffset < (ut)->chunkLength && ((ut)->chunkContents)[(ut)->chunkOffset]<0xd800 ? \ 708 ((ut)->chunkContents)[((ut)->chunkOffset)] : utext_current32(ut)) 722 #define UTEXT_NEXT32(ut) \ 723 ((ut)->chunkOffset < (ut)->chunkLength && ((ut)->chunkContents)[(ut)->chunkOffset]<0xd800 ? \ 724 ((ut)->chunkContents)[((ut)->chunkOffset)++] : utext_next32(ut)) 736 #define UTEXT_PREVIOUS32(ut) \ 737 ((ut)->chunkOffset > 0 && \ 738 (ut)->chunkContents[(ut)->chunkOffset-1] < 0xd800 ? \ 739 (ut)->chunkContents[--((ut)->chunkOffset)] : utext_previous32(ut)) 753 #define UTEXT_GETNATIVEINDEX(ut) \ 754 ((ut)->chunkOffset <= (ut)->nativeIndexingLimit? \ 755 (ut)->chunkNativeStart+(ut)->chunkOffset : \ 756 (ut)->pFuncs->mapOffsetToNative(ut)) 769 #define UTEXT_SETNATIVEINDEX(ut, ix) UPRV_BLOCK_MACRO_BEGIN { \ 770 int64_t __offset = (ix) - (ut)->chunkNativeStart; \ 771 if (__offset>=0 && __offset<(int64_t)(ut)->nativeIndexingLimit && (ut)->chunkContents[__offset]<0xdc00) { \ 772 (ut)->chunkOffset=(int32_t)__offset; \ 774 utext_setNativeIndex((ut), (ix)); \ 776 } UPRV_BLOCK_MACRO_END 852 int64_t nativeStart, int64_t nativeLimit,
853 const UChar *replacementText, int32_t replacementLength,
892 int64_t nativeStart, int64_t nativeLimit,
1074 int64_t nativeStart, int64_t nativeLimit,
1075 UChar *dest, int32_t destCapacity,
1109 int64_t nativeStart, int64_t nativeLimit,
1110 const UChar *replacementText, int32_t replacmentLength,
1143 int64_t nativeStart, int64_t nativeLimit,
1567 UTEXT_MAGIC = 0x345ad82c
1577 #define UTEXT_INITIALIZER { \ int32_t UTextExtract(UText *ut, int64_t nativeStart, int64_t nativeLimit, UChar *dest, int32_t destCapacity, UErrorCode *status)
Function type declaration for UText.extract().
int32_t c
(protected) Integer field reserved for use by the text provider.
int64_t utext_nativeLength(UText *ut)
Get the length of the text.
UChar32 utext_previous32(UText *ut)
Move the iterator position to the character (code point) whose index precedes the current position...
UTextClose * spare3
(private) Spare function pointer
int32_t nativeIndexingLimit
(protected) The highest chunk offset where native indexing and chunk (UTF-16) indexing correspond...
int64_t chunkNativeStart
(protected) Native index of the first character in the text chunk.
UBool utext_isWritable(const UText *ut)
Return TRUE if the text can be written (modified) with utext_replace() or utext_copy().
void UTextClose(UText *ut)
Function type declaration for UText.utextClose().
int32_t providerProperties
Text provider properties.
void * pExtra
(protected) Pointer to additional space requested by the text provider during the utext_open operatio...
int64_t a
(protected) Integer field reserved for use by the text provider.
UChar32 utext_previous32From(UText *ut, int64_t nativeIndex)
Set the iteration index, and return the code point preceding the one specified by the initial index...
int32_t chunkLength
(protected) Length the text chunk (UTF-16 buffer), in UChars.
void UTextCopy(UText *ut, int64_t nativeStart, int64_t nativeLimit, int64_t nativeDest, UBool move, UErrorCode *status)
Function type declaration for UText.copy().
UTextMapNativeIndexToUTF16 * mapNativeIndexToUTF16
(public) Function pointer for UTextMapNativeIndexToUTF16.
UText * utext_openUTF8(UText *ut, const char *s, int64_t length, UErrorCode *status)
Open a read-only UText implementation for UTF-8 strings.
UText * UTextClone(UText *dest, const UText *src, UBool deep, UErrorCode *status)
Function type declaration for UText.clone().
int32_t reserved1
(private) Alignment padding.
void utext_freeze(UText *ut)
UTextExtract * extract
(public) Function pointer for UTextExtract.
int64_t UTextNativeLength(UText *ut)
Function type declaration for UText.nativeLength().
void * privP
Private field reserved for future use by the UText framework itself.
UTextClose * close
(public) Function pointer for UTextClose.
int32_t flags
(private) Flags for managing the allocation and freeing of memory associated with this UText...
int32_t privC
Private field reserved for future use by the UText framework itself.
UTextClone * clone
(public) Function pointer for UTextClone
UTextNativeLength * nativeLength
(public) function pointer for UTextLength May be expensive to compute!
const void * q
(protected) Pointer fields available for use by the text provider.
(public) Function dispatch table for UText.
UChar32 utext_next32(UText *ut)
Get the code point at the current iteration position of the UText, and advance the position to the fi...
The provider supports modifying the text via the replace() and copy() functions.
UTextAccess * access
(public) Function pointer for UTextAccess.
UChar32 utext_char32At(UText *ut, int64_t nativeIndex)
Returns the code point at the requested index, or U_SENTINEL (-1) if it is out of bounds...
#define U_CDECL_BEGIN
This is used to begin a declaration of a library private ICU C API.
Replaceable is an abstract base class representing a string of characters that supports the replaceme...
Text provider owns the text storage.
const void * p
(protected) Pointer fields available for use by the text provider.
void utext_copy(UText *ut, int64_t nativeStart, int64_t nativeLimit, int64_t destIndex, UBool move, UErrorCode *status)
Copy or move a substring from one position to another within the text, while retaining any metadata a...
UTextCopy * copy
(public) Function pointer for UTextCopy.
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
Abstract class that defines an API for iteration on text objects.
UBool utext_equals(const UText *a, const UText *b)
Compare two UText objects for equality.
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
UChar32 utext_current32(UText *ut)
Get the code point at the current iteration position, or U_SENTINEL (-1) if the iteration has reached...
const UChar * chunkContents
(protected) pointer to a chunk of text in UTF-16 format.
UText * utext_openCharacterIterator(UText *ut, icu::CharacterIterator *ci, UErrorCode *status)
Open a UText implementation over an ICU CharacterIterator.
int32_t tableSize
(public) Function table size, sizeof(UTextFuncs) Intended for use should the table grow to accommodat...
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
int32_t privB
Private field reserved for future use by the UText framework itself.
UBool UTextAccess(UText *ut, int64_t nativeIndex, UBool forward)
Function type declaration for UText.access().
int32_t chunkOffset
(protected) Current iteration position within the text chunk (UTF-16 buffer).
int32_t extraSize
(protected) Size in bytes of the extra space (pExtra).
UChar32 utext_next32From(UText *ut, int64_t nativeIndex)
Set the iteration index and return the code point at that index.
int64_t UTextMapOffsetToNative(const UText *ut)
Function type declaration for UText.mapOffsetToNative().
int64_t utext_getPreviousNativeIndex(UText *ut)
Get the native index of the character preceding the current position.
int32_t utext_extract(UText *ut, int64_t nativeStart, int64_t nativeLimit, UChar *dest, int32_t destCapacity, UErrorCode *status)
Extract text from a UText into a UChar buffer.
C API: Unicode Properties.
It is potentially time consuming for the provider to determine the length of the text.
int32_t UTextMapNativeIndexToUTF16(const UText *ut, int64_t nativeIndex)
Function type declaration for UText.mapIndexToUTF16().
void utext_setNativeIndex(UText *ut, int64_t nativeIndex)
Set the current iteration position to the nearest code point boundary at or preceding the specified i...
uint16_t UChar
The base type for UTF-16 code units and pointers.
#define U_CDECL_END
This is used to end a declaration of a library private ICU C API.
int64_t privA
Private field reserved for future use by the UText framework itself.
There is meta data associated with the text.
const void * r
(protected) Pointer fields available for use by the text provider.
UBool utext_moveIndex32(UText *ut, int32_t delta)
Move the iterator position by delta code points.
UText * utext_clone(UText *dest, const UText *src, UBool deep, UBool readOnly, UErrorCode *status)
Clone a UText.
int64_t chunkNativeLimit
(protected) Native index of the first character position following the current chunk.
int32_t sizeOfStruct
(public) sizeOfStruct=sizeof(UText) Allows possible backward compatible extension.
UTextClose * spare2
(private) Spare function pointer
int32_t b
(protected) Integer field reserved for use by the text provider.
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
"Smart pointer" class, closes a UText via utext_close().
int64_t utext_getNativeIndex(const UText *ut)
Get the current iterator position, which can range from 0 to the length of the text.
const UTextFuncs * pFuncs
(public) Pointer to Dispatch table for accessing functions for this UText.
UText * utext_openReplaceable(UText *ut, icu::Replaceable *rep, UErrorCode *status)
Open a writable UText implementation for an ICU Replaceable object.
UTextClose * spare1
(private) Spare function pointer
uint32_t magic
(private) Magic.
UText * utext_openUnicodeString(UText *ut, icu::UnicodeString *s, UErrorCode *status)
Open a writable UText for a non-const UnicodeString.
int32_t UTextReplace(UText *ut, int64_t nativeStart, int64_t nativeLimit, const UChar *replacementText, int32_t replacmentLength, UErrorCode *status)
Function type declaration for UText.replace().
UTextReplace * replace
(public) Function pointer for UTextReplace.
Basic definitions for ICU, for both C and C++ APIs.
UBool utext_isLengthExpensive(const UText *ut)
Return TRUE if calculating the length of the text could be expensive.
UText * utext_openConstUnicodeString(UText *ut, const icu::UnicodeString *s, UErrorCode *status)
Open a UText for a const UnicodeString.
int32_t utext_replace(UText *ut, int64_t nativeStart, int64_t nativeLimit, const UChar *replacementText, int32_t replacementLength, UErrorCode *status)
Replace a range of the original text with a replacement text.
Text chunks remain valid and usable until the text object is modified or deleted, not just until the ...
const void * context
(protected) Pointer to string or text-containing object or similar.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
UText * utext_close(UText *ut)
Close function for UText instances.
C++ API: Character Iterator.
UTextMapOffsetToNative * mapOffsetToNative
(public) Function pointer for UTextMapOffsetToNative.
UText * utext_setup(UText *ut, int32_t extraSpace, UErrorCode *status)
Common function for use by Text Provider implementations to allocate and/or initialize a new UText st...
UBool utext_hasMetaData(const UText *ut)
Test whether there is meta data associated with the text.
UText * utext_openUChars(UText *ut, const UChar *s, int64_t length, UErrorCode *status)
Open a read-only UText for UChar * string.
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
int8_t UBool
The ICU boolean type.
C++ API: Replaceable String.