/*
*******************************************************************************
*
-* Copyright (C) 2004-2006, International Business Machines
+* Copyright (C) 2004-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
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);
* @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);
* @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, U_NAMESPACE_QUALIFIER 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 U_NAMESPACE_QUALIFIER 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, U_NAMESPACE_QUALIFIER 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, U_NAMESPACE_QUALIFIER CharacterIterator *ic, UErrorCode *status);
#endif
* 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);
* @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);
/**
* 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);
/**
* @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);
/**
* @param ut the text to be accessed
* @return the native index of the character preceeding 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);
* 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
* 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 4.0
*/
#define UTEXT_SETNATIVEINDEX(ut, ix) \
{ int64_t __offset = (ix) - (ut)->chunkNativeStart; \
-#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,
*
* @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);
* 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 {
/**
* 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;
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 {
/**
/**
* Text provider properties. This set of flags is maintainted 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.
* 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);
/**
enum {
UTEXT_MAGIC = 0x345ad82c
};
-#ifndef U_HIDE_DRAFT_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