Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.35
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
include /
unicode /
Delete
Unzip
Name
Size
Permission
Date
Action
alphaindex.h
26.13
KB
-rw-r--r--
2021-10-12 12:29
appendable.h
8.25
KB
-rw-r--r--
2021-10-12 12:29
basictz.h
8.73
KB
-rw-r--r--
2021-10-12 12:29
brkiter.h
27.31
KB
-rw-r--r--
2021-10-12 12:29
bytestream.h
9.16
KB
-rw-r--r--
2021-10-12 12:29
bytestrie.h
19.19
KB
-rw-r--r--
2021-10-12 12:29
bytestriebuilder.h
7.06
KB
-rw-r--r--
2021-10-12 12:29
calendar.h
105.26
KB
-rw-r--r--
2021-10-12 12:29
caniter.h
7.24
KB
-rw-r--r--
2021-10-12 12:29
chariter.h
23.71
KB
-rw-r--r--
2021-10-12 12:29
choicfmt.h
23.74
KB
-rw-r--r--
2021-10-12 12:29
coleitr.h
13.57
KB
-rw-r--r--
2021-10-12 12:29
coll.h
55.46
KB
-rw-r--r--
2021-10-12 12:29
compactdecimalformat.h
16.56
KB
-rw-r--r--
2021-10-12 12:29
curramt.h
3.57
KB
-rw-r--r--
2021-10-12 12:29
currpinf.h
6.97
KB
-rw-r--r--
2021-10-12 12:29
currunit.h
2.81
KB
-rw-r--r--
2021-10-12 12:29
datefmt.h
40.07
KB
-rw-r--r--
2021-10-12 12:29
dbbi.h
1020
B
-rw-r--r--
2021-10-12 12:29
dcfmtsym.h
16.46
KB
-rw-r--r--
2021-10-12 12:29
decimfmt.h
90.45
KB
-rw-r--r--
2021-10-12 12:29
docmain.h
6.28
KB
-rw-r--r--
2021-10-12 12:29
dtfmtsym.h
37.05
KB
-rw-r--r--
2021-10-12 12:29
dtintrv.h
3.65
KB
-rw-r--r--
2021-10-12 12:29
dtitvfmt.h
42.76
KB
-rw-r--r--
2021-10-12 12:29
dtitvinf.h
18.34
KB
-rw-r--r--
2021-10-12 12:29
dtptngen.h
23.18
KB
-rw-r--r--
2021-10-12 12:29
dtrule.h
8.51
KB
-rw-r--r--
2021-10-12 12:29
enumset.h
1.94
KB
-rw-r--r--
2021-10-12 12:29
errorcode.h
4.67
KB
-rw-r--r--
2021-10-12 12:29
fieldpos.h
8.51
KB
-rw-r--r--
2021-10-12 12:29
filteredbrk.h
4.22
KB
-rw-r--r--
2021-10-12 12:29
fmtable.h
24.29
KB
-rw-r--r--
2021-10-12 12:29
format.h
12.33
KB
-rw-r--r--
2021-10-12 12:29
fpositer.h
2.87
KB
-rw-r--r--
2021-10-12 12:29
gender.h
3.07
KB
-rw-r--r--
2021-10-12 12:29
gregocal.h
31.46
KB
-rw-r--r--
2021-10-12 12:29
icudataver.h
938
B
-rw-r--r--
2021-10-12 12:29
icuplug.h
11.58
KB
-rw-r--r--
2021-10-12 12:29
idna.h
12.55
KB
-rw-r--r--
2021-10-12 12:29
listformatter.h
4.73
KB
-rw-r--r--
2021-10-12 12:29
localpointer.h
18.17
KB
-rw-r--r--
2021-10-12 12:29
locdspnm.h
6.92
KB
-rw-r--r--
2021-10-12 12:29
locid.h
31.3
KB
-rw-r--r--
2021-10-12 12:29
measfmt.h
10.43
KB
-rw-r--r--
2021-10-12 12:29
measunit.h
37.64
KB
-rw-r--r--
2021-10-12 12:29
measure.h
4.15
KB
-rw-r--r--
2021-10-12 12:29
messagepattern.h
33.53
KB
-rw-r--r--
2021-10-12 12:29
msgfmt.h
43.05
KB
-rw-r--r--
2021-10-12 12:29
normalizer2.h
28.17
KB
-rw-r--r--
2021-10-12 12:29
normlzr.h
30.65
KB
-rw-r--r--
2021-10-12 12:29
numfmt.h
45.85
KB
-rw-r--r--
2021-10-12 12:29
numsys.h
6.62
KB
-rw-r--r--
2021-10-12 12:29
parseerr.h
2.97
KB
-rw-r--r--
2021-10-12 12:29
parsepos.h
5.34
KB
-rw-r--r--
2021-10-12 12:29
platform.h
26.96
KB
-rw-r--r--
2021-10-12 12:29
plurfmt.h
25.55
KB
-rw-r--r--
2021-10-12 12:29
plurrule.h
17.16
KB
-rw-r--r--
2021-10-12 12:29
ptypes.h
3.36
KB
-rw-r--r--
2021-10-12 12:29
putil.h
6.23
KB
-rw-r--r--
2021-10-12 12:29
rbbi.h
29.2
KB
-rw-r--r--
2021-10-12 12:29
rbnf.h
46.66
KB
-rw-r--r--
2021-10-12 12:29
rbtz.h
15.36
KB
-rw-r--r--
2021-10-12 12:29
regex.h
84.75
KB
-rw-r--r--
2021-10-12 12:29
region.h
9
KB
-rw-r--r--
2021-10-12 12:29
reldatefmt.h
13.73
KB
-rw-r--r--
2021-10-12 12:29
rep.h
9.38
KB
-rw-r--r--
2021-10-12 12:29
resbund.h
17.89
KB
-rw-r--r--
2021-10-12 12:29
schriter.h
6.15
KB
-rw-r--r--
2021-10-12 12:29
scientificnumberformatter.h
6.48
KB
-rw-r--r--
2021-10-12 12:29
search.h
22.1
KB
-rw-r--r--
2021-10-12 12:29
selfmt.h
14.13
KB
-rw-r--r--
2021-10-12 12:29
simpleformatter.h
11.14
KB
-rw-r--r--
2021-10-12 12:29
simpletz.h
45.13
KB
-rw-r--r--
2021-10-12 12:29
smpdtfmt.h
69.24
KB
-rw-r--r--
2021-10-12 12:29
sortkey.h
11.01
KB
-rw-r--r--
2021-10-12 12:29
std_string.h
905
B
-rw-r--r--
2021-10-12 12:29
strenum.h
9.92
KB
-rw-r--r--
2021-10-12 12:29
stringpiece.h
6.38
KB
-rw-r--r--
2021-10-12 12:29
stringtriebuilder.h
14.56
KB
-rw-r--r--
2021-10-12 12:29
stsearch.h
21.18
KB
-rw-r--r--
2021-10-12 12:29
symtable.h
4.1
KB
-rw-r--r--
2021-10-12 12:29
tblcoll.h
36.24
KB
-rw-r--r--
2021-10-12 12:29
timezone.h
40.71
KB
-rw-r--r--
2021-10-12 12:29
tmunit.h
2.94
KB
-rw-r--r--
2021-10-12 12:29
tmutamt.h
4.69
KB
-rw-r--r--
2021-10-12 12:29
tmutfmt.h
7.61
KB
-rw-r--r--
2021-10-12 12:29
translit.h
54.41
KB
-rw-r--r--
2021-10-12 12:29
tzfmt.h
42.69
KB
-rw-r--r--
2021-10-12 12:29
tznames.h
16.25
KB
-rw-r--r--
2021-10-12 12:29
tzrule.h
35.21
KB
-rw-r--r--
2021-10-12 12:29
tztrans.h
5.96
KB
-rw-r--r--
2021-10-12 12:29
ubidi.h
88.57
KB
-rw-r--r--
2021-10-12 12:29
ubrk.h
20.05
KB
-rw-r--r--
2021-10-12 12:29
ucal.h
54.18
KB
-rw-r--r--
2021-10-12 12:29
ucasemap.h
16.45
KB
-rw-r--r--
2021-10-12 12:29
ucat.h
5.25
KB
-rw-r--r--
2021-10-12 12:29
uchar.h
122.74
KB
-rw-r--r--
2021-10-12 12:29
ucharstrie.h
20.8
KB
-rw-r--r--
2021-10-12 12:29
ucharstriebuilder.h
7.01
KB
-rw-r--r--
2021-10-12 12:29
uchriter.h
12.82
KB
-rw-r--r--
2021-10-12 12:29
uclean.h
11.03
KB
-rw-r--r--
2021-10-12 12:29
ucnv.h
82.81
KB
-rw-r--r--
2021-10-12 12:29
ucnv_cb.h
6.48
KB
-rw-r--r--
2021-10-12 12:29
ucnv_err.h
20.87
KB
-rw-r--r--
2021-10-12 12:29
ucnvsel.h
6.03
KB
-rw-r--r--
2021-10-12 12:29
ucol.h
60.51
KB
-rw-r--r--
2021-10-12 12:29
ucoleitr.h
9.34
KB
-rw-r--r--
2021-10-12 12:29
uconfig.h
11.76
KB
-rw-r--r--
2021-10-12 12:29
ucsdet.h
14.35
KB
-rw-r--r--
2021-10-12 12:29
ucurr.h
14.92
KB
-rw-r--r--
2021-10-12 12:29
udat.h
59.91
KB
-rw-r--r--
2021-10-12 12:29
udata.h
15.28
KB
-rw-r--r--
2021-10-12 12:29
udateintervalformat.h
6.68
KB
-rw-r--r--
2021-10-12 12:29
udatpg.h
23.5
KB
-rw-r--r--
2021-10-12 12:29
udisplaycontext.h
4.87
KB
-rw-r--r--
2021-10-12 12:29
uenum.h
7.76
KB
-rw-r--r--
2021-10-12 12:29
ufieldpositer.h
4.24
KB
-rw-r--r--
2021-10-12 12:29
uformattable.h
10.65
KB
-rw-r--r--
2021-10-12 12:29
ugender.h
1.89
KB
-rw-r--r--
2021-10-12 12:29
uidna.h
33.26
KB
-rw-r--r--
2021-10-12 12:29
uiter.h
22.67
KB
-rw-r--r--
2021-10-12 12:29
uldnames.h
10.34
KB
-rw-r--r--
2021-10-12 12:29
ulistformatter.h
4.43
KB
-rw-r--r--
2021-10-12 12:29
uloc.h
49.78
KB
-rw-r--r--
2021-10-12 12:29
ulocdata.h
10.57
KB
-rw-r--r--
2021-10-12 12:29
umachine.h
10.94
KB
-rw-r--r--
2021-10-12 12:29
umisc.h
1.23
KB
-rw-r--r--
2021-10-12 12:29
umsg.h
24.12
KB
-rw-r--r--
2021-10-12 12:29
unifilt.h
3.52
KB
-rw-r--r--
2021-10-12 12:29
unifunct.h
3.87
KB
-rw-r--r--
2021-10-12 12:29
unimatch.h
5.93
KB
-rw-r--r--
2021-10-12 12:29
unirepl.h
3.21
KB
-rw-r--r--
2021-10-12 12:29
uniset.h
63.86
KB
-rw-r--r--
2021-10-12 12:29
unistr.h
170.03
KB
-rw-r--r--
2021-10-12 12:29
unorm.h
20.18
KB
-rw-r--r--
2021-10-12 12:29
unorm2.h
25.11
KB
-rw-r--r--
2021-10-12 12:29
unum.h
49.13
KB
-rw-r--r--
2021-10-12 12:29
unumsys.h
7.03
KB
-rw-r--r--
2021-10-12 12:29
uobject.h
10.61
KB
-rw-r--r--
2021-10-12 12:29
upluralrules.h
4.47
KB
-rw-r--r--
2021-10-12 12:29
uregex.h
71.95
KB
-rw-r--r--
2021-10-12 12:29
uregion.h
9.58
KB
-rw-r--r--
2021-10-12 12:29
ureldatefmt.h
11.85
KB
-rw-r--r--
2021-10-12 12:29
urename.h
123.32
KB
-rw-r--r--
2021-10-12 12:29
urep.h
5.27
KB
-rw-r--r--
2021-10-12 12:29
ures.h
36.25
KB
-rw-r--r--
2021-10-12 12:29
uscript.h
25.24
KB
-rw-r--r--
2021-10-12 12:29
usearch.h
37.71
KB
-rw-r--r--
2021-10-12 12:29
uset.h
39.67
KB
-rw-r--r--
2021-10-12 12:29
usetiter.h
9.38
KB
-rw-r--r--
2021-10-12 12:29
ushape.h
17.89
KB
-rw-r--r--
2021-10-12 12:29
uspoof.h
45.43
KB
-rw-r--r--
2021-10-12 12:29
usprep.h
8.02
KB
-rw-r--r--
2021-10-12 12:29
ustdio.h
38.43
KB
-rw-r--r--
2021-10-12 12:29
ustream.h
1.8
KB
-rw-r--r--
2021-10-12 12:29
ustring.h
72.69
KB
-rw-r--r--
2021-10-12 12:29
ustringtrie.h
3.04
KB
-rw-r--r--
2021-10-12 12:29
utext.h
57.97
KB
-rw-r--r--
2021-10-12 12:29
utf.h
7.64
KB
-rw-r--r--
2021-10-12 12:29
utf16.h
18.63
KB
-rw-r--r--
2021-10-12 12:29
utf32.h
653
B
-rw-r--r--
2021-10-12 12:29
utf8.h
27.62
KB
-rw-r--r--
2021-10-12 12:29
utf_old.h
42.5
KB
-rw-r--r--
2021-10-12 12:29
utmscale.h
13.37
KB
-rw-r--r--
2021-10-12 12:29
utrace.h
13.09
KB
-rw-r--r--
2021-10-12 12:29
utrans.h
25.42
KB
-rw-r--r--
2021-10-12 12:29
utypes.h
31.05
KB
-rw-r--r--
2021-10-12 12:29
uvernum.h
5.62
KB
-rw-r--r--
2021-10-12 12:29
uversion.h
6.29
KB
-rw-r--r--
2021-10-12 12:29
vtzone.h
20.06
KB
-rw-r--r--
2021-10-12 12:29
Save
Rename
/* ******************************************************************************** * Copyright (C) 1997-2013, International Business Machines * Corporation and others. All Rights Reserved. ******************************************************************************** * * File CHOICFMT.H * * Modification History: * * Date Name Description * 02/19/97 aliu Converted from java. * 03/20/97 helena Finished first cut of implementation and got rid * of nextDouble/previousDouble and replaced with * boolean array. * 4/10/97 aliu Clean up. Modified to work on AIX. * 8/6/97 nos Removed overloaded constructor, member var 'buffer'. * 07/22/98 stephen Removed operator!= (implemented in Format) ******************************************************************************** */ #ifndef CHOICFMT_H #define CHOICFMT_H #include "unicode/utypes.h" /** * \file * \brief C++ API: Choice Format. */ #if !UCONFIG_NO_FORMATTING #ifndef U_HIDE_DEPRECATED_API #include "unicode/fieldpos.h" #include "unicode/format.h" #include "unicode/messagepattern.h" #include "unicode/numfmt.h" #include "unicode/unistr.h" U_NAMESPACE_BEGIN class MessageFormat; /** * ChoiceFormat converts between ranges of numeric values and strings for those ranges. * The strings must conform to the MessageFormat pattern syntax. * * <p><em><code>ChoiceFormat</code> is probably not what you need. * Please use <code>MessageFormat</code> * with <code>plural</code> arguments for proper plural selection, * and <code>select</code> arguments for simple selection among a fixed set of choices!</em></p> * * <p>A <code>ChoiceFormat</code> splits * the real number line \htmlonly<code>-∞</code> to * <code>+∞</code>\endhtmlonly into two * or more contiguous ranges. Each range is mapped to a * string.</p> * * <p><code>ChoiceFormat</code> was originally intended * for displaying grammatically correct * plurals such as "There is one file." vs. "There are 2 files." * <em>However,</em> plural rules for many languages * are too complex for the capabilities of ChoiceFormat, * and its requirement of specifying the precise rules for each message * is unmanageable for translators.</p> * * <p>There are two methods of defining a <code>ChoiceFormat</code>; both * are equivalent. The first is by using a string pattern. This is the * preferred method in most cases. The second method is through direct * specification of the arrays that logically make up the * <code>ChoiceFormat</code>.</p> * * <p>Note: Typically, choice formatting is done (if done at all) via <code>MessageFormat</code> * with a <code>choice</code> argument type, * rather than using a stand-alone <code>ChoiceFormat</code>.</p> * * <h5>Patterns and Their Interpretation</h5> * * <p>The pattern string defines the range boundaries and the strings for each number range. * Syntax: * <pre> * choiceStyle = number separator message ('|' number separator message)* * number = normal_number | ['-'] \htmlonly∞\endhtmlonly (U+221E, infinity) * normal_number = double value (unlocalized ASCII string) * separator = less_than | less_than_or_equal * less_than = '<' * less_than_or_equal = '#' | \htmlonly≤\endhtmlonly (U+2264) * message: see {@link MessageFormat} * </pre> * Pattern_White_Space between syntax elements is ignored, except * around each range's sub-message.</p> * * <p>Each numeric sub-range extends from the current range's number * to the next range's number. * The number itself is included in its range if a <code>less_than_or_equal</code> sign is used, * and excluded from its range (and instead included in the previous range) * if a <code>less_than</code> sign is used.</p> * * <p>When a <code>ChoiceFormat</code> is constructed from * arrays of numbers, closure flags and strings, * they are interpreted just like * the sequence of <code>(number separator string)</code> in an equivalent pattern string. * <code>closure[i]==TRUE</code> corresponds to a <code>less_than</code> separator sign. * The equivalent pattern string will be constructed automatically.</p> * * <p>During formatting, a number is mapped to the first range * where the number is not greater than the range's upper limit. * That range's message string is returned. A NaN maps to the very first range.</p> * * <p>During parsing, a range is selected for the longest match of * any range's message. That range's number is returned, ignoring the separator/closure. * Only a simple string match is performed, without parsing of arguments that * might be specified in the message strings.</p> * * <p>Note that the first range's number is ignored in formatting * but may be returned from parsing.</p> * * <h5>Examples</h5> * * <p>Here is an example of two arrays that map the number * <code>1..7</code> to the English day of the week abbreviations * <code>Sun..Sat</code>. No closures array is given; this is the same as * specifying all closures to be <code>FALSE</code>.</p> * * <pre> {1,2,3,4,5,6,7}, * {"Sun","Mon","Tue","Wed","Thur","Fri","Sat"}</pre> * * <p>Here is an example that maps the ranges [-Inf, 1), [1, 1], and (1, * +Inf] to three strings. That is, the number line is split into three * ranges: x < 1.0, x = 1.0, and x > 1.0. * (The round parentheses in the notation above indicate an exclusive boundary, * like the turned bracket in European notation: [-Inf, 1) == [-Inf, 1[ )</p> * * <pre> {0, 1, 1}, * {FALSE, FALSE, TRUE}, * {"no files", "one file", "many files"}</pre> * * <p>Here is an example that shows formatting and parsing: </p> * * \code * #include <unicode/choicfmt.h> * #include <unicode/unistr.h> * #include <iostream.h> * * int main(int argc, char *argv[]) { * double limits[] = {1,2,3,4,5,6,7}; * UnicodeString monthNames[] = { * "Sun","Mon","Tue","Wed","Thu","Fri","Sat"}; * ChoiceFormat fmt(limits, monthNames, 7); * UnicodeString str; * char buf[256]; * for (double x = 1.0; x <= 8.0; x += 1.0) { * fmt.format(x, str); * str.extract(0, str.length(), buf, 256, ""); * str.truncate(0); * cout << x << " -> " * << buf << endl; * } * cout << endl; * return 0; * } * \endcode * * <p><em>User subclasses are not supported.</em> While clients may write * subclasses, such code will not necessarily work and will not be * guaranteed to work stably from release to release. * * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments. */ class U_I18N_API ChoiceFormat: public NumberFormat { public: /** * Constructs a new ChoiceFormat from the pattern string. * * @param pattern Pattern used to construct object. * @param status Output param to receive success code. If the * pattern cannot be parsed, set to failure code. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments. */ ChoiceFormat(const UnicodeString& pattern, UErrorCode& status); /** * Constructs a new ChoiceFormat with the given limits and message strings. * All closure flags default to <code>FALSE</code>, * equivalent to <code>less_than_or_equal</code> separators. * * Copies the limits and formats instead of adopting them. * * @param limits Array of limit values. * @param formats Array of formats. * @param count Size of 'limits' and 'formats' arrays. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments. */ ChoiceFormat(const double* limits, const UnicodeString* formats, int32_t count ); /** * Constructs a new ChoiceFormat with the given limits, closure flags and message strings. * * Copies the limits and formats instead of adopting them. * * @param limits Array of limit values * @param closures Array of booleans specifying whether each * element of 'limits' is open or closed. If FALSE, then the * corresponding limit number is a member of its range. * If TRUE, then the limit number belongs to the previous range it. * @param formats Array of formats * @param count Size of 'limits', 'closures', and 'formats' arrays * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments. */ ChoiceFormat(const double* limits, const UBool* closures, const UnicodeString* formats, int32_t count); /** * Copy constructor. * * @param that ChoiceFormat object to be copied from * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments. */ ChoiceFormat(const ChoiceFormat& that); /** * Assignment operator. * * @param that ChoiceFormat object to be copied * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments. */ const ChoiceFormat& operator=(const ChoiceFormat& that); /** * Destructor. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments. */ virtual ~ChoiceFormat(); /** * Clones this Format object. The caller owns the * result and must delete it when done. * * @return a copy of this object * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments. */ virtual Format* clone(void) const; /** * Returns true if the given Format objects are semantically equal. * Objects of different subclasses are considered unequal. * * @param other ChoiceFormat object to be compared * @return true if other is the same as this. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments. */ virtual UBool operator==(const Format& other) const; /** * Sets the pattern. * @param pattern The pattern to be applied. * @param status Output param set to success/failure code on * exit. If the pattern is invalid, this will be * set to a failure result. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments. */ virtual void applyPattern(const UnicodeString& pattern, UErrorCode& status); /** * Sets the pattern. * @param pattern The pattern to be applied. * @param parseError Struct to receive information on position * of error if an error is encountered * @param status Output param set to success/failure code on * exit. If the pattern is invalid, this will be * set to a failure result. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments. */ virtual void applyPattern(const UnicodeString& pattern, UParseError& parseError, UErrorCode& status); /** * Gets the pattern. * * @param pattern Output param which will receive the pattern * Previous contents are deleted. * @return A reference to 'pattern' * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments. */ virtual UnicodeString& toPattern(UnicodeString &pattern) const; /** * Sets the choices to be used in formatting. * For details see the constructor with the same parameter list. * * @param limitsToCopy Contains the top value that you want * parsed with that format,and should be in * ascending sorted order. When formatting X, * the choice will be the i, where limit[i] * <= X < limit[i+1]. * @param formatsToCopy The format strings you want to use for each limit. * @param count The size of the above arrays. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments. */ virtual void setChoices(const double* limitsToCopy, const UnicodeString* formatsToCopy, int32_t count ); /** * Sets the choices to be used in formatting. * For details see the constructor with the same parameter list. * * @param limits Array of limits * @param closures Array of limit booleans * @param formats Array of format string * @param count The size of the above arrays * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments. */ virtual void setChoices(const double* limits, const UBool* closures, const UnicodeString* formats, int32_t count); /** * Returns NULL and 0. * Before ICU 4.8, this used to return the choice limits array. * * @param count Will be set to 0. * @return NULL * @deprecated ICU 4.8 Use the MessagePattern class to analyze a ChoiceFormat pattern. */ virtual const double* getLimits(int32_t& count) const; /** * Returns NULL and 0. * Before ICU 4.8, this used to return the limit booleans array. * * @param count Will be set to 0. * @return NULL * @deprecated ICU 4.8 Use the MessagePattern class to analyze a ChoiceFormat pattern. */ virtual const UBool* getClosures(int32_t& count) const; /** * Returns NULL and 0. * Before ICU 4.8, this used to return the array of choice strings. * * @param count Will be set to 0. * @return NULL * @deprecated ICU 4.8 Use the MessagePattern class to analyze a ChoiceFormat pattern. */ virtual const UnicodeString* getFormats(int32_t& count) const; using NumberFormat::format; /** * Formats a double number using this object's choices. * * @param number The value to be formatted. * @param appendTo Output parameter to receive result. * Result is appended to existing contents. * @param pos On input: an alignment field, if desired. * On output: the offsets of the alignment field. * @return Reference to 'appendTo' parameter. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments. */ virtual UnicodeString& format(double number, UnicodeString& appendTo, FieldPosition& pos) const; /** * Formats an int32_t number using this object's choices. * * @param number The value to be formatted. * @param appendTo Output parameter to receive result. * Result is appended to existing contents. * @param pos On input: an alignment field, if desired. * On output: the offsets of the alignment field. * @return Reference to 'appendTo' parameter. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments. */ virtual UnicodeString& format(int32_t number, UnicodeString& appendTo, FieldPosition& pos) const; /** * Formats an int64_t number using this object's choices. * * @param number The value to be formatted. * @param appendTo Output parameter to receive result. * Result is appended to existing contents. * @param pos On input: an alignment field, if desired. * On output: the offsets of the alignment field. * @return Reference to 'appendTo' parameter. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments. */ virtual UnicodeString& format(int64_t number, UnicodeString& appendTo, FieldPosition& pos) const; /** * Formats an array of objects using this object's choices. * * @param objs The array of objects to be formatted. * @param cnt The size of objs. * @param appendTo Output parameter to receive result. * Result is appended to existing contents. * @param pos On input: an alignment field, if desired. * On output: the offsets of the alignment field. * @param success Output param set to success/failure code on * exit. * @return Reference to 'appendTo' parameter. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments. */ virtual UnicodeString& format(const Formattable* objs, int32_t cnt, UnicodeString& appendTo, FieldPosition& pos, UErrorCode& success) const; using NumberFormat::parse; /** * Looks for the longest match of any message string on the input text and, * if there is a match, sets the result object to the corresponding range's number. * * If no string matches, then the parsePosition is unchanged. * * @param text The text to be parsed. * @param result Formattable to be set to the parse result. * If parse fails, return contents are undefined. * @param parsePosition The position to start parsing at on input. * On output, moved to after the last successfully * parse character. On parse failure, does not change. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments. */ virtual void parse(const UnicodeString& text, Formattable& result, ParsePosition& parsePosition) const; /** * Returns a unique class ID POLYMORPHICALLY. Part of ICU's "poor man's RTTI". * * @return The class ID for this object. All objects of a * given class have the same class ID. Objects of * other classes have different class IDs. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments. */ virtual UClassID getDynamicClassID(void) const; /** * Returns the class ID for this class. This is useful only for * comparing to a return value from getDynamicClassID(). For example: * <pre> * . Base* polymorphic_pointer = createPolymorphicObject(); * . if (polymorphic_pointer->getDynamicClassID() == * . Derived::getStaticClassID()) ... * </pre> * @return The class ID for all objects of this class. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments. */ static UClassID U_EXPORT2 getStaticClassID(void); private: /** * Converts a double value to a string. * @param value the double number to be converted. * @param string the result string. * @return the converted string. */ static UnicodeString& dtos(double value, UnicodeString& string); ChoiceFormat(); // default constructor not implemented /** * Construct a new ChoiceFormat with the limits and the corresponding formats * based on the pattern. * * @param newPattern Pattern used to construct object. * @param parseError Struct to receive information on position * of error if an error is encountered. * @param status Output param to receive success code. If the * pattern cannot be parsed, set to failure code. */ ChoiceFormat(const UnicodeString& newPattern, UParseError& parseError, UErrorCode& status); friend class MessageFormat; virtual void setChoices(const double* limits, const UBool* closures, const UnicodeString* formats, int32_t count, UErrorCode &errorCode); /** * Finds the ChoiceFormat sub-message for the given number. * @param pattern A MessagePattern. * @param partIndex the index of the first ChoiceFormat argument style part. * @param number a number to be mapped to one of the ChoiceFormat argument's intervals * @return the sub-message start part index. */ static int32_t findSubMessage(const MessagePattern &pattern, int32_t partIndex, double number); static double parseArgument( const MessagePattern &pattern, int32_t partIndex, const UnicodeString &source, ParsePosition &pos); /** * Matches the pattern string from the end of the partIndex to * the beginning of the limitPartIndex, * including all syntax except SKIP_SYNTAX, * against the source string starting at sourceOffset. * If they match, returns the length of the source string match. * Otherwise returns -1. */ static int32_t matchStringUntilLimitPart( const MessagePattern &pattern, int32_t partIndex, int32_t limitPartIndex, const UnicodeString &source, int32_t sourceOffset); /** * Some of the ChoiceFormat constructors do not have a UErrorCode paramater. * We need _some_ way to provide one for the MessagePattern constructor. * Alternatively, the MessagePattern could be a pointer field, but that is * not nice either. */ UErrorCode constructorErrorCode; /** * The MessagePattern which contains the parsed structure of the pattern string. * * Starting with ICU 4.8, the MessagePattern contains a sequence of * numeric/selector/message parts corresponding to the parsed pattern. * For details see the MessagePattern class API docs. */ MessagePattern msgPattern; /** * Docs & fields from before ICU 4.8, before MessagePattern was used. * Commented out, and left only for explanation of semantics. * -------- * Each ChoiceFormat divides the range -Inf..+Inf into fCount * intervals. The intervals are: * * 0: fChoiceLimits[0]..fChoiceLimits[1] * 1: fChoiceLimits[1]..fChoiceLimits[2] * ... * fCount-2: fChoiceLimits[fCount-2]..fChoiceLimits[fCount-1] * fCount-1: fChoiceLimits[fCount-1]..+Inf * * Interval 0 is special; during formatting (mapping numbers to * strings), it also contains all numbers less than * fChoiceLimits[0], as well as NaN values. * * Interval i maps to and from string fChoiceFormats[i]. When * parsing (mapping strings to numbers), then intervals map to * their lower limit, that is, interval i maps to fChoiceLimit[i]. * * The intervals may be closed, half open, or open. This affects * formatting but does not affect parsing. Interval i is affected * by fClosures[i] and fClosures[i+1]. If fClosures[i] * is FALSE, then the value fChoiceLimits[i] is in interval i. * That is, intervals i and i are: * * i-1: ... x < fChoiceLimits[i] * i: fChoiceLimits[i] <= x ... * * If fClosures[i] is TRUE, then the value fChoiceLimits[i] is * in interval i-1. That is, intervals i-1 and i are: * * i-1: ... x <= fChoiceLimits[i] * i: fChoiceLimits[i] < x ... * * Because of the nature of interval 0, fClosures[0] has no * effect. */ // double* fChoiceLimits; // UBool* fClosures; // UnicodeString* fChoiceFormats; // int32_t fCount; }; U_NAMESPACE_END #endif // U_HIDE_DEPRECATED_API #endif /* #if !UCONFIG_NO_FORMATTING */ #endif // CHOICFMT_H //eof