Index: source/i18n/unicode/rbnf.h |
diff --git a/source/i18n/unicode/rbnf.h b/source/i18n/unicode/rbnf.h |
index 398454b287766d65b947f08dcfa6de1e8219d669..8d619862f2aa990da8ea339d98bc832bbe2627e1 100644 |
--- a/source/i18n/unicode/rbnf.h |
+++ b/source/i18n/unicode/rbnf.h |
@@ -1,6 +1,6 @@ |
/* |
******************************************************************************* |
-* Copyright (C) 1997-2014, International Business Machines Corporation and others. |
+* Copyright (C) 1997-2015, International Business Machines Corporation and others. |
* All Rights Reserved. |
******************************************************************************* |
*/ |
@@ -38,6 +38,7 @@ |
U_NAMESPACE_BEGIN |
+class NFRule; |
class NFRuleSet; |
class LocalizationInfo; |
class PluralFormat; |
@@ -264,17 +265,47 @@ enum URBNFRuleSetTag { |
* </tr> |
* <tr> |
* <td>x.x:</td> |
- * <td>The rule is an <em>improper fraction rule.</em></td> |
+ * <td>The rule is an <em>improper fraction rule</em>. If the full stop in |
+ * the middle of the rule name is replaced with the decimal point |
+ * that is used in the language or DecimalFormatSymbols, then that rule will |
+ * have precedence when formatting and parsing this rule. For example, some |
+ * languages use the comma, and can thus be written as x,x instead. For example, |
+ * you can use "x.x: << point >>;x,x: << comma >>;" to |
+ * handle the decimal point that matches the language's natural spelling of |
+ * the punctuation of either the full stop or comma.</td> |
* </tr> |
* <tr> |
* <td>0.x:</td> |
- * <td>The rule is a <em>proper fraction rule.</em></td> |
+ * <td>The rule is a <em>proper fraction rule</em>. If the full stop in |
+ * the middle of the rule name is replaced with the decimal point |
+ * that is used in the language or DecimalFormatSymbols, then that rule will |
+ * have precedence when formatting and parsing this rule. For example, some |
+ * languages use the comma, and can thus be written as 0,x instead. For example, |
+ * you can use "0.x: point >>;0,x: comma >>;" to |
+ * handle the decimal point that matches the language's natural spelling of |
+ * the punctuation of either the full stop or comma.</td> |
* </tr> |
* <tr> |
* <td>x.0:</td> |
- * <td>The rule is a <em>master rule.</em></td> |
+ * <td>The rule is a <em>master rule</em>. If the full stop in |
+ * the middle of the rule name is replaced with the decimal point |
+ * that is used in the language or DecimalFormatSymbols, then that rule will |
+ * have precedence when formatting and parsing this rule. For example, some |
+ * languages use the comma, and can thus be written as x,0 instead. For example, |
+ * you can use "x.0: << point;x,0: << comma;" to |
+ * handle the decimal point that matches the language's natural spelling of |
+ * the punctuation of either the full stop or comma.</td> |
* </tr> |
* <tr> |
+ * <td>Inf:</td> |
+ * <td>The rule for infinity.</td> |
+ * </tr> |
+ * <tr> |
+ * <td>NaN:</td> |
+ * <td>The rule for an IEEE 754 NaN (not a number).</td> |
+ * </tr> |
+ * <tr> |
+ * <tr> |
* <td><em>nothing</em></td> |
* <td>If the rule's rule descriptor is left out, the base value is one plus the |
* preceding rule's base value (or zero if this is the first rule in the list) in a normal |
@@ -619,7 +650,7 @@ public: |
* locale. There are four legal values: URBNF_SPELLOUT, which creates a formatter that |
* spells out a value in words in the desired language, URBNF_ORDINAL, which attaches |
* an ordinal suffix from the desired language to the end of a number (e.g. "123rd"), |
- * URBNF_DURATION, which formats a duration in seconds as hours, minutes, and seconds, |
+ * URBNF_DURATION, which formats a duration in seconds as hours, minutes, and seconds always rounding down, |
* and URBNF_NUMBERING_SYSTEM, which is used to invoke rules for alternate numbering |
* systems such as the Hebrew numbering system, or for Roman Numerals, etc. |
* @param locale The locale for the formatter. |
@@ -913,7 +944,6 @@ public: |
*/ |
virtual UnicodeString getDefaultRuleSetName() const; |
- /* Cannot use #ifndef U_HIDE_DRAFT_API for the following draft method since it is virtual */ |
/** |
* Set a particular UDisplayContext value in the formatter, such as |
* UDISPCTX_CAPITALIZATION_FOR_STANDALONE. Note: For getContext, see |
@@ -922,7 +952,7 @@ public: |
* @param status Input/output status. If at entry this indicates a failure |
* status, the function will do nothing; otherwise this will be |
* updated with any new status from the function. |
- * @draft ICU 53 |
+ * @stable ICU 53 |
*/ |
virtual void setContext(UDisplayContext value, UErrorCode& status); |
@@ -981,11 +1011,17 @@ private: |
/* friend access */ |
friend class NFSubstitution; |
friend class NFRule; |
+ friend class NFRuleSet; |
friend class FractionalPartSubstitution; |
inline NFRuleSet * getDefaultRuleSet() const; |
const RuleBasedCollator * getCollator() const; |
- DecimalFormatSymbols * getDecimalFormatSymbols() const; |
+ DecimalFormatSymbols * initializeDecimalFormatSymbols(UErrorCode &status); |
+ const DecimalFormatSymbols * getDecimalFormatSymbols() const; |
+ NFRule * initializeDefaultInfinityRule(UErrorCode &status); |
+ const NFRule * getDefaultInfinityRule() const; |
+ NFRule * initializeDefaultNaNRule(UErrorCode &status); |
+ const NFRule * getDefaultNaNRule() const; |
PluralFormat *createPluralFormat(UPluralType pluralType, const UnicodeString &pattern, UErrorCode& status) const; |
UnicodeString& adjustForCapitalizationContext(int32_t startPos, UnicodeString& currentResult) const; |
@@ -997,6 +1033,8 @@ private: |
Locale locale; |
RuleBasedCollator* collator; |
DecimalFormatSymbols* decimalFormatSymbols; |
+ NFRule *defaultInfinityRule; |
+ NFRule *defaultNaNRule; |
UBool lenient; |
UnicodeString* lenientParseRules; |
LocalizationInfo* localizations; |