]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/i18n/unicode/numfmt.h
ICU-66108.tar.gz
[apple/icu.git] / icuSources / i18n / unicode / numfmt.h
index cf188eef996a92e861cffd37185365fec6f4eb11..b770245c967f551243f7659f0af5f7b653e4055a 100644 (file)
@@ -26,6 +26,8 @@
 
 #include "unicode/utypes.h"
 
+#if U_SHOW_CPLUSPLUS_API
+
 /**
  * \file
  * \brief C++ API: Compatibility APIs for number formatting.
@@ -43,7 +45,6 @@
 
 class NumberFormatTest;
 
-#if U_SHOW_CPLUSPLUS_API
 U_NAMESPACE_BEGIN
 
 class SharedNumberFormat;
@@ -261,6 +262,14 @@ public:
      */
     virtual ~NumberFormat();
 
+    /**
+     * Clones this object polymorphically.
+     * The caller owns the result and should delete it when done.
+     * @return clone, or nullptr if an error occurred
+     * @stable ICU 2.0
+     */
+    virtual NumberFormat* clone() const = 0;
+
     /**
      * Return true if the given Format objects are semantically equal.
      * Objects of different subclasses are considered unequal.
@@ -640,7 +649,9 @@ public:
      * @param result        Formattable to be set to the parse result.
      *                      If parse fails, return contents are undefined.
      * @param status        Output parameter set to a failure error code
-     *                      when a failure occurs.
+     *                      when a failure occurs. The error code when the
+     *                      string fails to parse is U_INVALID_FORMAT_ERROR,
+     *                      unless overridden by a subclass.
      * @see                 NumberFormat::isParseIntegerOnly
      * @stable ICU 2.0
      */
@@ -1263,9 +1274,10 @@ NumberFormat::isLenient() const
 }
 
 U_NAMESPACE_END
-#endif // U_SHOW_CPLUSPLUS_API
 
 #endif /* #if !UCONFIG_NO_FORMATTING */
 
+#endif /* U_SHOW_CPLUSPLUS_API */
+
 #endif // _NUMFMT
 //eof