+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
*
-* Copyright (C) 2004-2006, International Business Machines
+* Copyright (C) 2004-2012, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
* file name: utext.h
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
#include "unicode/utypes.h"
-#ifdef XP_CPLUSPLUS
+#include "unicode/uchar.h"
+#if U_SHOW_CPLUSPLUS_API
+#include "unicode/localpointer.h"
#include "unicode/rep.h"
#include "unicode/unistr.h"
#include "unicode/chariter.h"
-#endif
+#endif // U_SHOW_CPLUSPLUS_API
U_CDECL_BEGIN
struct UText;
-typedef struct UText UText; /**< C typedef for struct UText. @draft ICU 3.6 */
+typedef struct UText UText; /**< C typedef for struct UText. @stable ICU 3.6 */
/***************************************************************************************
* returned by this function, and may be safely used again in
* a subsequent utext_open.
*
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
-U_DRAFT UText * U_EXPORT2
+U_STABLE UText * U_EXPORT2
utext_close(UText *ut);
+#if U_SHOW_CPLUSPLUS_API
+
+U_NAMESPACE_BEGIN
+
+/**
+ * \class LocalUTextPointer
+ * "Smart pointer" class, closes a UText via utext_close().
+ * For most methods see the LocalPointerBase base class.
+ *
+ * @see LocalPointerBase
+ * @see LocalPointer
+ * @stable ICU 4.4
+ */
+U_DEFINE_LOCAL_OPEN_POINTER(LocalUTextPointer, UText, utext_close);
+
+U_NAMESPACE_END
+
+#endif // U_SHOW_CPLUSPLUS_API
/**
* Open a read-only UText implementation for UTF-8 strings.
* @param status Errors are returned here.
* @return A pointer to the UText. If a pre-allocated UText was provided, it
* will always be used and returned.
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
-U_DRAFT UText * U_EXPORT2
+U_STABLE UText * U_EXPORT2
utext_openUTF8(UText *ut, const char *s, int64_t length, UErrorCode *status);
* @param status Errors are returned here.
* @return A pointer to the UText. If a pre-allocated UText was provided, it
* will always be used and returned.
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
-U_DRAFT UText * U_EXPORT2
+U_STABLE UText * U_EXPORT2
utext_openUChars(UText *ut, const UChar *s, int64_t length, UErrorCode *status);
-#ifdef XP_CPLUSPLUS
+#if U_SHOW_CPLUSPLUS_API
/**
* Open a writable UText for a non-const UnicodeString.
*
* @param status Errors are returned here.
* @return Pointer to the UText. If a UText was supplied as input, this
* will always be used and returned.
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
-U_DRAFT UText * U_EXPORT2
-utext_openUnicodeString(UText *ut, UnicodeString *s, UErrorCode *status);
+U_STABLE UText * U_EXPORT2
+utext_openUnicodeString(UText *ut, icu::UnicodeString *s, UErrorCode *status);
/**
* @param status Errors are returned here.
* @return Pointer to the UText. If a UText was supplied as input, this
* will always be used and returned.
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
-U_DRAFT UText * U_EXPORT2
-utext_openConstUnicodeString(UText *ut, const UnicodeString *s, UErrorCode *status);
+U_STABLE UText * U_EXPORT2
+utext_openConstUnicodeString(UText *ut, const icu::UnicodeString *s, UErrorCode *status);
/**
* @return Pointer to the UText. If a UText was supplied as input, this
* will always be used and returned.
* @see Replaceable
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
-U_DRAFT UText * U_EXPORT2
-utext_openReplaceable(UText *ut, Replaceable *rep, UErrorCode *status);
+U_STABLE UText * U_EXPORT2
+utext_openReplaceable(UText *ut, icu::Replaceable *rep, UErrorCode *status);
/**
* Open a UText implementation over an ICU CharacterIterator.
* @return Pointer to the UText. If a UText was supplied as input, this
* will always be used and returned.
* @see Replaceable
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
-U_DRAFT UText * U_EXPORT2
-utext_openCharacterIterator(UText *ut, CharacterIterator *ic, UErrorCode *status);
+U_STABLE UText * U_EXPORT2
+utext_openCharacterIterator(UText *ut, icu::CharacterIterator *ci, UErrorCode *status);
-#endif
+#endif // U_SHOW_CPLUSPLUS_API
/**
* will be returned if the text provider is unable to clone the
* original text.
* @return The newly created clone, or NULL if the clone operation failed.
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
-U_DRAFT UText * U_EXPORT2
+U_STABLE UText * U_EXPORT2
utext_clone(UText *dest, const UText *src, UBool deep, UBool readOnly, UErrorCode *status);
* @param a The first of the two UTexts to compare.
* @param b The other UText to be compared.
* @return TRUE if the two UTexts are equal.
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
-U_DRAFT UBool U_EXPORT2
+U_STABLE UBool U_EXPORT2
utext_equals(const UText *a, const UText *b);
/*****************************************************************************
*
- * Functions to work with the text represeted by a UText wrapper
+ * Functions to work with the text represented by a UText wrapper
*
*****************************************************************************/
* @param ut the text to be accessed.
* @return the length of the text, expressed in native units.
*
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
-U_DRAFT int64_t U_EXPORT2
+U_STABLE int64_t U_EXPORT2
utext_nativeLength(UText *ut);
/**
*
* @param ut the text to be accessed.
* @return TRUE if determining the length of the text could be time consuming.
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
-U_DRAFT UBool U_EXPORT2
+U_STABLE UBool U_EXPORT2
utext_isLengthExpensive(const UText *ut);
/**
*
* The iteration position will be set to the start of the returned code point.
*
- * This function is roughly equivalent to the the sequence
+ * This function is roughly equivalent to the sequence
* utext_setNativeIndex(index);
* utext_current32();
* (There is a subtle difference if the index is out of bounds by being less than zero -
* to other than the first unit of a multi-unit character, it will be adjusted
* to the start of the character.
* @return the code point at the specified index.
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
-U_DRAFT UChar32 U_EXPORT2
+U_STABLE UChar32 U_EXPORT2
utext_char32At(UText *ut, int64_t nativeIndex);
*
* @param ut the text to be accessed.
* @return the Unicode code point at the current iterator position.
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
-U_DRAFT UChar32 U_EXPORT2
+U_STABLE UChar32 U_EXPORT2
utext_current32(UText *ut);
* @param ut the text to be accessed.
* @return the Unicode code point at the iteration position.
* @see UTEXT_NEXT32
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
-U_DRAFT UChar32 U_EXPORT2
+U_STABLE UChar32 U_EXPORT2
utext_next32(UText *ut);
* @return the previous UChar32 code point, or U_SENTINEL (-1)
* if the iteration has reached the start of the text.
* @see UTEXT_PREVIOUS32
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
-U_DRAFT UChar32 U_EXPORT2
+U_STABLE UChar32 U_EXPORT2
utext_previous32(UText *ut);
* @param nativeIndex Iteration index, in the native units of the text provider.
* @return Code point which starts at or before index,
* or U_SENTINEL (-1) if it is out of bounds.
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
-U_DRAFT UChar32 U_EXPORT2
+U_STABLE UChar32 U_EXPORT2
utext_next32From(UText *ut, int64_t nativeIndex);
* @return Code point preceding the one at the initial index,
* or U_SENTINEL (-1) if it is out of bounds.
*
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
-U_DRAFT UChar32 U_EXPORT2
+U_STABLE UChar32 U_EXPORT2
utext_previous32From(UText *ut, int64_t nativeIndex);
/**
*
* @param ut the text to be accessed.
* @return the current index position, in the native units of the text provider.
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
-U_DRAFT int64_t U_EXPORT2
+U_STABLE int64_t U_EXPORT2
utext_getNativeIndex(const UText *ut);
/**
*
* @param ut the text to be accessed.
* @param nativeIndex the native unit index of the new iteration position.
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
utext_setNativeIndex(UText *ut, int64_t nativeIndex);
/**
- * Move the iterator postion by delta code points. The number of code points
+ * Move the iterator position by delta code points. The number of code points
* is a signed number; a negative delta will move the iterator backwards,
* towards the start of the text.
* <p>
* @param delta the signed number of code points to move the iteration position.
* @return TRUE if the position could be moved the requested number of positions while
* staying within the range [0 - text length].
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
-U_DRAFT UBool U_EXPORT2
+U_STABLE UBool U_EXPORT2
utext_moveIndex32(UText *ut, int32_t delta);
/**
- * Get the native index of the character preceeding the current position.
+ * Get the native index of the character preceding the current position.
* If the iteration position is already at the start of the text, zero
* is returned.
* The value returned is the same as that obtained from the following sequence,
* native index of the character most recently returned from utext_next().
*
* @param ut the text to be accessed
- * @return the native index of the character preceeding the current index position,
+ * @return the native index of the character preceding the current index position,
* or zero if the current position is at the start of the text.
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
-U_DRAFT int64_t U_EXPORT2
+U_STABLE int64_t U_EXPORT2
utext_getPreviousNativeIndex(UText *ut);
* @param ut the UText from which to extract data.
* @param nativeStart the native index of the first character to extract.\
* If the specified index is out of range,
- * it will be pinned to to be within 0 <= index <= textLength
+ * it will be pinned to be within 0 <= index <= textLength
* @param nativeLimit the native string index of the position following the last
* character to extract. If the specified index is out of range,
- * it will be pinned to to be within 0 <= index <= textLength.
+ * it will be pinned to be within 0 <= index <= textLength.
* nativeLimit must be >= nativeStart.
* @param dest the UChar (UTF-16) buffer into which the extracted text is placed
* @param destCapacity The size, in UChars, of the destination buffer. May be zero
* buffer was too small. Returns number of UChars for preflighting.
* @return Number of UChars in the data to be extracted. Does not include a trailing NUL.
*
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
utext_extract(UText *ut,
int64_t nativeStart, int64_t nativeLimit,
UChar *dest, int32_t destCapacity,
UErrorCode *status);
-#ifndef U_HIDE_DRAFT_API
+
/************************************************************************************
*
* #define inline versions of selected performance-critical text access functions
*
************************************************************************************/
+#ifndef U_HIDE_INTERNAL_API
+/**
+ * inline version of utext_current32(), for performance-critical situations.
+ *
+ * Get the code point at the current iteration position of the UText.
+ * Returns U_SENTINEL (-1) if the position is at the end of the
+ * text.
+ *
+ * @internal ICU 4.4 technology preview
+ */
+#define UTEXT_CURRENT32(ut) \
+ ((ut)->chunkOffset < (ut)->chunkLength && ((ut)->chunkContents)[(ut)->chunkOffset]<0xd800 ? \
+ ((ut)->chunkContents)[((ut)->chunkOffset)] : utext_current32(ut))
+#endif /* U_HIDE_INTERNAL_API */
+
/**
* inline version of utext_next32(), for performance-critical situations.
*
* Returns U_SENTINEL (-1) if the position is at the end of the
* text.
*
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
#define UTEXT_NEXT32(ut) \
((ut)->chunkOffset < (ut)->chunkLength && ((ut)->chunkContents)[(ut)->chunkOffset]<0xd800 ? \
* This is a pre-decrement operation.
* Returns U_SENTINEL (-1) if the position is at the start of the text.
*
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
#define UTEXT_PREVIOUS32(ut) \
((ut)->chunkOffset > 0 && \
* the corresponding UChar (UTF-16) index.
* The returned position will always be aligned to a code point boundary.
*
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
#define UTEXT_GETNATIVEINDEX(ut) \
((ut)->chunkOffset <= (ut)->nativeIndexingLimit? \
* If the index is out of range, it will be pinned to be within
* the range of the input text.
*
- * @draft ICU 3.8
+ * @stable ICU 3.8
*/
#define UTEXT_SETNATIVEINDEX(ut, ix) \
{ int64_t __offset = (ix) - (ut)->chunkNativeStart; \
- if (__offset>=0 && __offset<=(int64_t)(ut)->nativeIndexingLimit) { \
+ if (__offset>=0 && __offset<(int64_t)(ut)->nativeIndexingLimit && (ut)->chunkContents[__offset]<0xdc00) { \
(ut)->chunkOffset=(int32_t)__offset; \
} else { \
utext_setNativeIndex((ut), (ix)); } }
-#endif
-
/************************************************************************************
*
* Functions related to writing or modifying the text.
* @see utext_freeze()
* @see utext_replace()
* @see utext_copy()
- * @draft ICU 3.4
+ * @stable ICU 3.4
*
*/
-U_DRAFT UBool U_EXPORT2
+U_STABLE UBool U_EXPORT2
utext_isWritable(const UText *ut);
*
* @param ut The UText to be tested
* @return TRUE if the underlying text includes meta data.
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
-U_DRAFT UBool U_EXPORT2
+U_STABLE UBool U_EXPORT2
utext_hasMetaData(const UText *ut);
* @return The signed number of (native) storage units by which
* the length of the text expanded or contracted.
*
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
utext_replace(UText *ut,
int64_t nativeStart, int64_t nativeLimit,
const UChar *replacementText, int32_t replacementLength,
* @param move If TRUE, then the substring is moved, not copied/duplicated.
* @param status receives any error status. Possible errors include U_NO_WRITE_PERMISSION
*
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
utext_copy(UText *ut,
int64_t nativeStart, int64_t nativeLimit,
int64_t destIndex,
* Caution: freezing a UText will disable changes made via the specific
* frozen UText wrapper only; it will not have any effect on the ability to
* directly modify the text by bypassing the UText. Any such backdoor modifications
- * are always an error while UText access is occuring because the underlying
+ * are always an error while UText access is occurring because the underlying
* text can get out of sync with UText's buffering.
* </p>
*
* @param ut The UText to be frozen.
* @see utext_isWritable()
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
utext_freeze(UText *ut);
-#ifndef U_HIDE_DRAFT_API
/**
* UText provider properties (bit field indexes).
*
* @see UText
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
enum {
/**
* It is potentially time consuming for the provider to determine the length of the text.
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
UTEXT_PROVIDER_LENGTH_IS_EXPENSIVE = 1,
/**
* Text chunks remain valid and usable until the text object is modified or
* deleted, not just until the next time the access() function is called
* (which is the default).
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
UTEXT_PROVIDER_STABLE_CHUNKS = 2,
/**
* The provider supports modifying the text via the replace() and copy()
* functions.
* @see Replaceable
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
UTEXT_PROVIDER_WRITABLE = 3,
/**
* There is meta data associated with the text.
* @see Replaceable::hasMetaData()
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
UTEXT_PROVIDER_HAS_META_DATA = 4,
/**
* Generally occurs as the result of a deep clone of the UText.
* When closing the UText, the associated text must
* also be closed/deleted/freed/ whatever is appropriate.
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
UTEXT_PROVIDER_OWNS_TEXT = 5
};
* original text.
* @return The newly created clone, or NULL if the clone operation failed.
*
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
typedef UText * U_CALLCONV
UTextClone(UText *dest, const UText *src, UBool deep, UErrorCode *status);
* @param ut the UText to get the length of.
* @return the length, in the native units of the original text string.
* @see UText
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
typedef int64_t U_CALLCONV
UTextNativeLength(UText *ut);
* (the requested index is out of bounds).
*
* @see UText
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
typedef UBool U_CALLCONV
UTextAccess(UText *ut, int64_t nativeIndex, UBool forward);
* be NUL-terminated if there is sufficient space in the destination buffer.
*
* @param ut the UText from which to extract data.
- * @param nativeStart the native index of the first characer to extract.
+ * @param nativeStart the native index of the first character to extract.
* @param nativeLimit the native string index of the position following the last
* character to extract.
* @param dest the UChar (UTF-16) buffer into which the extracted text is placed
* preflighting.
* @return Number of UChars in the data. Does not include a trailing NUL.
*
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
typedef int32_t U_CALLCONV
UTextExtract(UText *ut,
* @return The signed number of (native) storage units by which
* the length of the text expanded or contracted.
*
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
typedef int32_t U_CALLCONV
UTextReplace(UText *ut,
* @param move If TRUE, then the substring is moved, not copied/duplicated.
* @param status receives any error status. Possible errors include U_NO_WRITE_PERMISSION
*
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
typedef void U_CALLCONV
UTextCopy(UText *ut,
* @return Absolute (native) index corresponding to chunkOffset in the current chunk.
* The returned native index should always be to a code point boundary.
*
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
typedef int64_t U_CALLCONV
UTextMapOffsetToNative(const UText *ut);
* @return Chunk-relative UTF-16 offset corresponding to the specified native
* index.
*
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
typedef int32_t U_CALLCONV
UTextMapNativeIndexToUTF16(const UText *ut, int64_t nativeIndex);
*
* @param ut A UText object to be closed.
*
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
typedef void U_CALLCONV
UTextClose(UText *ut);
* Each text provider implementation must provide an
* actual table that is initialized with the appropriate functions
* for the type of text being handled.
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
struct UTextFuncs {
/**
* (public) Function table size, sizeof(UTextFuncs)
- * Intended for use should the table grow to accomodate added
+ * Intended for use should the table grow to accommodate added
* functions in the future, to allow tests for older format
* function tables that do not contain the extensions.
*
* 4 pointers,
* 2 64-bit fields
* in sequence.
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
int32_t tableSize;
* Do not use, reserved for use by the UText framework only.
* @internal
*/
- int32_t reserved1, reserved2, reserved3;
+ int32_t reserved1, /** @internal */ reserved2, /** @internal */ reserved3;
/**
* (public) Function pointer for UTextClone
*
* @see UTextClone
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
UTextClone *clone;
* May be expensive to compute!
*
* @see UTextLength
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
UTextNativeLength *nativeLength;
* (public) Function pointer for UTextAccess.
*
* @see UTextAccess
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
UTextAccess *access;
* (public) Function pointer for UTextExtract.
*
* @see UTextExtract
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
UTextExtract *extract;
* (public) Function pointer for UTextReplace.
*
* @see UTextReplace
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
UTextReplace *replace;
* (public) Function pointer for UTextCopy.
*
* @see UTextCopy
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
UTextCopy *copy;
* (public) Function pointer for UTextMapOffsetToNative.
*
* @see UTextMapOffsetToNative
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
UTextMapOffsetToNative *mapOffsetToNative;
* (public) Function pointer for UTextMapNativeIndexToUTF16.
*
* @see UTextMapNativeIndexToUTF16
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
UTextMapNativeIndexToUTF16 *mapNativeIndexToUTF16;
* (public) Function pointer for UTextClose.
*
* @see UTextClose
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
UTextClose *close;
* (private) Spare function pointer
* @internal
*/
-
UTextClose *spare1;
+
/**
* (private) Spare function pointer
* @internal
UTextClose *spare3;
};
+/**
+ * Function dispatch table for UText
+ * @see UTextFuncs
+ */
typedef struct UTextFuncs UTextFuncs;
-#endif
-
-#ifndef U_HIDE_DRAFT_API
/**
* UText struct. Provides the interface between the generic UText access code
* and the UText provider code that works on specific kinds of
* to pass text data to ICU services will have no need to view the
* internals of the UText structs that they open.
*
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
struct UText {
/**
* (private) Magic. Used to help detect when UText functions are handed
- * invalid or unitialized UText structs.
+ * invalid or uninitialized UText structs.
* utext_openXYZ() functions take an initialized,
* but not necessarily open, UText struct as an
* optional fill-in parameter. This magic field
/**
- * Text provider properties. This set of flags is maintainted by the
+ * Text provider properties. This set of flags is maintained by the
* text provider implementation.
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
int32_t providerProperties;
* (public) sizeOfStruct=sizeof(UText)
* Allows possible backward compatible extension.
*
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
int32_t sizeOfStruct;
/**
* (protected) Native index of the first character position following
* the current chunk.
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
int64_t chunkNativeLimit;
/**
* (protected) Size in bytes of the extra space (pExtra).
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
int32_t extraSize;
* chunk (UTF-16) indexing correspond. For UTF-16 sources, value
* will be equal to chunkLength.
*
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
int32_t nativeIndexingLimit;
/**
* (protected) Native index of the first character in the text chunk.
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
int64_t chunkNativeStart;
/**
* (protected) Current iteration position within the text chunk (UTF-16 buffer).
* This is the index to the character that will be returned by utext_next32().
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
int32_t chunkOffset;
/**
* (protected) Length the text chunk (UTF-16 buffer), in UChars.
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
int32_t chunkLength;
* (protected) pointer to a chunk of text in UTF-16 format.
* May refer either to original storage of the source of the text, or
* if conversion was required, to a buffer owned by the UText.
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
const UChar *chunkContents;
/**
* (public) Pointer to Dispatch table for accessing functions for this UText.
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
- UTextFuncs *pFuncs;
-
+ const UTextFuncs *pFuncs;
+
/**
* (protected) Pointer to additional space requested by the
* text provider during the utext_open operation.
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
void *pExtra;
/**
- * (protected) Pointer to string or text-containin object or similar.
+ * (protected) Pointer to string or text-containing object or similar.
* This is the source of the text that this UText is wrapping, in a format
* that is known to the text provider functions.
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
const void *context;
/**
* (protected) Pointer fields available for use by the text provider.
* Not used by UText common code.
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
const void *p;
/**
* (protected) Pointer fields available for use by the text provider.
* Not used by UText common code.
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
const void *q;
/**
* (protected) Pointer fields available for use by the text provider.
* Not used by UText common code.
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
const void *r;
/**
* (protected) Integer field reserved for use by the text provider.
* Not used by the UText framework, or by the client (user) of the UText.
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
int64_t a;
/**
* (protected) Integer field reserved for use by the text provider.
* Not used by the UText framework, or by the client (user) of the UText.
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
int32_t b;
/**
* (protected) Integer field reserved for use by the text provider.
* Not used by the UText framework, or by the client (user) of the UText.
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
int32_t c;
int32_t privC;
};
-#endif
/**
* Common function for use by Text Provider implementations to allocate and/or initialize
* additional storage.
* @param status Errors are returned here.
* @return pointer to the UText, allocated if necessary, with extra space set up if requested.
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
-U_DRAFT UText * U_EXPORT2
+U_STABLE UText * U_EXPORT2
utext_setup(UText *ut, int32_t extraSpace, UErrorCode *status);
+#ifndef U_HIDE_INTERNAL_API
/**
* @internal
* Value used to help identify correctly initialized UText structs.
enum {
UTEXT_MAGIC = 0x345ad82c
};
-#ifndef U_HIDE_DRAFT_API
+#endif /* U_HIDE_INTERNAL_API */
/**
* initializer to be used with local (stack) instances of a UText
* struct. UText structs must be initialized before passing
* them to one of the utext_open functions.
*
- * @draft ICU 3.6
+ * @stable ICU 3.6
*/
#define UTEXT_INITIALIZER { \
UTEXT_MAGIC, /* magic */ \
}
-#endif /* U_HIDE_DRAFT_API */
-
U_CDECL_END