OXIESEC PANEL
- Current Dir:
/
/
usr
/
include
/
unicode
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
10/28/2024 06:50:42 AM
rwxr-xr-x
📄
alphaindex.h
26.27 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
appendable.h
8.43 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
basictz.h
8.84 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
brkiter.h
27.54 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
bytestream.h
9.59 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
bytestrie.h
19.26 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
bytestriebuilder.h
7.1 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
calendar.h
105.35 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
caniter.h
7.35 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
casemap.h
25.31 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
char16ptr.h
7.29 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
chariter.h
24 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
choicfmt.h
23.85 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
coleitr.h
13.7 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
coll.h
55.61 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
compactdecimalformat.h
16.58 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
curramt.h
3.69 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
currpinf.h
7.08 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
currunit.h
3.49 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
datefmt.h
40.18 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
dbbi.h
1.11 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
dcfmtsym.h
17.66 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
decimfmt.h
89.73 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
docmain.h
6.56 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
dtfmtsym.h
37.64 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
dtintrv.h
3.76 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
dtitvfmt.h
42.87 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
dtitvinf.h
18.46 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
dtptngen.h
23.72 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
dtrule.h
8.62 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
edits.h
15.54 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
enumset.h
2.05 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
errorcode.h
4.78 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
fieldpos.h
8.63 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
filteredbrk.h
5.46 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
fmtable.h
24.39 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
format.h
12.44 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
fpositer.h
3.14 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
gender.h
3.18 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
gregocal.h
31.57 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
icudataver.h
1.03 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
icuplug.h
11.86 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
idna.h
12.63 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
listformatter.h
4.98 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
localpointer.h
18.19 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
locdspnm.h
7.05 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
locid.h
31.4 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
measfmt.h
11.25 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
measunit.h
37.74 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
measure.h
4.26 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
messagepattern.h
33.64 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
msgfmt.h
43.16 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
normalizer2.h
33.97 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
normlzr.h
30.74 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
nounit.h
2.6 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
numberformatter.h
64.98 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
numfmt.h
47.76 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
numsys.h
6.73 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
parseerr.h
3.08 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
parsepos.h
5.45 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
platform.h
27.71 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
plurfmt.h
25.66 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
plurrule.h
18.34 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ptypes.h
3.47 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
putil.h
6.34 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
rbbi.h
27.09 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
rbnf.h
49.76 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
rbtz.h
15.47 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
regex.h
84.91 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
region.h
9.12 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
reldatefmt.h
14.3 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
rep.h
9.5 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
resbund.h
18.01 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
schriter.h
6.26 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
scientificnumberformatter.h
6.59 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
search.h
22.21 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
selfmt.h
14.24 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
simpleformatter.h
11.43 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
simpletz.h
45.24 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
smpdtfmt.h
70.09 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
sortkey.h
11.12 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
std_string.h
1015 bytes
10/19/2021 07:44:28 PM
rw-r--r--
📄
strenum.h
10.04 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
stringoptions.h
5.89 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
stringpiece.h
6.46 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
stringtriebuilder.h
15.2 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
stsearch.h
21.29 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
symtable.h
4.21 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
tblcoll.h
36.4 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
timezone.h
40.83 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
tmunit.h
3.29 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
tmutamt.h
4.8 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
tmutfmt.h
7.79 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
translit.h
54.53 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
tzfmt.h
42.81 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
tznames.h
16.79 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
tzrule.h
35.32 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
tztrans.h
6.07 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ubidi.h
89.28 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ubiditransform.h
12.71 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ubrk.h
24.08 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ucal.h
54.56 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ucasemap.h
15.18 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ucat.h
5.36 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
uchar.h
131.61 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ucharstrie.h
21.06 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ucharstriebuilder.h
7.14 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
uchriter.h
13.14 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
uclean.h
11.24 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ucnv.h
83.06 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ucnv_cb.h
6.59 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ucnv_err.h
20.98 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ucnvsel.h
6.14 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ucol.h
61.36 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ucoleitr.h
9.46 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
uconfig.h
11.91 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ucsdet.h
14.67 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ucurr.h
15.15 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
udat.h
60.13 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
udata.h
15.53 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
udateintervalformat.h
6.79 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
udatpg.h
24.11 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
udisplaycontext.h
5.89 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
uenum.h
7.9 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ufieldpositer.h
4.36 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
uformattable.h
10.94 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ugender.h
2 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
uidna.h
33.37 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
uiter.h
22.77 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
uldnames.h
10.45 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ulistformatter.h
4.54 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
uloc.h
50.75 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ulocdata.h
11.26 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
umachine.h
13.1 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
umisc.h
1.33 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
umsg.h
24.23 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
unifilt.h
3.63 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
unifunct.h
3.98 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
unimatch.h
6.04 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
unirepl.h
3.32 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
uniset.h
63.98 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
unistr.h
175.65 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
unorm.h
20.45 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
unorm2.h
24.66 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
unum.h
52.49 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
unumsys.h
7.14 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
uobject.h
10.72 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
upluralrules.h
6.77 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
uregex.h
72.05 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
uregion.h
9.84 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ureldatefmt.h
12.22 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
urename.h
124.49 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
urep.h
5.38 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ures.h
36.52 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
uscript.h
25.91 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
usearch.h
38.14 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
uset.h
39.91 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
usetiter.h
9.49 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ushape.h
18 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
uspoof.h
64.9 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
usprep.h
8.13 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ustdio.h
38.54 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ustream.h
1.8 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ustring.h
72.52 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
ustringtrie.h
3.15 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
utext.h
58.11 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
utf.h
7.86 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
utf16.h
22.49 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
utf32.h
763 bytes
10/19/2021 07:44:28 PM
rw-r--r--
📄
utf8.h
28.16 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
utf_old.h
43.78 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
utmscale.h
13.78 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
utrace.h
13.89 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
utrans.h
25.53 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
utypes.h
29.92 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
uvernum.h
5.69 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
uversion.h
6.4 KB
10/19/2021 07:44:28 PM
rw-r--r--
📄
vtzone.h
20.17 KB
10/19/2021 07:44:28 PM
rw-r--r--
Editing: plurrule.h
Close
// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * Copyright (C) 2008-2015, International Business Machines Corporation and * others. All Rights Reserved. ******************************************************************************* * * * File PLURRULE.H * * Modification History:* * Date Name Description * ******************************************************************************** */ #ifndef PLURRULE #define PLURRULE #include "unicode/utypes.h" /** * \file * \brief C++ API: PluralRules object */ #if !UCONFIG_NO_FORMATTING #include "unicode/format.h" #include "unicode/upluralrules.h" #ifndef U_HIDE_INTERNAL_API #include "unicode/numfmt.h" #endif /* U_HIDE_INTERNAL_API */ /** * Value returned by PluralRules::getUniqueKeywordValue() when there is no * unique value to return. * @stable ICU 4.8 */ #define UPLRULES_NO_UNIQUE_VALUE ((double)-0.00123456777) U_NAMESPACE_BEGIN class Hashtable; class IFixedDecimal; class VisibleDigitsWithExponent; class RuleChain; class PluralRuleParser; class PluralKeywordEnumeration; class AndConstraint; class SharedPluralRules; /** * Defines rules for mapping non-negative numeric values onto a small set of * keywords. Rules are constructed from a text description, consisting * of a series of keywords and conditions. The {@link #select} method * examines each condition in order and returns the keyword for the * first condition that matches the number. If none match, * default rule(other) is returned. * * For more information, details, and tips for writing rules, see the * LDML spec, C.11 Language Plural Rules: * http://www.unicode.org/draft/reports/tr35/tr35.html#Language_Plural_Rules * * Examples:<pre> * "one: n is 1; few: n in 2..4"</pre> * This defines two rules, for 'one' and 'few'. The condition for * 'one' is "n is 1" which means that the number must be equal to * 1 for this condition to pass. The condition for 'few' is * "n in 2..4" which means that the number must be between 2 and * 4 inclusive for this condition to pass. All other numbers * are assigned the keyword "other" by the default rule. * </p><pre> * "zero: n is 0; one: n is 1; zero: n mod 100 in 1..19"</pre> * This illustrates that the same keyword can be defined multiple times. * Each rule is examined in order, and the first keyword whose condition * passes is the one returned. Also notes that a modulus is applied * to n in the last rule. Thus its condition holds for 119, 219, 319... * </p><pre> * "one: n is 1; few: n mod 10 in 2..4 and n mod 100 not in 12..14"</pre> * This illustrates conjunction and negation. The condition for 'few' * has two parts, both of which must be met: "n mod 10 in 2..4" and * "n mod 100 not in 12..14". The first part applies a modulus to n * before the test as in the previous example. The second part applies * a different modulus and also uses negation, thus it matches all * numbers _not_ in 12, 13, 14, 112, 113, 114, 212, 213, 214... * </p> * <p> * Syntax:<pre> * \code * rules = rule (';' rule)* * rule = keyword ':' condition * keyword = <identifier> * condition = and_condition ('or' and_condition)* * and_condition = relation ('and' relation)* * relation = is_relation | in_relation | within_relation | 'n' <EOL> * is_relation = expr 'is' ('not')? value * in_relation = expr ('not')? 'in' range_list * within_relation = expr ('not')? 'within' range * expr = ('n' | 'i' | 'f' | 'v' | 'j') ('mod' value)? * range_list = (range | value) (',' range_list)* * value = digit+ ('.' digit+)? * digit = 0|1|2|3|4|5|6|7|8|9 * range = value'..'value * \endcode * </pre></p> * <p> * <p> * The i, f, and v values are defined as follows: * </p> * <ul> * <li>i to be the integer digits.</li> * <li>f to be the visible fractional digits, as an integer.</li> * <li>v to be the number of visible fraction digits.</li> * <li>j is defined to only match integers. That is j is 3 fails if v != 0 (eg for 3.1 or 3.0).</li> * </ul> * <p> * Examples are in the following table: * </p> * <table border='1' style="border-collapse:collapse"> * <tbody> * <tr> * <th>n</th> * <th>i</th> * <th>f</th> * <th>v</th> * </tr> * <tr> * <td>1.0</td> * <td>1</td> * <td align="right">0</td> * <td>1</td> * </tr> * <tr> * <td>1.00</td> * <td>1</td> * <td align="right">0</td> * <td>2</td> * </tr> * <tr> * <td>1.3</td> * <td>1</td> * <td align="right">3</td> * <td>1</td> * </tr> * <tr> * <td>1.03</td> * <td>1</td> * <td align="right">3</td> * <td>2</td> * </tr> * <tr> * <td>1.23</td> * <td>1</td> * <td align="right">23</td> * <td>2</td> * </tr> * </tbody> * </table> * <p> * The difference between 'in' and 'within' is that 'in' only includes integers in the specified range, while 'within' * includes all values. Using 'within' with a range_list consisting entirely of values is the same as using 'in' (it's * not an error). * </p> * An "identifier" is a sequence of characters that do not have the * Unicode Pattern_Syntax or Pattern_White_Space properties. * <p> * The difference between 'in' and 'within' is that 'in' only includes * integers in the specified range, while 'within' includes all values. * Using 'within' with a range_list consisting entirely of values is the * same as using 'in' (it's not an error). *</p> * <p> * Keywords * could be defined by users or from ICU locale data. There are 6 * predefined values in ICU - 'zero', 'one', 'two', 'few', 'many' and * 'other'. Callers need to check the value of keyword returned by * {@link #select} method. * </p> * * Examples:<pre> * UnicodeString keyword = pl->select(number); * if (keyword== UnicodeString("one") { * ... * } * else if ( ... ) * </pre> * <strong>Note:</strong><br> * <p> * ICU defines plural rules for many locales based on CLDR <i>Language Plural Rules</i>. * For these predefined rules, see CLDR page at * http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html * </p> */ class U_I18N_API PluralRules : public UObject { public: /** * Constructor. * @param status Output param set to success/failure code on exit, which * must not indicate a failure before the function call. * * @stable ICU 4.0 */ PluralRules(UErrorCode& status); /** * Copy constructor. * @stable ICU 4.0 */ PluralRules(const PluralRules& other); /** * Destructor. * @stable ICU 4.0 */ virtual ~PluralRules(); /** * Clone * @stable ICU 4.0 */ PluralRules* clone() const; /** * Assignment operator. * @stable ICU 4.0 */ PluralRules& operator=(const PluralRules&); /** * Creates a PluralRules from a description if it is parsable, otherwise * returns NULL. * * @param description rule description * @param status Output param set to success/failure code on exit, which * must not indicate a failure before the function call. * @return new PluralRules pointer. NULL if there is an error. * @stable ICU 4.0 */ static PluralRules* U_EXPORT2 createRules(const UnicodeString& description, UErrorCode& status); /** * The default rules that accept any number. * * @param status Output param set to success/failure code on exit, which * must not indicate a failure before the function call. * @return new PluralRules pointer. NULL if there is an error. * @stable ICU 4.0 */ static PluralRules* U_EXPORT2 createDefaultRules(UErrorCode& status); /** * Provides access to the predefined cardinal-number <code>PluralRules</code> for a given * locale. * Same as forLocale(locale, UPLURAL_TYPE_CARDINAL, status). * * @param locale The locale for which a <code>PluralRules</code> object is * returned. * @param status Output param set to success/failure code on exit, which * must not indicate a failure before the function call. * @return The predefined <code>PluralRules</code> object pointer for * this locale. If there's no predefined rules for this locale, * the rules for the closest parent in the locale hierarchy * that has one will be returned. The final fallback always * returns the default 'other' rules. * @stable ICU 4.0 */ static PluralRules* U_EXPORT2 forLocale(const Locale& locale, UErrorCode& status); /** * Provides access to the predefined <code>PluralRules</code> for a given * locale and the plural type. * * @param locale The locale for which a <code>PluralRules</code> object is * returned. * @param type The plural type (e.g., cardinal or ordinal). * @param status Output param set to success/failure code on exit, which * must not indicate a failure before the function call. * @return The predefined <code>PluralRules</code> object pointer for * this locale. If there's no predefined rules for this locale, * the rules for the closest parent in the locale hierarchy * that has one will be returned. The final fallback always * returns the default 'other' rules. * @stable ICU 50 */ static PluralRules* U_EXPORT2 forLocale(const Locale& locale, UPluralType type, UErrorCode& status); #ifndef U_HIDE_INTERNAL_API /** * Return a StringEnumeration over the locales for which there is plurals data. * @return a StringEnumeration over the locales available. * @internal */ static StringEnumeration* U_EXPORT2 getAvailableLocales(UErrorCode &status); /** * Returns whether or not there are overrides. * @param locale the locale to check. * @return * @internal */ static UBool hasOverride(const Locale &locale); /** * For ICU use only. * creates a SharedPluralRules object * @internal */ static PluralRules* U_EXPORT2 internalForLocale(const Locale& locale, UPluralType type, UErrorCode& status); /** * For ICU use only. * Returns handle to the shared, cached PluralRules instance. * Caller must call removeRef() on returned value once it is done with * the shared instance. * @internal */ static const SharedPluralRules* U_EXPORT2 createSharedInstance( const Locale& locale, UPluralType type, UErrorCode& status); #endif /* U_HIDE_INTERNAL_API */ /** * Given a number, returns the keyword of the first rule that applies to * the number. This function can be used with isKeyword* functions to * determine the keyword for default plural rules. * * @param number The number for which the rule has to be determined. * @return The keyword of the selected rule. * @stable ICU 4.0 */ UnicodeString select(int32_t number) const; /** * Given a number, returns the keyword of the first rule that applies to * the number. This function can be used with isKeyword* functions to * determine the keyword for default plural rules. * * @param number The number for which the rule has to be determined. * @return The keyword of the selected rule. * @stable ICU 4.0 */ UnicodeString select(double number) const; #ifndef U_HIDE_INTERNAL_API /** * Given a number and a format, returns the keyword of the first applicable * rule for this PluralRules object. * Note: This internal preview interface may be removed in the future if * an architecturally cleaner solution reaches stable status. * @param obj The numeric object for which the rule should be determined. * @param fmt The NumberFormat specifying how the number will be formatted * (this can affect the plural form, e.g. "1 dollar" vs "1.0 dollars"). * @param status Input/output parameter. If at entry this indicates a * failure status, the method returns immediately; otherwise * this is set to indicate the outcome of the call. * @return The keyword of the selected rule. Undefined in the case of an error. * @internal ICU 59 technology preview, may be removed in the future */ UnicodeString select(const Formattable& obj, const NumberFormat& fmt, UErrorCode& status) const; /** * @internal */ UnicodeString select(const IFixedDecimal &number) const; /** * @internal */ UnicodeString select(const VisibleDigitsWithExponent &number) const; #endif /* U_HIDE_INTERNAL_API */ /** * Returns a list of all rule keywords used in this <code>PluralRules</code> * object. The rule 'other' is always present by default. * * @param status Output param set to success/failure code on exit, which * must not indicate a failure before the function call. * @return StringEnumeration with the keywords. * The caller must delete the object. * @stable ICU 4.0 */ StringEnumeration* getKeywords(UErrorCode& status) const; #ifndef U_HIDE_DEPRECATED_API /** * Deprecated Function, does not return useful results. * * Originally intended to return a unique value for this keyword if it exists, * else the constant UPLRULES_NO_UNIQUE_VALUE. * * @param keyword The keyword. * @return Stub deprecated function returns UPLRULES_NO_UNIQUE_VALUE always. * @deprecated ICU 55 */ double getUniqueKeywordValue(const UnicodeString& keyword); /** * Deprecated Function, does not produce useful results. * * Originally intended to return all the values for which select() would return the keyword. * If the keyword is unknown, returns no values, but this is not an error. If * the number of values is unlimited, returns no values and -1 as the * count. * * The number of returned values is typically small. * * @param keyword The keyword. * @param dest Array into which to put the returned values. May * be NULL if destCapacity is 0. * @param destCapacity The capacity of the array, must be at least 0. * @param status The error code. Deprecated function, always sets U_UNSUPPORTED_ERROR. * @return The count of values available, or -1. This count * can be larger than destCapacity, but no more than * destCapacity values will be written. * @deprecated ICU 55 */ int32_t getAllKeywordValues(const UnicodeString &keyword, double *dest, int32_t destCapacity, UErrorCode& status); #endif /* U_HIDE_DEPRECATED_API */ /** * Returns sample values for which select() would return the keyword. If * the keyword is unknown, returns no values, but this is not an error. * * The number of returned values is typically small. * * @param keyword The keyword. * @param dest Array into which to put the returned values. May * be NULL if destCapacity is 0. * @param destCapacity The capacity of the array, must be at least 0. * @param status The error code. * @return The count of values written. * If more than destCapacity samples are available, then * only destCapacity are written, and destCapacity is returned as the count, * rather than setting a U_BUFFER_OVERFLOW_ERROR. * (The actual number of keyword values could be unlimited.) * @stable ICU 4.8 */ int32_t getSamples(const UnicodeString &keyword, double *dest, int32_t destCapacity, UErrorCode& status); /** * Returns TRUE if the given keyword is defined in this * <code>PluralRules</code> object. * * @param keyword the input keyword. * @return TRUE if the input keyword is defined. * Otherwise, return FALSE. * @stable ICU 4.0 */ UBool isKeyword(const UnicodeString& keyword) const; /** * Returns keyword for default plural form. * * @return keyword for default plural form. * @stable ICU 4.0 */ UnicodeString getKeywordOther() const; #ifndef U_HIDE_INTERNAL_API /** * * @internal */ UnicodeString getRules() const; #endif /* U_HIDE_INTERNAL_API */ /** * Compares the equality of two PluralRules objects. * * @param other The other PluralRules object to be compared with. * @return True if the given PluralRules is the same as this * PluralRules; false otherwise. * @stable ICU 4.0 */ virtual UBool operator==(const PluralRules& other) const; /** * Compares the inequality of two PluralRules objects. * * @param other The PluralRules object to be compared with. * @return True if the given PluralRules is not the same as this * PluralRules; false otherwise. * @stable ICU 4.0 */ UBool operator!=(const PluralRules& other) const {return !operator==(other);} /** * ICU "poor man's RTTI", returns a UClassID for this class. * * @stable ICU 4.0 * */ static UClassID U_EXPORT2 getStaticClassID(void); /** * ICU "poor man's RTTI", returns a UClassID for the actual class. * * @stable ICU 4.0 */ virtual UClassID getDynamicClassID() const; private: RuleChain *mRules; PluralRules(); // default constructor not implemented void parseDescription(const UnicodeString& ruleData, UErrorCode &status); int32_t getNumberValue(const UnicodeString& token) const; UnicodeString getRuleFromResource(const Locale& locale, UPluralType type, UErrorCode& status); RuleChain *rulesForKeyword(const UnicodeString &keyword) const; friend class PluralRuleParser; }; U_NAMESPACE_END #endif /* #if !UCONFIG_NO_FORMATTING */ #endif // _PLURRULE //eof