26#if !UCONFIG_NO_FORMATTING
36#define UPLRULES_NO_UNIQUE_VALUE ((double)-0.00123456777)
43class PluralKeywordEnumeration;
287 double *dest, int32_t destCapacity,
309 double *dest, int32_t destCapacity,
373 int32_t *mSampleInfo;
374 int32_t mSampleInfoCount;
377 int32_t getRepeatLimit()
const;
380 void addRules(RuleChain& rules);
384 static const int32_t MAX_SAMPLES = 3;
386 int32_t getSamplesInternal(
const UnicodeString &keyword,
double *dest,
387 int32_t destCapacity,
UBool includeUnlimited,
A Locale object represents a specific geographical, political, or cultural region.
UBool operator!=(const PluralRules &other) const
Compares the inequality of two PluralRules objects.
virtual UBool operator==(const PluralRules &other) const
Compares the equality of two PluralRules objects.
UnicodeString getKeywordOther() const
Returns keyword for default plural form.
double getUniqueKeywordValue(const UnicodeString &keyword)
Returns a unique value for this keyword if it exists, else the constant UPLRULES_NO_UNIQUE_VALUE.
virtual UClassID getDynamicClassID() const
ICU "poor man's RTTI", returns a UClassID for the actual class.
PluralRules * clone() const
Clone.
int32_t getAllKeywordValues(const UnicodeString &keyword, double *dest, int32_t destCapacity, UErrorCode &status)
Returns all the values for which select() would return the keyword.
PluralRules(UErrorCode &status)
Constructor.
UnicodeString select(int32_t number) const
Given a number, returns the keyword of the first rule that applies to the number.
static PluralRules * forLocale(const Locale &locale, UPluralType type, UErrorCode &status)
Provides access to the predefined PluralRules for a given locale and the plural type.
virtual ~PluralRules()
Destructor.
static PluralRules * forLocale(const Locale &locale, UErrorCode &status)
Provides access to the predefined cardinal-number PluralRules for a given locale.
UnicodeString select(double number) const
Given a number, returns the keyword of the first rule that applies to the number.
static UClassID getStaticClassID(void)
ICU "poor man's RTTI", returns a UClassID for this class.
static PluralRules * createRules(const UnicodeString &description, UErrorCode &status)
Creates a PluralRules from a description if it is parsable, otherwise returns NULL.
StringEnumeration * getKeywords(UErrorCode &status) const
Returns a list of all rule keywords used in this PluralRules object.
UBool isKeyword(const UnicodeString &keyword) const
Returns TRUE if the given keyword is defined in this PluralRules object.
PluralRules(const PluralRules &other)
Copy constructor.
int32_t getSamples(const UnicodeString &keyword, double *dest, int32_t destCapacity, UErrorCode &status)
Returns sample values for which select() would return the keyword.
PluralRules & operator=(const PluralRules &)
Assignment operator.
static PluralRules * createDefaultRules(UErrorCode &status)
The default rules that accept any number.
Base class for 'pure' C++ implementations of uenum api.
UObject is the common ICU "boilerplate" class.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
U_EXPORT UBool operator==(const StringPiece &x, const StringPiece &y)
Global operator == for StringPiece.
int8_t UBool
The ICU boolean type.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
C API: Plural rules, select plural keywords for numeric values.
UPluralType
Type of plurals and PluralRules.
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside.
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.