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: uiter.h
Close
// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * * Copyright (C) 2002-2011 International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* * file name: uiter.h * encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * * created on: 2002jan18 * created by: Markus W. Scherer */ #ifndef __UITER_H__ #define __UITER_H__ /** * \file * \brief C API: Unicode Character Iteration * * @see UCharIterator */ #include "unicode/utypes.h" #if U_SHOW_CPLUSPLUS_API U_NAMESPACE_BEGIN class CharacterIterator; class Replaceable; U_NAMESPACE_END #endif U_CDECL_BEGIN struct UCharIterator; typedef struct UCharIterator UCharIterator; /**< C typedef for struct UCharIterator. @stable ICU 2.1 */ /** * Origin constants for UCharIterator.getIndex() and UCharIterator.move(). * @see UCharIteratorMove * @see UCharIterator * @stable ICU 2.1 */ typedef enum UCharIteratorOrigin { UITER_START, UITER_CURRENT, UITER_LIMIT, UITER_ZERO, UITER_LENGTH } UCharIteratorOrigin; /** Constants for UCharIterator. @stable ICU 2.6 */ enum { /** * Constant value that may be returned by UCharIteratorMove * indicating that the final UTF-16 index is not known, but that the move succeeded. * This can occur when moving relative to limit or length, or * when moving relative to the current index after a setState() * when the current UTF-16 index is not known. * * It would be very inefficient to have to count from the beginning of the text * just to get the current/limit/length index after moving relative to it. * The actual index can be determined with getIndex(UITER_CURRENT) * which will count the UChars if necessary. * * @stable ICU 2.6 */ UITER_UNKNOWN_INDEX=-2 }; /** * Constant for UCharIterator getState() indicating an error or * an unknown state. * Returned by uiter_getState()/UCharIteratorGetState * when an error occurs. * Also, some UCharIterator implementations may not be able to return * a valid state for each position. This will be clearly documented * for each such iterator (none of the public ones here). * * @stable ICU 2.6 */ #define UITER_NO_STATE ((uint32_t)0xffffffff) /** * Function type declaration for UCharIterator.getIndex(). * * Gets the current position, or the start or limit of the * iteration range. * * This function may perform slowly for UITER_CURRENT after setState() was called, * or for UITER_LENGTH, because an iterator implementation may have to count * UChars if the underlying storage is not UTF-16. * * @param iter the UCharIterator structure ("this pointer") * @param origin get the 0, start, limit, length, or current index * @return the requested index, or U_SENTINEL in an error condition * * @see UCharIteratorOrigin * @see UCharIterator * @stable ICU 2.1 */ typedef int32_t U_CALLCONV UCharIteratorGetIndex(UCharIterator *iter, UCharIteratorOrigin origin); /** * Function type declaration for UCharIterator.move(). * * Use iter->move(iter, index, UITER_ZERO) like CharacterIterator::setIndex(index). * * Moves the current position relative to the start or limit of the * iteration range, or relative to the current position itself. * The movement is expressed in numbers of code units forward * or backward by specifying a positive or negative delta. * Out of bounds movement will be pinned to the start or limit. * * This function may perform slowly for moving relative to UITER_LENGTH * because an iterator implementation may have to count the rest of the * UChars if the native storage is not UTF-16. * * When moving relative to the limit or length, or * relative to the current position after setState() was called, * move() may return UITER_UNKNOWN_INDEX (-2) to avoid an inefficient * determination of the actual UTF-16 index. * The actual index can be determined with getIndex(UITER_CURRENT) * which will count the UChars if necessary. * See UITER_UNKNOWN_INDEX for details. * * @param iter the UCharIterator structure ("this pointer") * @param delta can be positive, zero, or negative * @param origin move relative to the 0, start, limit, length, or current index * @return the new index, or U_SENTINEL on an error condition, * or UITER_UNKNOWN_INDEX when the index is not known. * * @see UCharIteratorOrigin * @see UCharIterator * @see UITER_UNKNOWN_INDEX * @stable ICU 2.1 */ typedef int32_t U_CALLCONV UCharIteratorMove(UCharIterator *iter, int32_t delta, UCharIteratorOrigin origin); /** * Function type declaration for UCharIterator.hasNext(). * * Check if current() and next() can still * return another code unit. * * @param iter the UCharIterator structure ("this pointer") * @return boolean value for whether current() and next() can still return another code unit * * @see UCharIterator * @stable ICU 2.1 */ typedef UBool U_CALLCONV UCharIteratorHasNext(UCharIterator *iter); /** * Function type declaration for UCharIterator.hasPrevious(). * * Check if previous() can still return another code unit. * * @param iter the UCharIterator structure ("this pointer") * @return boolean value for whether previous() can still return another code unit * * @see UCharIterator * @stable ICU 2.1 */ typedef UBool U_CALLCONV UCharIteratorHasPrevious(UCharIterator *iter); /** * Function type declaration for UCharIterator.current(). * * Return the code unit at the current position, * or U_SENTINEL if there is none (index is at the limit). * * @param iter the UCharIterator structure ("this pointer") * @return the current code unit * * @see UCharIterator * @stable ICU 2.1 */ typedef UChar32 U_CALLCONV UCharIteratorCurrent(UCharIterator *iter); /** * Function type declaration for UCharIterator.next(). * * Return the code unit at the current index and increment * the index (post-increment, like s[i++]), * or return U_SENTINEL if there is none (index is at the limit). * * @param iter the UCharIterator structure ("this pointer") * @return the current code unit (and post-increment the current index) * * @see UCharIterator * @stable ICU 2.1 */ typedef UChar32 U_CALLCONV UCharIteratorNext(UCharIterator *iter); /** * Function type declaration for UCharIterator.previous(). * * Decrement the index and return the code unit from there * (pre-decrement, like s[--i]), * or return U_SENTINEL if there is none (index is at the start). * * @param iter the UCharIterator structure ("this pointer") * @return the previous code unit (after pre-decrementing the current index) * * @see UCharIterator * @stable ICU 2.1 */ typedef UChar32 U_CALLCONV UCharIteratorPrevious(UCharIterator *iter); /** * Function type declaration for UCharIterator.reservedFn(). * Reserved for future use. * * @param iter the UCharIterator structure ("this pointer") * @param something some integer argument * @return some integer * * @see UCharIterator * @stable ICU 2.1 */ typedef int32_t U_CALLCONV UCharIteratorReserved(UCharIterator *iter, int32_t something); /** * Function type declaration for UCharIterator.getState(). * * Get the "state" of the iterator in the form of a single 32-bit word. * It is recommended that the state value be calculated to be as small as * is feasible. For strings with limited lengths, fewer than 32 bits may * be sufficient. * * This is used together with setState()/UCharIteratorSetState * to save and restore the iterator position more efficiently than with * getIndex()/move(). * * The iterator state is defined as a uint32_t value because it is designed * for use in ucol_nextSortKeyPart() which provides 32 bits to store the state * of the character iterator. * * With some UCharIterator implementations (e.g., UTF-8), * getting and setting the UTF-16 index with existing functions * (getIndex(UITER_CURRENT) followed by move(pos, UITER_ZERO)) is possible but * relatively slow because the iterator has to "walk" from a known index * to the requested one. * This takes more time the farther it needs to go. * * An opaque state value allows an iterator implementation to provide * an internal index (UTF-8: the source byte array index) for * fast, constant-time restoration. * * After calling setState(), a getIndex(UITER_CURRENT) may be slow because * the UTF-16 index may not be restored as well, but the iterator can deliver * the correct text contents and move relative to the current position * without performance degradation. * * Some UCharIterator implementations may not be able to return * a valid state for each position, in which case they return UITER_NO_STATE instead. * This will be clearly documented for each such iterator (none of the public ones here). * * @param iter the UCharIterator structure ("this pointer") * @return the state word * * @see UCharIterator * @see UCharIteratorSetState * @see UITER_NO_STATE * @stable ICU 2.6 */ typedef uint32_t U_CALLCONV UCharIteratorGetState(const UCharIterator *iter); /** * Function type declaration for UCharIterator.setState(). * * Restore the "state" of the iterator using a state word from a getState() call. * The iterator object need not be the same one as for which getState() was called, * but it must be of the same type (set up using the same uiter_setXYZ function) * and it must iterate over the same string * (binary identical regardless of memory address). * For more about the state word see UCharIteratorGetState. * * After calling setState(), a getIndex(UITER_CURRENT) may be slow because * the UTF-16 index may not be restored as well, but the iterator can deliver * the correct text contents and move relative to the current position * without performance degradation. * * @param iter the UCharIterator structure ("this pointer") * @param state the state word from a getState() call * on a same-type, same-string iterator * @param pErrorCode Must be a valid pointer to an error code value, * which must not indicate a failure before the function call. * * @see UCharIterator * @see UCharIteratorGetState * @stable ICU 2.6 */ typedef void U_CALLCONV UCharIteratorSetState(UCharIterator *iter, uint32_t state, UErrorCode *pErrorCode); /** * C API for code unit iteration. * This can be used as a C wrapper around * CharacterIterator, Replaceable, or implemented using simple strings, etc. * * There are two roles for using UCharIterator: * * A "provider" sets the necessary function pointers and controls the "protected" * fields of the UCharIterator structure. A "provider" passes a UCharIterator * into C APIs that need a UCharIterator as an abstract, flexible string interface. * * Implementations of such C APIs are "callers" of UCharIterator functions; * they only use the "public" function pointers and never access the "protected" * fields directly. * * The current() and next() functions only check the current index against the * limit, and previous() only checks the current index against the start, * to see if the iterator already reached the end of the iteration range. * * The assumption - in all iterators - is that the index is moved via the API, * which means it won't go out of bounds, or the index is modified by * user code that knows enough about the iterator implementation to set valid * index values. * * UCharIterator functions return code unit values 0..0xffff, * or U_SENTINEL if the iteration bounds are reached. * * @stable ICU 2.1 */ struct UCharIterator { /** * (protected) Pointer to string or wrapped object or similar. * Not used by caller. * @stable ICU 2.1 */ const void *context; /** * (protected) Length of string or similar. * Not used by caller. * @stable ICU 2.1 */ int32_t length; /** * (protected) Start index or similar. * Not used by caller. * @stable ICU 2.1 */ int32_t start; /** * (protected) Current index or similar. * Not used by caller. * @stable ICU 2.1 */ int32_t index; /** * (protected) Limit index or similar. * Not used by caller. * @stable ICU 2.1 */ int32_t limit; /** * (protected) Used by UTF-8 iterators and possibly others. * @stable ICU 2.1 */ int32_t reservedField; /** * (public) Returns the current position or the * start or limit index of the iteration range. * * @see UCharIteratorGetIndex * @stable ICU 2.1 */ UCharIteratorGetIndex *getIndex; /** * (public) Moves the current position relative to the start or limit of the * iteration range, or relative to the current position itself. * The movement is expressed in numbers of code units forward * or backward by specifying a positive or negative delta. * * @see UCharIteratorMove * @stable ICU 2.1 */ UCharIteratorMove *move; /** * (public) Check if current() and next() can still * return another code unit. * * @see UCharIteratorHasNext * @stable ICU 2.1 */ UCharIteratorHasNext *hasNext; /** * (public) Check if previous() can still return another code unit. * * @see UCharIteratorHasPrevious * @stable ICU 2.1 */ UCharIteratorHasPrevious *hasPrevious; /** * (public) Return the code unit at the current position, * or U_SENTINEL if there is none (index is at the limit). * * @see UCharIteratorCurrent * @stable ICU 2.1 */ UCharIteratorCurrent *current; /** * (public) Return the code unit at the current index and increment * the index (post-increment, like s[i++]), * or return U_SENTINEL if there is none (index is at the limit). * * @see UCharIteratorNext * @stable ICU 2.1 */ UCharIteratorNext *next; /** * (public) Decrement the index and return the code unit from there * (pre-decrement, like s[--i]), * or return U_SENTINEL if there is none (index is at the start). * * @see UCharIteratorPrevious * @stable ICU 2.1 */ UCharIteratorPrevious *previous; /** * (public) Reserved for future use. Currently NULL. * * @see UCharIteratorReserved * @stable ICU 2.1 */ UCharIteratorReserved *reservedFn; /** * (public) Return the state of the iterator, to be restored later with setState(). * This function pointer is NULL if the iterator does not implement it. * * @see UCharIteratorGet * @stable ICU 2.6 */ UCharIteratorGetState *getState; /** * (public) Restore the iterator state from the state word from a call * to getState(). * This function pointer is NULL if the iterator does not implement it. * * @see UCharIteratorSet * @stable ICU 2.6 */ UCharIteratorSetState *setState; }; /** * Helper function for UCharIterator to get the code point * at the current index. * * Return the code point that includes the code unit at the current position, * or U_SENTINEL if there is none (index is at the limit). * If the current code unit is a lead or trail surrogate, * then the following or preceding surrogate is used to form * the code point value. * * @param iter the UCharIterator structure ("this pointer") * @return the current code point * * @see UCharIterator * @see U16_GET * @see UnicodeString::char32At() * @stable ICU 2.1 */ U_STABLE UChar32 U_EXPORT2 uiter_current32(UCharIterator *iter); /** * Helper function for UCharIterator to get the next code point. * * Return the code point at the current index and increment * the index (post-increment, like s[i++]), * or return U_SENTINEL if there is none (index is at the limit). * * @param iter the UCharIterator structure ("this pointer") * @return the current code point (and post-increment the current index) * * @see UCharIterator * @see U16_NEXT * @stable ICU 2.1 */ U_STABLE UChar32 U_EXPORT2 uiter_next32(UCharIterator *iter); /** * Helper function for UCharIterator to get the previous code point. * * Decrement the index and return the code point from there * (pre-decrement, like s[--i]), * or return U_SENTINEL if there is none (index is at the start). * * @param iter the UCharIterator structure ("this pointer") * @return the previous code point (after pre-decrementing the current index) * * @see UCharIterator * @see U16_PREV * @stable ICU 2.1 */ U_STABLE UChar32 U_EXPORT2 uiter_previous32(UCharIterator *iter); /** * Get the "state" of the iterator in the form of a single 32-bit word. * This is a convenience function that calls iter->getState(iter) * if iter->getState is not NULL; * if it is NULL or any other error occurs, then UITER_NO_STATE is returned. * * Some UCharIterator implementations may not be able to return * a valid state for each position, in which case they return UITER_NO_STATE instead. * This will be clearly documented for each such iterator (none of the public ones here). * * @param iter the UCharIterator structure ("this pointer") * @return the state word * * @see UCharIterator * @see UCharIteratorGetState * @see UITER_NO_STATE * @stable ICU 2.6 */ U_STABLE uint32_t U_EXPORT2 uiter_getState(const UCharIterator *iter); /** * Restore the "state" of the iterator using a state word from a getState() call. * This is a convenience function that calls iter->setState(iter, state, pErrorCode) * if iter->setState is not NULL; if it is NULL, then U_UNSUPPORTED_ERROR is set. * * @param iter the UCharIterator structure ("this pointer") * @param state the state word from a getState() call * on a same-type, same-string iterator * @param pErrorCode Must be a valid pointer to an error code value, * which must not indicate a failure before the function call. * * @see UCharIterator * @see UCharIteratorSetState * @stable ICU 2.6 */ U_STABLE void U_EXPORT2 uiter_setState(UCharIterator *iter, uint32_t state, UErrorCode *pErrorCode); /** * Set up a UCharIterator to iterate over a string. * * Sets the UCharIterator function pointers for iteration over the string s * with iteration boundaries start=index=0 and length=limit=string length. * The "provider" may set the start, index, and limit values at any time * within the range 0..length. * The length field will be ignored. * * The string pointer s is set into UCharIterator.context without copying * or reallocating the string contents. * * getState() simply returns the current index. * move() will always return the final index. * * @param iter UCharIterator structure to be set for iteration * @param s String to iterate over * @param length Length of s, or -1 if NUL-terminated * * @see UCharIterator * @stable ICU 2.1 */ U_STABLE void U_EXPORT2 uiter_setString(UCharIterator *iter, const UChar *s, int32_t length); /** * Set up a UCharIterator to iterate over a UTF-16BE string * (byte vector with a big-endian pair of bytes per UChar). * * Everything works just like with a normal UChar iterator (uiter_setString), * except that UChars are assembled from byte pairs, * and that the length argument here indicates an even number of bytes. * * getState() simply returns the current index. * move() will always return the final index. * * @param iter UCharIterator structure to be set for iteration * @param s UTF-16BE string to iterate over * @param length Length of s as an even number of bytes, or -1 if NUL-terminated * (NUL means pair of 0 bytes at even index from s) * * @see UCharIterator * @see uiter_setString * @stable ICU 2.6 */ U_STABLE void U_EXPORT2 uiter_setUTF16BE(UCharIterator *iter, const char *s, int32_t length); /** * Set up a UCharIterator to iterate over a UTF-8 string. * * Sets the UCharIterator function pointers for iteration over the UTF-8 string s * with UTF-8 iteration boundaries 0 and length. * The implementation counts the UTF-16 index on the fly and * lazily evaluates the UTF-16 length of the text. * * The start field is used as the UTF-8 offset, the limit field as the UTF-8 length. * When the reservedField is not 0, then it contains a supplementary code point * and the UTF-16 index is between the two corresponding surrogates. * At that point, the UTF-8 index is behind that code point. * * The UTF-8 string pointer s is set into UCharIterator.context without copying * or reallocating the string contents. * * getState() returns a state value consisting of * - the current UTF-8 source byte index (bits 31..1) * - a flag (bit 0) that indicates whether the UChar position is in the middle * of a surrogate pair * (from a 4-byte UTF-8 sequence for the corresponding supplementary code point) * * getState() cannot also encode the UTF-16 index in the state value. * move(relative to limit or length), or * move(relative to current) after setState(), may return UITER_UNKNOWN_INDEX. * * @param iter UCharIterator structure to be set for iteration * @param s UTF-8 string to iterate over * @param length Length of s in bytes, or -1 if NUL-terminated * * @see UCharIterator * @stable ICU 2.6 */ U_STABLE void U_EXPORT2 uiter_setUTF8(UCharIterator *iter, const char *s, int32_t length); #if U_SHOW_CPLUSPLUS_API /** * Set up a UCharIterator to wrap around a C++ CharacterIterator. * * Sets the UCharIterator function pointers for iteration using the * CharacterIterator charIter. * * The CharacterIterator pointer charIter is set into UCharIterator.context * without copying or cloning the CharacterIterator object. * The other "protected" UCharIterator fields are set to 0 and will be ignored. * The iteration index and boundaries are controlled by the CharacterIterator. * * getState() simply returns the current index. * move() will always return the final index. * * @param iter UCharIterator structure to be set for iteration * @param charIter CharacterIterator to wrap * * @see UCharIterator * @stable ICU 2.1 */ U_STABLE void U_EXPORT2 uiter_setCharacterIterator(UCharIterator *iter, icu::CharacterIterator *charIter); /** * Set up a UCharIterator to iterate over a C++ Replaceable. * * Sets the UCharIterator function pointers for iteration over the * Replaceable rep with iteration boundaries start=index=0 and * length=limit=rep->length(). * The "provider" may set the start, index, and limit values at any time * within the range 0..length=rep->length(). * The length field will be ignored. * * The Replaceable pointer rep is set into UCharIterator.context without copying * or cloning/reallocating the Replaceable object. * * getState() simply returns the current index. * move() will always return the final index. * * @param iter UCharIterator structure to be set for iteration * @param rep Replaceable to iterate over * * @see UCharIterator * @stable ICU 2.1 */ U_STABLE void U_EXPORT2 uiter_setReplaceable(UCharIterator *iter, const icu::Replaceable *rep); #endif U_CDECL_END #endif