| Index: source/i18n/unicode/rbnf.h
|
| diff --git a/source/i18n/unicode/rbnf.h b/source/i18n/unicode/rbnf.h
|
| index 880c740d81ce68f037c44b80cdad9183a1bfec8b..398454b287766d65b947f08dcfa6de1e8219d669 100644
|
| --- a/source/i18n/unicode/rbnf.h
|
| +++ b/source/i18n/unicode/rbnf.h
|
| @@ -1,6 +1,6 @@
|
| /*
|
| *******************************************************************************
|
| -* Copyright (C) 1997-2013, International Business Machines Corporation and others.
|
| +* Copyright (C) 1997-2014, International Business Machines Corporation and others.
|
| * All Rights Reserved.
|
| *******************************************************************************
|
| */
|
| @@ -27,18 +27,21 @@
|
| #else
|
| #define U_HAVE_RBNF 1
|
|
|
| -#include "unicode/coll.h"
|
| #include "unicode/dcfmtsym.h"
|
| #include "unicode/fmtable.h"
|
| #include "unicode/locid.h"
|
| #include "unicode/numfmt.h"
|
| #include "unicode/unistr.h"
|
| #include "unicode/strenum.h"
|
| +#include "unicode/brkiter.h"
|
| +#include "unicode/upluralrules.h"
|
|
|
| U_NAMESPACE_BEGIN
|
|
|
| class NFRuleSet;
|
| class LocalizationInfo;
|
| +class PluralFormat;
|
| +class RuleBasedCollator;
|
|
|
| /**
|
| * Tags for the predefined rulesets.
|
| @@ -53,10 +56,6 @@ enum URBNFRuleSetTag {
|
| URBNF_COUNT
|
| };
|
|
|
| -#if UCONFIG_NO_COLLATION
|
| -class Collator;
|
| -#endif
|
| -
|
| /**
|
| * The RuleBasedNumberFormat class formats numbers according to a set of rules. This number formatter is
|
| * typically used for spelling out numeric values in words (e.g., 25,3476 as
|
| @@ -431,6 +430,24 @@ class Collator;
|
| * <td>in rule in fraction rule set</td>
|
| * <td>Omit the optional text if multiplying the number by the rule's base value yields 1.</td>
|
| * </tr>
|
| + * <tr>
|
| + * <td width="37">$(cardinal,<i>plural syntax</i>)$</td>
|
| + * <td width="23"></td>
|
| + * <td width="165" valign="top">in all rule sets</td>
|
| + * <td>This provides the ability to choose a word based on the number divided by the radix to the power of the
|
| + * exponent of the base value for the specified locale, which is normally equivalent to the << value.
|
| + * This uses the cardinal plural rules from PluralFormat. All strings used in the plural format are treated
|
| + * as the same base value for parsing.</td>
|
| + * </tr>
|
| + * <tr>
|
| + * <td width="37">$(ordinal,<i>plural syntax</i>)$</td>
|
| + * <td width="23"></td>
|
| + * <td width="165" valign="top">in all rule sets</td>
|
| + * <td>This provides the ability to choose a word based on the number divided by the radix to the power of the
|
| + * exponent of the base value for the specified locale, which is normally equivalent to the << value.
|
| + * This uses the ordinal plural rules from PluralFormat. All strings used in the plural format are treated
|
| + * as the same base value for parsing.</td>
|
| + * </tr>
|
| * </table>
|
| *
|
| * <p>The substitution descriptor (i.e., the text between the token characters) may take one
|
| @@ -498,6 +515,8 @@ class Collator;
|
| * @author Richard Gillam
|
| * @see NumberFormat
|
| * @see DecimalFormat
|
| + * @see PluralFormat
|
| + * @see PluralRules
|
| * @stable ICU 2.0
|
| */
|
| class U_I18N_API RuleBasedNumberFormat : public NumberFormat {
|
| @@ -894,6 +913,19 @@ 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
|
| + * NumberFormat.
|
| + * @param value The UDisplayContext value to set.
|
| + * @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
|
| + */
|
| + virtual void setContext(UDisplayContext value, UErrorCode& status);
|
| +
|
| public:
|
| /**
|
| * ICU "poor man's RTTI", returns a UClassID for this class.
|
| @@ -939,6 +971,7 @@ private:
|
| const Locale& locale, UParseError& perror, UErrorCode& status);
|
|
|
| void init(const UnicodeString& rules, LocalizationInfo* localizations, UParseError& perror, UErrorCode& status);
|
| + void initCapitalizationContextInfo(const Locale& thelocale);
|
| void dispose();
|
| void stripWhitespace(UnicodeString& src);
|
| void initDefaultRuleSet();
|
| @@ -951,8 +984,10 @@ private:
|
| friend class FractionalPartSubstitution;
|
|
|
| inline NFRuleSet * getDefaultRuleSet() const;
|
| - Collator * getCollator() const;
|
| + const RuleBasedCollator * getCollator() const;
|
| DecimalFormatSymbols * getDecimalFormatSymbols() const;
|
| + PluralFormat *createPluralFormat(UPluralType pluralType, const UnicodeString &pattern, UErrorCode& status) const;
|
| + UnicodeString& adjustForCapitalizationContext(int32_t startPos, UnicodeString& currentResult) const;
|
|
|
| private:
|
| NFRuleSet **ruleSets;
|
| @@ -960,11 +995,16 @@ private:
|
| int32_t numRuleSets;
|
| NFRuleSet *defaultRuleSet;
|
| Locale locale;
|
| - Collator* collator;
|
| + RuleBasedCollator* collator;
|
| DecimalFormatSymbols* decimalFormatSymbols;
|
| UBool lenient;
|
| UnicodeString* lenientParseRules;
|
| LocalizationInfo* localizations;
|
| + UnicodeString originalDescription;
|
| + UBool capitalizationInfoSet;
|
| + UBool capitalizationForUIListMenu;
|
| + UBool capitalizationForStandAlone;
|
| + BreakIterator* capitalizationBrkIter;
|
| };
|
|
|
| // ---------------
|
|
|