]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/i18n/quantityformatter.h
ICU-551.24.tar.gz
[apple/icu.git] / icuSources / i18n / quantityformatter.h
index 5dceaf652dceb101025fee1b31374c745db1cc17..4e19085964e9a44a519e404f3eb00addc3b94db3 100644 (file)
@@ -12,6 +12,8 @@
 #include "unicode/utypes.h"
 #include "unicode/uobject.h"
 
+#if !UCONFIG_NO_FORMATTING
+
 U_NAMESPACE_BEGIN
 
 class SimplePatternFormatter;
@@ -35,7 +37,6 @@ class FieldPosition;
  * 
  */
 class U_I18N_API QuantityFormatter : public UMemory {
-// TODO(Travis Keep): Add test for copy constructor, assignment, and reset.
 public:
     /**
      * Default constructor.
@@ -68,7 +69,7 @@ public:
       * @param variant "zero", "one", "two", "few", "many", "other"
       * @param rawPattern the pattern for the variant e.g "{0} meters"
       * @param status any error returned here.
-      * @return TRUE on success; FALSE otherwise.
+      * @return TRUE on success; FALSE if status was set to a non zero error.
       */
     UBool add(
             const char *variant,
@@ -80,6 +81,13 @@ public:
      */
     UBool isValid() const;
 
+    /**
+     * Gets the pattern formatter that would be used for a particular variant.
+     * If isValid() returns TRUE, this method is guaranteed to return a
+     * non-NULL value.
+     */
+    const SimplePatternFormatter *getByVariant(const char *variant) const;
+
     /**
      * Formats a quantity with this object appending the result to appendTo.
      * At least the "other" variant must be added to this object for this
@@ -107,3 +115,5 @@ private:
 U_NAMESPACE_END
 
 #endif
+
+#endif