/
usr
/
include
/
unicode
/
/usr/include/unicode
mkdir
upload
Name
Size
Mode
Actions
alphaindex.h
27118
0644
edit
dl
rm
appendable.h
8694
0644
edit
dl
rm
basictz.h
9491
0644
edit
dl
rm
brkiter.h
28464
0644
edit
dl
rm
bytestream.h
11037
0644
edit
dl
rm
bytestrie.h
21266
0644
edit
dl
rm
bytestriebuilder.h
7248
0644
edit
dl
rm
calendar.h
108278
0644
edit
dl
rm
caniter.h
7611
0644
edit
dl
rm
casemap.h
25933
0644
edit
dl
rm
char16ptr.h
7393
0644
edit
dl
rm
chariter.h
24632
0644
edit
dl
rm
choicfmt.h
24482
0644
edit
dl
rm
coleitr.h
14094
0644
edit
dl
rm
coll.h
57581
0644
edit
dl
rm
compactdecimalformat.h
7047
0644
edit
dl
rm
curramt.h
3851
0644
edit
dl
rm
currpinf.h
7473
0644
edit
dl
rm
currunit.h
4094
0644
edit
dl
rm
datefmt.h
41641
0644
edit
dl
rm
dbbi.h
1223
0644
edit
dl
rm
dcfmtsym.h
20897
0644
edit
dl
rm
decimfmt.h
89278
0644
edit
dl
rm
docmain.h
7142
0644
edit
dl
rm
dtfmtsym.h
38609
0644
edit
dl
rm
dtintrv.h
3930
0644
edit
dl
rm
dtitvfmt.h
47634
0644
edit
dl
rm
dtitvinf.h
19064
0644
edit
dl
rm
dtptngen.h
26419
0644
edit
dl
rm
dtrule.h
8888
0644
edit
dl
rm
edits.h
21237
0644
edit
dl
rm
enumset.h
2130
0644
edit
dl
rm
errorcode.h
4956
0644
edit
dl
rm
fieldpos.h
8899
0644
edit
dl
rm
filteredbrk.h
5501
0644
edit
dl
rm
fmtable.h
25007
0644
edit
dl
rm
format.h
12802
0644
edit
dl
rm
formattedvalue.h
9987
0644
edit
dl
rm
fpositer.h
3109
0644
edit
dl
rm
gender.h
3408
0644
edit
dl
rm
gregocal.h
32472
0644
edit
dl
rm
icudataver.h
1051
0644
edit
dl
rm
icuplug.h
12166
0644
edit
dl
rm
idna.h
13000
0644
edit
dl
rm
listformatter.h
9493
0644
edit
dl
rm
localebuilder.h
11502
0644
edit
dl
rm
localematcher.h
25147
0644
edit
dl
rm
localpointer.h
19829
0644
edit
dl
rm
locdspnm.h
7292
0644
edit
dl
rm
locid.h
48821
0644
edit
dl
rm
measfmt.h
11603
0644
edit
dl
rm
measunit.h
97563
0644
edit
dl
rm
measure.h
4423
0644
edit
dl
rm
messagepattern.h
34521
0644
edit
dl
rm
msgfmt.h
45168
0644
edit
dl
rm
normalizer2.h
34851
0644
edit
dl
rm
normlzr.h
31682
0644
edit
dl
rm
nounit.h
2754
0644
edit
dl
rm
numberformatter.h
86276
0644
edit
dl
rm
numberrangeformatter.h
28617
0644
edit
dl
rm
numfmt.h
50950
0644
edit
dl
rm
numsys.h
7500
0644
edit
dl
rm
parseerr.h
3155
0644
edit
dl
rm
parsepos.h
5692
0644
edit
dl
rm
platform.h
28751
0644
edit
dl
rm
plurfmt.h
25800
0644
edit
dl
rm
plurrule.h
18780
0644
edit
dl
rm
ptypes.h
3577
0644
edit
dl
rm
putil.h
6487
0644
edit
dl
rm
rbbi.h
27218
0644
edit
dl
rm
rbnf.h
49899
0644
edit
dl
rm
rbtz.h
15979
0644
edit
dl
rm
regex.h
86367
0644
edit
dl
rm
region.h
9404
0644
edit
dl
rm
reldatefmt.h
22801
0644
edit
dl
rm
rep.h
9599
0644
edit
dl
rm
resbund.h
18503
0644
edit
dl
rm
schriter.h
6475
0644
edit
dl
rm
scientificnumberformatter.h
6553
0644
edit
dl
rm
search.h
22757
0644
edit
dl
rm
selfmt.h
14643
0644
edit
dl
rm
simpleformatter.h
12888
0644
edit
dl
rm
simpletz.h
46527
0644
edit
dl
rm
smpdtfmt.h
72713
0644
edit
dl
rm
sortkey.h
11444
0644
edit
dl
rm
std_string.h
1076
0644
edit
dl
rm
strenum.h
10158
0644
edit
dl
rm
stringoptions.h
5926
0644
edit
dl
rm
stringpiece.h
10597
0644
edit
dl
rm
stringtriebuilder.h
15698
0644
edit
dl
rm
stsearch.h
21810
0644
edit
dl
rm
symtable.h
4374
0644
edit
dl
rm
tblcoll.h
37489
0644
edit
dl
rm
timezone.h
42005
0644
edit
dl
rm
tmunit.h
3461
0644
edit
dl
rm
tmutamt.h
5015
0644
edit
dl
rm
tmutfmt.h
8042
0644
edit
dl
rm
translit.h
67400
0644
edit
dl
rm
tzfmt.h
43916
0644
edit
dl
rm
tznames.h
17252
0644
edit
dl
rm
tzrule.h
36215
0644
edit
dl
rm
tztrans.h
6271
0644
edit
dl
rm
ubidi.h
91711
0644
edit
dl
rm
ubiditransform.h
12950
0644
edit
dl
rm
ubrk.h
24547
0644
edit
dl
rm
ucal.h
58265
0644
edit
dl
rm
ucasemap.h
15546
0644
edit
dl
rm
ucat.h
5484
0644
edit
dl
rm
uchar.h
144630
0644
edit
dl
rm
ucharstrie.h
23120
0644
edit
dl
rm
ucharstriebuilder.h
7378
0644
edit
dl
rm
uchriter.h
13521
0644
edit
dl
rm
uclean.h
11474
0644
edit
dl
rm
ucnv.h
85085
0644
edit
dl
rm
ucnvsel.h
6283
0644
edit
dl
rm
ucnv_cb.h
6748
0644
edit
dl
rm
ucnv_err.h
21492
0644
edit
dl
rm
ucol.h
62939
0644
edit
dl
rm
ucoleitr.h
9684
0644
edit
dl
rm
uconfig.h
12356
0644
edit
dl
rm
ucpmap.h
5663
0644
edit
dl
rm
ucptrie.h
23002
0644
edit
dl
rm
ucsdet.h
15018
0644
edit
dl
rm
ucurr.h
16507
0644
edit
dl
rm
udat.h
62851
0644
edit
dl
rm
udata.h
15930
0644
edit
dl
rm
udateintervalformat.h
10995
0644
edit
dl
rm
udatpg.h
27447
0644
edit
dl
rm
udisplaycontext.h
6029
0644
edit
dl
rm
uenum.h
7970
0644
edit
dl
rm
ufieldpositer.h
4461
0644
edit
dl
rm
uformattable.h
11198
0644
edit
dl
rm
uformattedvalue.h
12413
0644
edit
dl
rm
ugender.h
2052
0644
edit
dl
rm
uidna.h
34169
0644
edit
dl
rm
uiter.h
23319
0644
edit
dl
rm
uldnames.h
10702
0644
edit
dl
rm
ulistformatter.h
11086
0644
edit
dl
rm
uloc.h
54432
0644
edit
dl
rm
ulocdata.h
11533
0644
edit
dl
rm
umachine.h
14884
0644
edit
dl
rm
umisc.h
1365
0644
edit
dl
rm
umsg.h
24812
0644
edit
dl
rm
umutablecptrie.h
8435
0644
edit
dl
rm
unifilt.h
4055
0644
edit
dl
rm
unifunct.h
4141
0644
edit
dl
rm
unimatch.h
6244
0644
edit
dl
rm
unirepl.h
3464
0644
edit
dl
rm
uniset.h
66459
0644
edit
dl
rm
unistr.h
174523
0644
edit
dl
rm
unorm.h
21015
0644
edit
dl
rm
unorm2.h
25254
0644
edit
dl
rm
unum.h
54743
0644
edit
dl
rm
unumberformatter.h
25824
0644
edit
dl
rm
unumsys.h
7387
0644
edit
dl
rm
uobject.h
10936
0644
edit
dl
rm
upluralrules.h
8013
0644
edit
dl
rm
uregex.h
73784
0644
edit
dl
rm
uregion.h
10073
0644
edit
dl
rm
ureldatefmt.h
17409
0644
edit
dl
rm
urename.h
134449
0644
edit
dl
rm
urep.h
5507
0644
edit
dl
rm
ures.h
37415
0644
edit
dl
rm
uscript.h
27867
0644
edit
dl
rm
usearch.h
39039
0644
edit
dl
rm
uset.h
40958
0644
edit
dl
rm
usetiter.h
9781
0644
edit
dl
rm
ushape.h
18432
0644
edit
dl
rm
uspoof.h
67480
0644
edit
dl
rm
usprep.h
8331
0644
edit
dl
rm
ustdio.h
39469
0644
edit
dl
rm
ustream.h
1934
0644
edit
dl
rm
ustring.h
74211
0644
edit
dl
rm
ustringtrie.h
3224
0644
edit
dl
rm
utext.h
59527
0644
edit
dl
rm
utf.h
8046
0644
edit
dl
rm
utf8.h
31700
0644
edit
dl
rm
utf16.h
23878
0644
edit
dl
rm
utf32.h
763
0644
edit
dl
rm
utf_old.h
46929
0644
edit
dl
rm
utmscale.h
14113
0644
edit
dl
rm
utrace.h
17706
0644
edit
dl
rm
utrans.h
26130
0644
edit
dl
rm
utypes.h
31481
0644
edit
dl
rm
uvernum.h
6832
0644
edit
dl
rm
uversion.h
6145
0644
edit
dl
rm
vtzone.h
20784
0644
edit
dl
rm
Edit:
/usr/include/unicode/fieldpos.h
(8899B)
// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************** * Copyright (C) 1997-2006, International Business Machines * Corporation and others. All Rights Reserved. ******************************************************************************** * * File FIELDPOS.H * * Modification History: * * Date Name Description * 02/25/97 aliu Converted from java. * 03/17/97 clhuang Updated per Format implementation. * 07/17/98 stephen Added default/copy ctors, and operators =, ==, != ******************************************************************************** */ // ***************************************************************************** // This file was generated from the java source file FieldPosition.java // ***************************************************************************** #ifndef FIELDPOS_H #define FIELDPOS_H #include "unicode/utypes.h" #if U_SHOW_CPLUSPLUS_API /** * \file * \brief C++ API: FieldPosition identifies the fields in a formatted output. */ #if !UCONFIG_NO_FORMATTING #include "unicode/uobject.h" U_NAMESPACE_BEGIN /** * <code>FieldPosition</code> is a simple class used by <code>Format</code> * and its subclasses to identify fields in formatted output. Fields are * identified by constants, whose names typically end with <code>_FIELD</code>, * defined in the various subclasses of <code>Format</code>. See * <code>ERA_FIELD</code> and its friends in <code>DateFormat</code> for * an example. * * <p> * <code>FieldPosition</code> keeps track of the position of the * field within the formatted output with two indices: the index * of the first character of the field and the index of the last * character of the field. * * <p> * One version of the <code>format</code> method in the various * <code>Format</code> classes requires a <code>FieldPosition</code> * object as an argument. You use this <code>format</code> method * to perform partial formatting or to get information about the * formatted output (such as the position of a field). * * The FieldPosition class is not intended for public subclassing. * * <p> * Below is an example of using <code>FieldPosition</code> to aid * alignment of an array of formatted floating-point numbers on * their decimal points: * <pre> * \code * double doubleNum[] = {123456789.0, -12345678.9, 1234567.89, -123456.789, * 12345.6789, -1234.56789, 123.456789, -12.3456789, 1.23456789}; * int dNumSize = (int)(sizeof(doubleNum)/sizeof(double)); * * UErrorCode status = U_ZERO_ERROR; * DecimalFormat* fmt = (DecimalFormat*) NumberFormat::createInstance(status); * fmt->setDecimalSeparatorAlwaysShown(true); * * const int tempLen = 20; * char temp[tempLen]; * * for (int i=0; i<dNumSize; i++) { * FieldPosition pos(NumberFormat::INTEGER_FIELD); * UnicodeString buf; * char fmtText[tempLen]; * ToCharString(fmt->format(doubleNum[i], buf, pos), fmtText); * for (int j=0; j<tempLen; j++) temp[j] = ' '; // clear with spaces * temp[__min(tempLen, tempLen-pos.getEndIndex())] = '\0'; * cout << temp << fmtText << endl; * } * delete fmt; * \endcode * </pre> * <p> * The code will generate the following output: * <pre> * \code * 123,456,789.000 * -12,345,678.900 * 1,234,567.880 * -123,456.789 * 12,345.678 * -1,234.567 * 123.456 * -12.345 * 1.234 * \endcode * </pre> */ class U_I18N_API FieldPosition : public UObject { public: /** * DONT_CARE may be specified as the field to indicate that the * caller doesn't need to specify a field. * @stable ICU 2.0 */ enum { DONT_CARE = -1 }; /** * Creates a FieldPosition object with a non-specified field. * @stable ICU 2.0 */ FieldPosition() : UObject(), fField(DONT_CARE), fBeginIndex(0), fEndIndex(0) {} /** * Creates a FieldPosition object for the given field. Fields are * identified by constants, whose names typically end with _FIELD, * in the various subclasses of Format. * * @see NumberFormat#INTEGER_FIELD * @see NumberFormat#FRACTION_FIELD * @see DateFormat#YEAR_FIELD * @see DateFormat#MONTH_FIELD * @stable ICU 2.0 */ FieldPosition(int32_t field) : UObject(), fField(field), fBeginIndex(0), fEndIndex(0) {} /** * Copy constructor * @param copy the object to be copied from. * @stable ICU 2.0 */ FieldPosition(const FieldPosition& copy) : UObject(copy), fField(copy.fField), fBeginIndex(copy.fBeginIndex), fEndIndex(copy.fEndIndex) {} /** * Destructor * @stable ICU 2.0 */ virtual ~FieldPosition(); /** * Assignment operator * @param copy the object to be copied from. * @stable ICU 2.0 */ FieldPosition& operator=(const FieldPosition& copy); /** * Equality operator. * @param that the object to be compared with. * @return TRUE if the two field positions are equal, FALSE otherwise. * @stable ICU 2.0 */ UBool operator==(const FieldPosition& that) const; /** * Equality operator. * @param that the object to be compared with. * @return TRUE if the two field positions are not equal, FALSE otherwise. * @stable ICU 2.0 */ UBool operator!=(const FieldPosition& that) const; /** * Clone this object. * Clones can be used concurrently in multiple threads. * If an error occurs, then NULL is returned. * The caller must delete the clone. * * @return a clone of this object * * @see getDynamicClassID * @stable ICU 2.8 */ FieldPosition *clone() const; /** * Retrieve the field identifier. * @return the field identifier. * @stable ICU 2.0 */ int32_t getField(void) const { return fField; } /** * Retrieve the index of the first character in the requested field. * @return the index of the first character in the requested field. * @stable ICU 2.0 */ int32_t getBeginIndex(void) const { return fBeginIndex; } /** * Retrieve the index of the character following the last character in the * requested field. * @return the index of the character following the last character in the * requested field. * @stable ICU 2.0 */ int32_t getEndIndex(void) const { return fEndIndex; } /** * Set the field. * @param f the new value of the field. * @stable ICU 2.0 */ void setField(int32_t f) { fField = f; } /** * Set the begin index. For use by subclasses of Format. * @param bi the new value of the begin index * @stable ICU 2.0 */ void setBeginIndex(int32_t bi) { fBeginIndex = bi; } /** * Set the end index. For use by subclasses of Format. * @param ei the new value of the end index * @stable ICU 2.0 */ void setEndIndex(int32_t ei) { fEndIndex = ei; } /** * ICU "poor man's RTTI", returns a UClassID for the actual class. * * @stable ICU 2.2 */ virtual UClassID getDynamicClassID() const; /** * ICU "poor man's RTTI", returns a UClassID for this class. * * @stable ICU 2.2 */ static UClassID U_EXPORT2 getStaticClassID(); private: /** * Input: Desired field to determine start and end offsets for. * The meaning depends on the subclass of Format. */ int32_t fField; /** * Output: Start offset of field in text. * If the field does not occur in the text, 0 is returned. */ int32_t fBeginIndex; /** * Output: End offset of field in text. * If the field does not occur in the text, 0 is returned. */ int32_t fEndIndex; }; inline FieldPosition& FieldPosition::operator=(const FieldPosition& copy) { fField = copy.fField; fEndIndex = copy.fEndIndex; fBeginIndex = copy.fBeginIndex; return *this; } inline UBool FieldPosition::operator==(const FieldPosition& copy) const { return (fField == copy.fField && fEndIndex == copy.fEndIndex && fBeginIndex == copy.fBeginIndex); } inline UBool FieldPosition::operator!=(const FieldPosition& copy) const { return !operator==(copy); } U_NAMESPACE_END #endif /* #if !UCONFIG_NO_FORMATTING */ #endif /* U_SHOW_CPLUSPLUS_API */ #endif // _FIELDPOS //eof
Save
cmd:
run