]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/unicode/simpleformatter.h
ICU-59117.0.1.tar.gz
[apple/icu.git] / icuSources / common / unicode / simpleformatter.h
index 7530cf796fcabe31ad90d1ba70c55c597a03bad5..e111a7187b098ecc0525ba7fdb4dbca12d19c5f8 100644 (file)
@@ -1,3 +1,5 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 /*
 ******************************************************************************
 * Copyright (C) 2014-2016, International Business Machines
@@ -17,8 +19,7 @@
 #include "unicode/utypes.h"
 #include "unicode/unistr.h"
 
-#ifndef U_HIDE_DRAFT_API
-
+#if U_SHOW_CPLUSPLUS_API
 U_NAMESPACE_BEGIN
 
 /**
@@ -47,15 +48,15 @@ U_NAMESPACE_BEGIN
  *
  * @see MessageFormat
  * @see UMessagePatternApostropheMode
- * @draft ICU 57
+ * @stable ICU 57
  */
 class U_COMMON_API SimpleFormatter U_FINAL : public UMemory {
 public:
     /**
      * Default constructor.
-     * @draft ICU 57
+     * @stable ICU 57
      */
-    SimpleFormatter() : compiledPattern((UChar)0) {}
+    SimpleFormatter() : compiledPattern((char16_t)0) {}
 
     /**
      * Constructs a formatter from the pattern string.
@@ -64,7 +65,7 @@ public:
      * @param errorCode ICU error code in/out parameter.
      *                  Must fulfill U_SUCCESS before the function call.
      *                  Set to U_ILLEGAL_ARGUMENT_ERROR for bad argument syntax.
-     * @draft ICU 57
+     * @stable ICU 57
      */
     SimpleFormatter(const UnicodeString& pattern, UErrorCode &errorCode) {
         applyPattern(pattern, errorCode);
@@ -82,7 +83,7 @@ public:
      *                  Must fulfill U_SUCCESS before the function call.
      *                  Set to U_ILLEGAL_ARGUMENT_ERROR for bad argument syntax and
      *                  too few or too many arguments.
-     * @draft ICU 57
+     * @stable ICU 57
      */
     SimpleFormatter(const UnicodeString& pattern, int32_t min, int32_t max,
                     UErrorCode &errorCode) {
@@ -91,20 +92,20 @@ public:
 
     /**
      * Copy constructor.
-     * @draft ICU 57
+     * @stable ICU 57
      */
     SimpleFormatter(const SimpleFormatter& other)
             : compiledPattern(other.compiledPattern) {}
 
     /**
      * Assignment operator.
-     * @draft ICU 57
+     * @stable ICU 57
      */
     SimpleFormatter &operator=(const SimpleFormatter& other);
 
     /**
      * Destructor.
-     * @draft ICU 57
+     * @stable ICU 57
      */
     ~SimpleFormatter();
 
@@ -116,7 +117,7 @@ public:
      *                  Must fulfill U_SUCCESS before the function call.
      *                  Set to U_ILLEGAL_ARGUMENT_ERROR for bad argument syntax.
      * @return TRUE if U_SUCCESS(errorCode).
-     * @draft ICU 57
+     * @stable ICU 57
      */
     UBool applyPattern(const UnicodeString &pattern, UErrorCode &errorCode) {
         return applyPatternMinMaxArguments(pattern, 0, INT32_MAX, errorCode);
@@ -135,14 +136,14 @@ public:
      *                  Set to U_ILLEGAL_ARGUMENT_ERROR for bad argument syntax and
      *                  too few or too many arguments.
      * @return TRUE if U_SUCCESS(errorCode).
-     * @draft ICU 57
+     * @stable ICU 57
      */
     UBool applyPatternMinMaxArguments(const UnicodeString &pattern,
                                       int32_t min, int32_t max, UErrorCode &errorCode);
 
     /**
      * @return The max argument number + 1.
-     * @draft ICU 57
+     * @stable ICU 57
      */
     int32_t getArgumentLimit() const {
         return getArgumentLimit(compiledPattern.getBuffer(), compiledPattern.length());
@@ -158,7 +159,7 @@ public:
      * @param errorCode ICU error code in/out parameter.
      *                  Must fulfill U_SUCCESS before the function call.
      * @return appendTo
-     * @draft ICU 57
+     * @stable ICU 57
      */
     UnicodeString &format(
             const UnicodeString &value0,
@@ -175,7 +176,7 @@ public:
      * @param errorCode ICU error code in/out parameter.
      *                  Must fulfill U_SUCCESS before the function call.
      * @return appendTo
-     * @draft ICU 57
+     * @stable ICU 57
      */
     UnicodeString &format(
             const UnicodeString &value0,
@@ -194,7 +195,7 @@ public:
      * @param errorCode ICU error code in/out parameter.
      *                  Must fulfill U_SUCCESS before the function call.
      * @return appendTo
-     * @draft ICU 57
+     * @stable ICU 57
      */
     UnicodeString &format(
             const UnicodeString &value0,
@@ -219,7 +220,7 @@ public:
      * @param errorCode ICU error code in/out parameter.
      *                  Must fulfill U_SUCCESS before the function call.
      * @return appendTo
-     * @draft ICU 57
+     * @stable ICU 57
      */
     UnicodeString &formatAndAppend(
             const UnicodeString *const *values, int32_t valuesLength,
@@ -245,7 +246,7 @@ public:
      * @param errorCode ICU error code in/out parameter.
      *                  Must fulfill U_SUCCESS before the function call.
      * @return result
-     * @draft ICU 57
+     * @stable ICU 57
      */
     UnicodeString &formatAndReplace(
             const UnicodeString *const *values, int32_t valuesLength,
@@ -255,7 +256,7 @@ public:
     /**
      * Returns the pattern text with none of the arguments.
      * Like formatting with all-empty string values.
-     * @draft ICU 57
+     * @stable ICU 57
      */
     UnicodeString getTextWithNoArguments() const {
         return getTextWithNoArguments(compiledPattern.getBuffer(), compiledPattern.length());
@@ -273,15 +274,15 @@ private:
      */
     UnicodeString compiledPattern;
 
-    static inline int32_t getArgumentLimit(const UChar *compiledPattern,
+    static inline int32_t getArgumentLimit(const char16_t *compiledPattern,
                                               int32_t compiledPatternLength) {
         return compiledPatternLength == 0 ? 0 : compiledPattern[0];
     }
 
-    static UnicodeString getTextWithNoArguments(const UChar *compiledPattern, int32_t compiledPatternLength);
+    static UnicodeString getTextWithNoArguments(const char16_t *compiledPattern, int32_t compiledPatternLength);
 
     static UnicodeString &format(
-            const UChar *compiledPattern, int32_t compiledPatternLength,
+            const char16_t *compiledPattern, int32_t compiledPatternLength,
             const UnicodeString *const *values,
             UnicodeString &result, const UnicodeString *resultCopy, UBool forbidResultAsValue,
             int32_t *offsets, int32_t offsetsLength,
@@ -289,7 +290,6 @@ private:
 };
 
 U_NAMESPACE_END
-
-#endif /* U_HIDE_DRAFT_API */
+#endif // U_SHOW_CPLUSPLUS_API
 
 #endif  // __SIMPLEFORMATTER_H__