| 1 |
. |
| 2 |
|
| 3 |
|
| 4 |
#ifndef __PLURALRANGES_H__ |
| 5 |
#define __PLURALRANGES_H__ |
| 6 |
|
| 7 |
#include "unicode/utypes.h" |
| 8 |
|
| 9 |
#if !UCONFIG_NO_FORMATTING |
| 10 |
|
| 11 |
#include "unicode/uobject.h" |
| 12 |
#include "unicode/locid.h" |
| 13 |
#include "unicode/plurrule.h" |
| 14 |
#include "standardplural.h" |
| 15 |
#include "cmemory.h" |
| 16 |
|
| 17 |
U_NAMESPACE_BEGIN |
| 18 |
|
| 19 |
|
| 20 |
namespace number::impl { |
| 21 |
class UFormattedNumberRangeData; |
| 22 |
} |
| 23 |
|
| 24 |
class StandardPluralRanges : public UMemory { |
| 25 |
public: |
| 26 |
|
| 27 |
static StandardPluralRanges forLocale(const Locale& locale, UErrorCode& status); |
| 28 |
|
| 29 |
|
| 30 |
StandardPluralRanges copy(UErrorCode& status) const; |
| 31 |
|
| 32 |
|
| 33 |
LocalPointer<StandardPluralRanges> toPointer(UErrorCode& status) && noexcept; |
| 34 |
|
| 35 |
|
| 36 |
StandardPlural::Form resolve(StandardPlural::Form first, StandardPlural::Form second) const; |
| 37 |
|
| 38 |
|
| 39 |
void addPluralRange( |
| 40 |
StandardPlural::Form first, |
| 41 |
StandardPlural::Form second, |
| 42 |
StandardPlural::Form result); |
| 43 |
|
| 44 |
|
| 45 |
void setCapacity(int32_t length, UErrorCode& status); |
| 46 |
|
| 47 |
private: |
| 48 |
struct StandardPluralRangeTriple { |
| 49 |
StandardPlural::Form first; |
| 50 |
StandardPlural::Form second; |
| 51 |
StandardPlural::Form result; |
| 52 |
}; |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
typedef MaybeStackArray<StandardPluralRangeTriple, 3> PluralRangeTriples; |
| 58 |
PluralRangeTriples fTriples; |
| 59 |
int32_t fTriplesLen = 0; |
| 60 |
}; |
| 61 |
|
| 62 |
U_NAMESPACE_END |
| 63 |
|
| 64 |
#endif |
| 65 |
#endif |