U_NAMESPACE_BEGIN
-#ifndef U_HIDE_DRAFT_API
-
class BreakIterator;
class ByteSink;
class Edits;
/**
* Low-level C++ case mapping functions.
*
- * @draft ICU 59
+ * @stable ICU 59
*/
class U_COMMON_API CaseMap U_FINAL : public UMemory {
public:
* the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set.
*
* @see u_strToLower
- * @draft ICU 59
+ * @stable ICU 59
*/
static int32_t toLower(
const char *locale, uint32_t options,
* the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set.
*
* @see u_strToUpper
- * @draft ICU 59
+ * @stable ICU 59
*/
static int32_t toUpper(
const char *locale, uint32_t options,
*
* @see u_strToTitle
* @see ucasemap_toTitle
- * @draft ICU 59
+ * @stable ICU 59
*/
static int32_t toTitle(
const char *locale, uint32_t options, BreakIterator *iter,
* the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set.
*
* @see u_strFoldCase
- * @draft ICU 59
+ * @stable ICU 59
*/
static int32_t fold(
uint32_t options,
char16_t *dest, int32_t destCapacity, Edits *edits,
UErrorCode &errorCode);
+#ifndef U_HIDE_DRAFT_API
/**
* Lowercases a UTF-8 string and optionally records edits.
* Casing is locale-dependent and context-sensitive.
uint32_t options,
StringPiece src, ByteSink &sink, Edits *edits,
UErrorCode &errorCode);
+#endif // U_HIDE_DRAFT_API
/**
* Lowercases a UTF-8 string and optionally records edits.
* the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set.
*
* @see ucasemap_utf8ToLower
- * @draft ICU 59
+ * @stable ICU 59
*/
static int32_t utf8ToLower(
const char *locale, uint32_t options,
* the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set.
*
* @see ucasemap_utf8ToUpper
- * @draft ICU 59
+ * @stable ICU 59
*/
static int32_t utf8ToUpper(
const char *locale, uint32_t options,
* the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set.
*
* @see ucasemap_utf8ToTitle
- * @draft ICU 59
+ * @stable ICU 59
*/
static int32_t utf8ToTitle(
const char *locale, uint32_t options, BreakIterator *iter,
* the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set.
*
* @see ucasemap_utf8FoldCase
- * @draft ICU 59
+ * @stable ICU 59
*/
static int32_t utf8Fold(
uint32_t options,
CaseMap &operator=(const CaseMap &other) = delete;
};
-#endif // U_HIDE_DRAFT_API
-
U_NAMESPACE_END
#endif // __CASEMAP_H__
# define U_ALIASING_BARRIER(ptr) asm volatile("" : : "rm"(ptr) : "memory")
#endif
-// Do not use #ifndef U_HIDE_DRAFT_API for the following class, it
-// is now used in place of UChar* in several stable C++ methods
/**
* char16_t * wrapper with implicit conversion from distinct but bit-compatible pointer types.
- * @draft ICU 59
+ * @stable ICU 59
*/
class U_COMMON_API Char16Ptr U_FINAL {
public:
/**
* Copies the pointer.
* @param p pointer
- * @draft ICU 59
+ * @stable ICU 59
*/
inline Char16Ptr(char16_t *p);
#if !U_CHAR16_IS_TYPEDEF
/**
* Converts the pointer to char16_t *.
* @param p pointer to be converted
- * @draft ICU 59
+ * @stable ICU 59
*/
inline Char16Ptr(uint16_t *p);
#endif
* Converts the pointer to char16_t *.
* (Only defined if U_SIZEOF_WCHAR_T==2.)
* @param p pointer to be converted
- * @draft ICU 59
+ * @stable ICU 59
*/
inline Char16Ptr(wchar_t *p);
#endif
/**
* nullptr constructor.
* @param p nullptr
- * @draft ICU 59
+ * @stable ICU 59
*/
inline Char16Ptr(std::nullptr_t p);
/**
* Destructor.
- * @draft ICU 59
+ * @stable ICU 59
*/
inline ~Char16Ptr();
/**
* Pointer access.
* @return the wrapped pointer
- * @draft ICU 59
+ * @stable ICU 59
*/
inline char16_t *get() const;
/**
* char16_t pointer access via type conversion (e.g., static_cast).
* @return the wrapped pointer
- * @draft ICU 59
+ * @stable ICU 59
*/
inline operator char16_t *() const { return get(); }
#endif
-// Do not use #ifndef U_HIDE_DRAFT_API for the following class, it is
-// now used in place of const UChar* in several stable C++ methods
/**
* const char16_t * wrapper with implicit conversion from distinct but bit-compatible pointer types.
- * @draft ICU 59
+ * @stable ICU 59
*/
class U_COMMON_API ConstChar16Ptr U_FINAL {
public:
/**
* Copies the pointer.
* @param p pointer
- * @draft ICU 59
+ * @stable ICU 59
*/
inline ConstChar16Ptr(const char16_t *p);
#if !U_CHAR16_IS_TYPEDEF
/**
* Converts the pointer to char16_t *.
* @param p pointer to be converted
- * @draft ICU 59
+ * @stable ICU 59
*/
inline ConstChar16Ptr(const uint16_t *p);
#endif
* Converts the pointer to char16_t *.
* (Only defined if U_SIZEOF_WCHAR_T==2.)
* @param p pointer to be converted
- * @draft ICU 59
+ * @stable ICU 59
*/
inline ConstChar16Ptr(const wchar_t *p);
#endif
/**
* nullptr constructor.
* @param p nullptr
- * @draft ICU 59
+ * @stable ICU 59
*/
inline ConstChar16Ptr(const std::nullptr_t p);
/**
* Destructor.
- * @draft ICU 59
+ * @stable ICU 59
*/
inline ~ConstChar16Ptr();
/**
* Pointer access.
* @return the wrapped pointer
- * @draft ICU 59
+ * @stable ICU 59
*/
inline const char16_t *get() const;
/**
* char16_t pointer access via type conversion (e.g., static_cast).
* @return the wrapped pointer
- * @draft ICU 59
+ * @stable ICU 59
*/
inline operator const char16_t *() const { return get(); }
* Includes an aliasing barrier if available.
* @param p pointer
* @return p as const UChar *
- * @draft ICU 59
+ * @stable ICU 59
*/
inline const UChar *toUCharPtr(const char16_t *p) {
#ifdef U_ALIASING_BARRIER
* Includes an aliasing barrier if available.
* @param p pointer
* @return p as UChar *
- * @draft ICU 59
+ * @stable ICU 59
*/
inline UChar *toUCharPtr(char16_t *p) {
#ifdef U_ALIASING_BARRIER
* Includes an aliasing barrier if available.
* @param p pointer
* @return p as const OldUChar *
- * @draft ICU 59
+ * @stable ICU 59
*/
inline const OldUChar *toOldUCharPtr(const char16_t *p) {
#ifdef U_ALIASING_BARRIER
* Includes an aliasing barrier if available.
* @param p pointer
* @return p as OldUChar *
- * @draft ICU 59
+ * @stable ICU 59
*/
inline OldUChar *toOldUCharPtr(char16_t *p) {
#ifdef U_ALIASING_BARRIER
U_NAMESPACE_BEGIN
-#ifndef U_HIDE_DRAFT_API
-
/**
* Records lengths of string edits but not replacement text.
* Supports replacements, insertions, deletions in linear progression.
* An Edits object tracks a separate UErrorCode, but ICU string transformation functions
* (e.g., case mapping functions) merge any such errors into their API's UErrorCode.
*
- * @draft ICU 59
+ * @stable ICU 59
*/
class U_COMMON_API Edits U_FINAL : public UMemory {
public:
/**
* Constructs an empty object.
- * @draft ICU 59
+ * @stable ICU 59
*/
Edits() :
array(stackArray), capacity(STACK_CAPACITY), length(0), delta(0), numChanges(0),
/**
* Destructor.
- * @draft ICU 59
+ * @stable ICU 59
*/
~Edits();
/**
* Resets the data but may not release memory.
- * @draft ICU 59
+ * @stable ICU 59
*/
void reset() U_NOEXCEPT;
/**
* Adds a record for an unchanged segment of text.
* Normally called from inside ICU string transformation functions, not user code.
- * @draft ICU 59
+ * @stable ICU 59
*/
void addUnchanged(int32_t unchangedLength);
/**
* Adds a record for a text replacement/insertion/deletion.
* Normally called from inside ICU string transformation functions, not user code.
- * @draft ICU 59
+ * @stable ICU 59
*/
void addReplace(int32_t oldLength, int32_t newLength);
/**
* and an error occurred while recording edits.
* Otherwise unchanged.
* @return TRUE if U_FAILURE(outErrorCode)
- * @draft ICU 59
+ * @stable ICU 59
*/
UBool copyErrorTo(UErrorCode &outErrorCode);
/**
* How much longer is the new text compared with the old text?
* @return new length minus old length
- * @draft ICU 59
+ * @stable ICU 59
*/
int32_t lengthDelta() const { return delta; }
/**
* @return TRUE if there are any change edits
- * @draft ICU 59
+ * @stable ICU 59
*/
UBool hasChanges() const { return numChanges != 0; }
+#ifndef U_HIDE_DRAFT_API
/**
* @return the number of change edits
* @draft ICU 60
*/
int32_t numberOfChanges() const { return numChanges; }
+#endif // U_HIDE_DRAFT_API
/**
* Access to the list of edits.
* @see getCoarseIterator
* @see getFineIterator
- * @draft ICU 59
+ * @stable ICU 59
*/
struct U_COMMON_API Iterator U_FINAL : public UMemory {
/**
srcIndex(0), replIndex(0), destIndex(0) {}
/**
* Copy constructor.
- * @draft ICU 59
+ * @stable ICU 59
*/
Iterator(const Iterator &other) = default;
/**
* Assignment operator.
- * @draft ICU 59
+ * @stable ICU 59
*/
Iterator &operator=(const Iterator &other) = default;
* or else the function returns immediately. Check for U_FAILURE()
* on output or use with function chaining. (See User Guide for details.)
* @return TRUE if there is another edit
- * @draft ICU 59
+ * @stable ICU 59
*/
UBool next(UErrorCode &errorCode) { return next(onlyChanges_, errorCode); }
* or else the function returns immediately. Check for U_FAILURE()
* on output or use with function chaining. (See User Guide for details.)
* @return TRUE if the edit for the source index was found
- * @draft ICU 59
+ * @stable ICU 59
*/
UBool findSourceIndex(int32_t i, UErrorCode &errorCode) {
return findIndex(i, TRUE, errorCode) == 0;
}
+#ifndef U_HIDE_DRAFT_API
/**
* Finds the edit that contains the destination index.
* The destination index may be found in a non-change
* @draft ICU 60
*/
int32_t sourceIndexFromDestinationIndex(int32_t i, UErrorCode &errorCode);
+#endif // U_HIDE_DRAFT_API
/**
* @return TRUE if this edit replaces oldLength() units with newLength() different ones.
* FALSE if oldLength units remain unchanged.
- * @draft ICU 59
+ * @stable ICU 59
*/
UBool hasChange() const { return changed; }
/**
* @return the number of units in the original string which are replaced or remain unchanged.
- * @draft ICU 59
+ * @stable ICU 59
*/
int32_t oldLength() const { return oldLength_; }
/**
* @return the number of units in the modified string, if hasChange() is TRUE.
* Same as oldLength if hasChange() is FALSE.
- * @draft ICU 59
+ * @stable ICU 59
*/
int32_t newLength() const { return newLength_; }
/**
* @return the current index into the source string
- * @draft ICU 59
+ * @stable ICU 59
*/
int32_t sourceIndex() const { return srcIndex; }
/**
* @return the current index into the replacement-characters-only string,
* not counting unchanged spans
- * @draft ICU 59
+ * @stable ICU 59
*/
int32_t replacementIndex() const { return replIndex; }
/**
* @return the current index into the full destination string
- * @draft ICU 59
+ * @stable ICU 59
*/
int32_t destinationIndex() const { return destIndex; }
* Returns an Iterator for coarse-grained changes for simple string updates.
* Skips non-changes.
* @return an Iterator that merges adjacent changes.
- * @draft ICU 59
+ * @stable ICU 59
*/
Iterator getCoarseChangesIterator() const {
return Iterator(array, length, TRUE, TRUE);
/**
* Returns an Iterator for coarse-grained changes and non-changes for simple string updates.
* @return an Iterator that merges adjacent changes.
- * @draft ICU 59
+ * @stable ICU 59
*/
Iterator getCoarseIterator() const {
return Iterator(array, length, FALSE, TRUE);
* Returns an Iterator for fine-grained changes for modifying styled text.
* Skips non-changes.
* @return an Iterator that separates adjacent changes.
- * @draft ICU 59
+ * @stable ICU 59
*/
Iterator getFineChangesIterator() const {
return Iterator(array, length, TRUE, FALSE);
/**
* Returns an Iterator for fine-grained changes and non-changes for modifying styled text.
* @return an Iterator that separates adjacent changes.
- * @draft ICU 59
+ * @stable ICU 59
*/
Iterator getFineIterator() const {
return Iterator(array, length, FALSE, FALSE);
}
+#ifndef U_HIDE_DRAFT_API
/**
* Merges the two input Edits and appends the result to this object.
*
* @draft ICU 60
*/
Edits &mergeAndAppend(const Edits &ab, const Edits &bc, UErrorCode &errorCode);
+#endif // U_HIDE_DRAFT_API
private:
void releaseArray() U_NOEXCEPT;
uint16_t stackArray[STACK_CAPACITY];
};
-#endif // U_HIDE_DRAFT_API
-
U_NAMESPACE_END
#endif // __EDITS_H__
UParseError *parseErr,
UErrorCode *status);
-#ifndef U_HIDE_DRAFT_API
/**
* Open a new UBreakIterator for locating text boundaries using precompiled binary rules.
* Opening a UBreakIterator this way is substantially faster than using ubrk_openRules.
* @param status Pointer to UErrorCode to receive any errors.
* @return UBreakIterator for the specified rules.
* @see ubrk_getBinaryRules
- * @draft ICU 59
+ * @stable ICU 59
*/
-U_DRAFT UBreakIterator* U_EXPORT2
+U_STABLE UBreakIterator* U_EXPORT2
ubrk_openBinaryRules(const uint8_t *binaryRules, int32_t rulesLength,
const UChar * text, int32_t textLength,
UErrorCode * status);
-#endif /* U_HIDE_DRAFT_API */
-
/**
* Thread safe cloning operation
* @param bi iterator to be cloned
UErrorCode *status);
-#ifndef U_HIDE_DRAFT_API
/**
* Get a compiled binary version of the rules specifying the behavior of a UBreakIterator.
* The binary rules may be used with ubrk_openBinaryRules to open a new UBreakIterator
* otherwise 0. If not preflighting and this is larger than
* rulesCapacity, *status will be set to an error.
* @see ubrk_openBinaryRules
- * @draft ICU 59
+ * @stable ICU 59
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
ubrk_getBinaryRules(UBreakIterator *bi,
uint8_t * binaryRules, int32_t rulesCapacity,
UErrorCode * status);
-#endif /* U_HIDE_DRAFT_API */
-
#endif /* #if !UCONFIG_NO_BREAK_ITERATION */
#endif
* Exception: ICU 58 UChar was defined to UCHAR_TYPE if that macro was defined.
* The current UChar responds to UCHAR_TYPE but OldUChar does not.
*
- * @draft ICU 59
+ * @stable ICU 59
*/
#if U_SIZEOF_WCHAR_T==2
typedef wchar_t OldUChar;
*/
UNISTR_FROM_STRING_EXPLICIT UnicodeString(const char16_t *text);
- /*
- * Do not use #ifndef U_HIDE_DRAFT_API for the following constructor,
- * it should always be available regardless of U_HIDE_DRAFT_API status
- */
#if !U_CHAR16_IS_TYPEDEF
/**
* uint16_t * constructor.
* <code>-DUNISTR_FROM_STRING_EXPLICIT=explicit</code>
* on the compiler command line or similar.
* @param text NUL-terminated UTF-16 string
- * @draft ICU 59
+ * @stable ICU 59
*/
UNISTR_FROM_STRING_EXPLICIT UnicodeString(const uint16_t *text) :
UnicodeString(ConstChar16Ptr(text)) {}
#endif
- /*
- * Do not use #ifndef U_HIDE_DRAFT_API for the following constructor,
- * it should always be available regardless of U_HIDE_DRAFT_API status
- */
#if U_SIZEOF_WCHAR_T==2 || defined(U_IN_DOXYGEN)
/**
* wchar_t * constructor.
* <code>-DUNISTR_FROM_STRING_EXPLICIT=explicit</code>
* on the compiler command line or similar.
* @param text NUL-terminated UTF-16 string
- * @draft ICU 59
+ * @stable ICU 59
*/
UNISTR_FROM_STRING_EXPLICIT UnicodeString(const wchar_t *text) :
UnicodeString(ConstChar16Ptr(text)) {}
#endif
- /*
- * Do not use #ifndef U_HIDE_DRAFT_API for the following constructor,
- * it should always be available regardless of U_HIDE_DRAFT_API status
- */
/**
* nullptr_t constructor.
* Effectively the same as the default constructor, makes an empty string object.
* <code>-DUNISTR_FROM_STRING_EXPLICIT=explicit</code>
* on the compiler command line or similar.
* @param text nullptr
- * @draft ICU 59
+ * @stable ICU 59
*/
UNISTR_FROM_STRING_EXPLICIT inline UnicodeString(const std::nullptr_t text);
UnicodeString(const char16_t *text,
int32_t textLength);
- /*
- * Do not use #ifndef U_HIDE_DRAFT_API for the following constructor,
- * it should always be available regardless of U_HIDE_DRAFT_API status
- */
#if !U_CHAR16_IS_TYPEDEF
/**
* uint16_t * constructor.
* Delegates to UnicodeString(const char16_t *, int32_t).
* @param text UTF-16 string
* @param length string length
- * @draft ICU 59
+ * @stable ICU 59
*/
UnicodeString(const uint16_t *text, int32_t length) :
UnicodeString(ConstChar16Ptr(text), length) {}
#endif
- /*
- * Do not use #ifndef U_HIDE_DRAFT_API for the following constructor,
- * it should always be available regardless of U_HIDE_DRAFT_API status
- */
#if U_SIZEOF_WCHAR_T==2 || defined(U_IN_DOXYGEN)
/**
* wchar_t * constructor.
* Delegates to UnicodeString(const char16_t *, int32_t).
* @param text NUL-terminated UTF-16 string
* @param length string length
- * @draft ICU 59
+ * @stable ICU 59
*/
UnicodeString(const wchar_t *text, int32_t length) :
UnicodeString(ConstChar16Ptr(text), length) {}
#endif
- /*
- * Do not use #ifndef U_HIDE_DRAFT_API for the following constructor,
- * it should always be available regardless of U_HIDE_DRAFT_API status
- */
/**
* nullptr_t constructor.
* Effectively the same as the default constructor, makes an empty string object.
* @param text nullptr
* @param length ignored
- * @draft ICU 59
+ * @stable ICU 59
*/
inline UnicodeString(const std::nullptr_t text, int32_t length);
*/
UnicodeString(char16_t *buffer, int32_t buffLength, int32_t buffCapacity);
- /*
- * Do not use #ifndef U_HIDE_DRAFT_API for the following constructor,
- * it should always be available regardless of U_HIDE_DRAFT_API status
- */
#if !U_CHAR16_IS_TYPEDEF
/**
* Writable-aliasing uint16_t * constructor.
* @param buffer writable buffer of/for UTF-16 text
* @param buffLength length of the current buffer contents
* @param buffCapacity buffer capacity
- * @draft ICU 59
+ * @stable ICU 59
*/
UnicodeString(uint16_t *buffer, int32_t buffLength, int32_t buffCapacity) :
UnicodeString(Char16Ptr(buffer), buffLength, buffCapacity) {}
#endif
- /*
- * Do not use #ifndef U_HIDE_DRAFT_API for the following constructor,
- * it should always be available regardless of U_HIDE_DRAFT_API status
- */
#if U_SIZEOF_WCHAR_T==2 || defined(U_IN_DOXYGEN)
/**
* Writable-aliasing wchar_t * constructor.
* @param buffer writable buffer of/for UTF-16 text
* @param buffLength length of the current buffer contents
* @param buffCapacity buffer capacity
- * @draft ICU 59
+ * @stable ICU 59
*/
UnicodeString(wchar_t *buffer, int32_t buffLength, int32_t buffCapacity) :
UnicodeString(Char16Ptr(buffer), buffLength, buffCapacity) {}
#endif
- /*
- * Do not use #ifndef U_HIDE_DRAFT_API for the following constructor,
- * it should always be available regardless of U_HIDE_DRAFT_API status
- */
/**
* Writable-aliasing nullptr_t constructor.
* Effectively the same as the default constructor, makes an empty string object.
* @param buffer nullptr
* @param buffLength ignored
* @param buffCapacity ignored
- * @draft ICU 59
+ * @stable ICU 59
*/
inline UnicodeString(std::nullptr_t buffer, int32_t buffLength, int32_t buffCapacity);
*/
static MeasureUnit *createPicometer(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns unit of length: point.
* Caller owns returned value and must free it.
* @param status ICU error code.
- * @draft ICU 59
+ * @stable ICU 59
*/
static MeasureUnit *createPoint(UErrorCode &status);
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns unit of length: yard.
UFieldPosition *pos, /* 0 if ignore */
UErrorCode* status);
-#ifndef U_HIDE_DRAFT_API
/**
* Format a double using a UNumberFormat according to the UNumberFormat's locale,
* and initialize a UFieldPositionIterator that enumerates the subcomponents of
* @see unum_parseDouble
* @see UFieldPositionIterator
* @see UNumberFormatFields
-* @draft ICU 59
+* @stable ICU 59
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
unum_formatDoubleForFields(const UNumberFormat* format,
double number,
UChar* result,
UFieldPositionIterator* fpositer,
UErrorCode* status);
-#endif /* U_HIDE_DRAFT_API */
/**
* Format a decimal number using a UNumberFormat.
#endif /* U_HIDE_INTERNAL_API */
-#ifndef U_HIDE_DRAFT_API
/**
* Creates a string enumeration of all plural rule keywords used in this
* UPluralRules object. The rule "other" is always present by default.
* @param status A pointer to a UErrorCode to receive any errors.
* @return a string enumeration over plural rule keywords, or NULL
* upon error. The caller is responsible for closing the result.
- * @draft ICU 59
+ * @stable ICU 59
*/
-U_DRAFT UEnumeration* U_EXPORT2
+U_STABLE UEnumeration* U_EXPORT2
uplrules_getKeywords(const UPluralRules *uplrules,
UErrorCode *status);
-#endif /* U_HIDE_DRAFT_API */
#endif /* #if !UCONFIG_NO_FORMATTING */