/
usr
/
include
/
unicode
/
/usr/include/unicode
mkdir
upload
Name
Size
Mode
Actions
alphaindex.h
27158
0644
edit
dl
rm
appendable.h
8739
0644
edit
dl
rm
basictz.h
10163
0644
edit
dl
rm
brkiter.h
28478
0644
edit
dl
rm
bytestream.h
11013
0644
edit
dl
rm
bytestrie.h
21268
0644
edit
dl
rm
bytestriebuilder.h
7640
0644
edit
dl
rm
calendar.h
108424
0644
edit
dl
rm
caniter.h
7621
0644
edit
dl
rm
casemap.h
25933
0644
edit
dl
rm
char16ptr.h
7393
0644
edit
dl
rm
chariter.h
24638
0644
edit
dl
rm
choicfmt.h
24544
0644
edit
dl
rm
coleitr.h
14102
0644
edit
dl
rm
coll.h
57615
0644
edit
dl
rm
compactdecimalformat.h
7047
0644
edit
dl
rm
curramt.h
3869
0644
edit
dl
rm
currpinf.h
7479
0644
edit
dl
rm
currunit.h
4112
0644
edit
dl
rm
datefmt.h
41690
0644
edit
dl
rm
dbbi.h
1223
0644
edit
dl
rm
dcfmtsym.h
21101
0644
edit
dl
rm
decimfmt.h
89676
0644
edit
dl
rm
docmain.h
7380
0644
edit
dl
rm
dtfmtsym.h
39126
0644
edit
dl
rm
dtintrv.h
3935
0644
edit
dl
rm
dtitvfmt.h
50448
0644
edit
dl
rm
dtitvinf.h
19072
0644
edit
dl
rm
dtptngen.h
26692
0644
edit
dl
rm
dtrule.h
8898
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
8906
0644
edit
dl
rm
filteredbrk.h
5501
0644
edit
dl
rm
fmtable.h
25020
0644
edit
dl
rm
format.h
12802
0644
edit
dl
rm
formattedvalue.h
9987
0644
edit
dl
rm
fpositer.h
3107
0644
edit
dl
rm
gender.h
3408
0644
edit
dl
rm
gregocal.h
32642
0644
edit
dl
rm
icudataver.h
1049
0644
edit
dl
rm
icuplug.h
12109
0644
edit
dl
rm
idna.h
13000
0644
edit
dl
rm
listformatter.h
9004
0644
edit
dl
rm
localebuilder.h
11350
0644
edit
dl
rm
localematcher.h
27467
0644
edit
dl
rm
localpointer.h
19825
0644
edit
dl
rm
locdspnm.h
7292
0644
edit
dl
rm
locid.h
48804
0644
edit
dl
rm
measfmt.h
11690
0644
edit
dl
rm
measunit.h
107613
0644
edit
dl
rm
measure.h
4431
0644
edit
dl
rm
messagepattern.h
34517
0644
edit
dl
rm
msgfmt.h
45278
0644
edit
dl
rm
normalizer2.h
34466
0644
edit
dl
rm
normlzr.h
31690
0644
edit
dl
rm
nounit.h
2305
0644
edit
dl
rm
numberformatter.h
94505
0644
edit
dl
rm
numberrangeformatter.h
25790
0644
edit
dl
rm
numfmt.h
51034
0644
edit
dl
rm
numsys.h
7509
0644
edit
dl
rm
parseerr.h
3155
0644
edit
dl
rm
parsepos.h
5699
0644
edit
dl
rm
platform.h
28768
0644
edit
dl
rm
plurfmt.h
25847
0644
edit
dl
rm
plurrule.h
21316
0644
edit
dl
rm
ptypes.h
3577
0644
edit
dl
rm
putil.h
6471
0644
edit
dl
rm
rbbi.h
28413
0644
edit
dl
rm
rbnf.h
50021
0644
edit
dl
rm
rbtz.h
16210
0644
edit
dl
rm
regex.h
86385
0644
edit
dl
rm
region.h
9402
0644
edit
dl
rm
reldatefmt.h
22751
0644
edit
dl
rm
rep.h
9599
0644
edit
dl
rm
resbund.h
18513
0644
edit
dl
rm
schriter.h
6511
0644
edit
dl
rm
scientificnumberformatter.h
6589
0644
edit
dl
rm
search.h
22755
0644
edit
dl
rm
selfmt.h
14686
0644
edit
dl
rm
simpleformatter.h
12888
0644
edit
dl
rm
simpletz.h
46798
0644
edit
dl
rm
smpdtfmt.h
72778
0644
edit
dl
rm
sortkey.h
11452
0644
edit
dl
rm
std_string.h
1076
0644
edit
dl
rm
strenum.h
10157
0644
edit
dl
rm
stringoptions.h
5926
0644
edit
dl
rm
stringpiece.h
10287
0644
edit
dl
rm
stringtriebuilder.h
15842
0644
edit
dl
rm
stsearch.h
21926
0644
edit
dl
rm
symtable.h
4374
0644
edit
dl
rm
tblcoll.h
37801
0644
edit
dl
rm
timezone.h
44858
0644
edit
dl
rm
tmunit.h
3479
0644
edit
dl
rm
tmutamt.h
5029
0644
edit
dl
rm
tmutfmt.h
7602
0644
edit
dl
rm
translit.h
67397
0644
edit
dl
rm
tzfmt.h
43961
0644
edit
dl
rm
tznames.h
17251
0644
edit
dl
rm
tzrule.h
36450
0644
edit
dl
rm
tztrans.h
6278
0644
edit
dl
rm
ubidi.h
91759
0644
edit
dl
rm
ubiditransform.h
13003
0644
edit
dl
rm
ubrk.h
25043
0644
edit
dl
rm
ucal.h
62463
0644
edit
dl
rm
ucasemap.h
15579
0644
edit
dl
rm
ucat.h
5478
0644
edit
dl
rm
uchar.h
148111
0644
edit
dl
rm
ucharstrie.h
23066
0644
edit
dl
rm
ucharstriebuilder.h
7645
0644
edit
dl
rm
uchriter.h
13747
0644
edit
dl
rm
uclean.h
11468
0644
edit
dl
rm
ucnv.h
85051
0644
edit
dl
rm
ucnvsel.h
6339
0644
edit
dl
rm
ucnv_cb.h
6738
0644
edit
dl
rm
ucnv_err.h
21481
0644
edit
dl
rm
ucol.h
62987
0644
edit
dl
rm
ucoleitr.h
10056
0644
edit
dl
rm
uconfig.h
12356
0644
edit
dl
rm
ucpmap.h
5663
0644
edit
dl
rm
ucptrie.h
23044
0644
edit
dl
rm
ucsdet.h
15043
0644
edit
dl
rm
ucurr.h
17122
0644
edit
dl
rm
udat.h
63902
0644
edit
dl
rm
udata.h
16004
0644
edit
dl
rm
udateintervalformat.h
12218
0644
edit
dl
rm
udatpg.h
27405
0644
edit
dl
rm
udisplaycontext.h
6084
0644
edit
dl
rm
uenum.h
7981
0644
edit
dl
rm
ufieldpositer.h
4513
0644
edit
dl
rm
uformattable.h
11233
0644
edit
dl
rm
uformattedvalue.h
12600
0644
edit
dl
rm
ugender.h
2106
0644
edit
dl
rm
uidna.h
34229
0644
edit
dl
rm
uiter.h
23299
0644
edit
dl
rm
uldnames.h
10733
0644
edit
dl
rm
ulistformatter.h
11043
0644
edit
dl
rm
uloc.h
55936
0644
edit
dl
rm
ulocdata.h
11572
0644
edit
dl
rm
umachine.h
16439
0644
edit
dl
rm
umisc.h
1365
0644
edit
dl
rm
umsg.h
24832
0644
edit
dl
rm
umutablecptrie.h
8490
0644
edit
dl
rm
unifilt.h
4091
0644
edit
dl
rm
unifunct.h
4151
0644
edit
dl
rm
unimatch.h
6244
0644
edit
dl
rm
unirepl.h
3464
0644
edit
dl
rm
uniset.h
68108
0644
edit
dl
rm
unistr.h
174627
0644
edit
dl
rm
unorm.h
21042
0644
edit
dl
rm
unorm2.h
25269
0644
edit
dl
rm
unum.h
56269
0644
edit
dl
rm
unumberformatter.h
31177
0644
edit
dl
rm
unumberrangeformatter.h
15737
0644
edit
dl
rm
unumsys.h
7430
0644
edit
dl
rm
uobject.h
10934
0644
edit
dl
rm
upluralrules.h
8997
0644
edit
dl
rm
uregex.h
73719
0644
edit
dl
rm
uregion.h
10047
0644
edit
dl
rm
ureldatefmt.h
17448
0644
edit
dl
rm
urename.h
137853
0644
edit
dl
rm
urep.h
5507
0644
edit
dl
rm
ures.h
37418
0644
edit
dl
rm
uscript.h
28291
0644
edit
dl
rm
usearch.h
40153
0644
edit
dl
rm
uset.h
45503
0644
edit
dl
rm
usetiter.h
9910
0644
edit
dl
rm
ushape.h
18430
0644
edit
dl
rm
uspoof.h
67425
0644
edit
dl
rm
usprep.h
8382
0644
edit
dl
rm
ustdio.h
39482
0644
edit
dl
rm
ustream.h
1934
0644
edit
dl
rm
ustring.h
74096
0644
edit
dl
rm
ustringtrie.h
3224
0644
edit
dl
rm
utext.h
59471
0644
edit
dl
rm
utf.h
8057
0644
edit
dl
rm
utf8.h
31572
0644
edit
dl
rm
utf16.h
23910
0644
edit
dl
rm
utf32.h
763
0644
edit
dl
rm
utf_old.h
46929
0644
edit
dl
rm
utmscale.h
14107
0644
edit
dl
rm
utrace.h
17595
0644
edit
dl
rm
utrans.h
26157
0644
edit
dl
rm
utypes.h
31807
0644
edit
dl
rm
uvernum.h
6839
0644
edit
dl
rm
uversion.h
6137
0644
edit
dl
rm
vtzone.h
21303
0644
edit
dl
rm
Edit:
/usr/include/unicode/coleitr.h
(14102B)
// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** * Copyright (C) 1997-2014, International Business Machines * Corporation and others. All Rights Reserved. ****************************************************************************** */ /** * \file * \brief C++ API: Collation Element Iterator. */ /** * File coleitr.h * * Created by: Helena Shih * * Modification History: * * Date Name Description * * 8/18/97 helena Added internal API documentation. * 08/03/98 erm Synched with 1.2 version CollationElementIterator.java * 12/10/99 aliu Ported Thai collation support from Java. * 01/25/01 swquek Modified into a C++ wrapper calling C APIs (ucoliter.h) * 02/19/01 swquek Removed CollationElementsIterator() since it is * private constructor and no calls are made to it * 2012-2014 markus Rewritten in C++ again. */ #ifndef COLEITR_H #define COLEITR_H #include "unicode/utypes.h" #if U_SHOW_CPLUSPLUS_API #if !UCONFIG_NO_COLLATION #include "unicode/unistr.h" #include "unicode/uobject.h" struct UCollationElements; struct UHashtable; U_NAMESPACE_BEGIN struct CollationData; class CharacterIterator; class CollationIterator; class RuleBasedCollator; class UCollationPCE; class UVector32; /** * The CollationElementIterator class is used as an iterator to walk through * each character of an international string. Use the iterator to return the * ordering priority of the positioned character. The ordering priority of a * character, which we refer to as a key, defines how a character is collated in * the given collation object. * For example, consider the following in Slovak and in traditional Spanish collation: * <pre> * "ca" -> the first key is key('c') and second key is key('a'). * "cha" -> the first key is key('ch') and second key is key('a').</pre> * And in German phonebook collation, * <pre> \htmlonly "æb"-> the first key is key('a'), the second key is key('e'), and * the third key is key('b'). \endhtmlonly </pre> * The key of a character, is an integer composed of primary order(short), * secondary order(char), and tertiary order(char). Java strictly defines the * size and signedness of its primitive data types. Therefore, the static * functions primaryOrder(), secondaryOrder(), and tertiaryOrder() return * int32_t to ensure the correctness of the key value. * <p>Example of the iterator usage: (without error checking) * <pre> * \code * void CollationElementIterator_Example() * { * UnicodeString str = "This is a test"; * UErrorCode success = U_ZERO_ERROR; * RuleBasedCollator* rbc = * (RuleBasedCollator*) RuleBasedCollator::createInstance(success); * CollationElementIterator* c = * rbc->createCollationElementIterator( str ); * int32_t order = c->next(success); * c->reset(); * order = c->previous(success); * delete c; * delete rbc; * } * \endcode * </pre> * <p> * The method next() returns the collation order of the next character based on * the comparison level of the collator. The method previous() returns the * collation order of the previous character based on the comparison level of * the collator. The Collation Element Iterator moves only in one direction * between calls to reset(), setOffset(), or setText(). That is, next() * and previous() can not be inter-used. Whenever previous() is to be called after * next() or vice versa, reset(), setOffset() or setText() has to be called first * to reset the status, shifting pointers to either the end or the start of * the string (reset() or setText()), or the specified position (setOffset()). * Hence at the next call of next() or previous(), the first or last collation order, * or collation order at the specified position will be returned. If a change of * direction is done without one of these calls, the result is undefined. * <p> * The result of a forward iterate (next()) and reversed result of the backward * iterate (previous()) on the same string are equivalent, if collation orders * with the value 0 are ignored. * Character based on the comparison level of the collator. A collation order * consists of primary order, secondary order and tertiary order. The data * type of the collation order is <strong>int32_t</strong>. * * Note, CollationElementIterator should not be subclassed. * @see Collator * @see RuleBasedCollator * @version 1.8 Jan 16 2001 */ class U_I18N_API CollationElementIterator U_FINAL : public UObject { public: // CollationElementIterator public data member ------------------------------ enum { /** * NULLORDER indicates that an error has occurred while processing * @stable ICU 2.0 */ NULLORDER = (int32_t)0xffffffff }; // CollationElementIterator public constructor/destructor ------------------- /** * Copy constructor. * * @param other the object to be copied from * @stable ICU 2.0 */ CollationElementIterator(const CollationElementIterator& other); /** * Destructor * @stable ICU 2.0 */ virtual ~CollationElementIterator(); // CollationElementIterator public methods ---------------------------------- /** * Returns true if "other" is the same as "this" * * @param other the object to be compared * @return true if "other" is the same as "this" * @stable ICU 2.0 */ bool operator==(const CollationElementIterator& other) const; /** * Returns true if "other" is not the same as "this". * * @param other the object to be compared * @return true if "other" is not the same as "this" * @stable ICU 2.0 */ bool operator!=(const CollationElementIterator& other) const; /** * Resets the cursor to the beginning of the string. * @stable ICU 2.0 */ void reset(void); /** * Gets the ordering priority of the next character in the string. * @param status the error code status. * @return the next character's ordering. otherwise returns NULLORDER if an * error has occurred or if the end of string has been reached * @stable ICU 2.0 */ int32_t next(UErrorCode& status); /** * Get the ordering priority of the previous collation element in the string. * @param status the error code status. * @return the previous element's ordering. otherwise returns NULLORDER if an * error has occurred or if the start of string has been reached * @stable ICU 2.0 */ int32_t previous(UErrorCode& status); /** * Gets the primary order of a collation order. * @param order the collation order * @return the primary order of a collation order. * @stable ICU 2.0 */ static inline int32_t primaryOrder(int32_t order); /** * Gets the secondary order of a collation order. * @param order the collation order * @return the secondary order of a collation order. * @stable ICU 2.0 */ static inline int32_t secondaryOrder(int32_t order); /** * Gets the tertiary order of a collation order. * @param order the collation order * @return the tertiary order of a collation order. * @stable ICU 2.0 */ static inline int32_t tertiaryOrder(int32_t order); /** * Return the maximum length of any expansion sequences that end with the * specified comparison order. * @param order a collation order returned by previous or next. * @return maximum size of the expansion sequences ending with the collation * element or 1 if collation element does not occur at the end of any * expansion sequence * @stable ICU 2.0 */ int32_t getMaxExpansion(int32_t order) const; /** * Gets the comparison order in the desired strength. Ignore the other * differences. * @param order The order value * @stable ICU 2.0 */ int32_t strengthOrder(int32_t order) const; /** * Sets the source string. * @param str the source string. * @param status the error code status. * @stable ICU 2.0 */ void setText(const UnicodeString& str, UErrorCode& status); /** * Sets the source string. * @param str the source character iterator. * @param status the error code status. * @stable ICU 2.0 */ void setText(CharacterIterator& str, UErrorCode& status); /** * Checks if a comparison order is ignorable. * @param order the collation order. * @return true if a character is ignorable, false otherwise. * @stable ICU 2.0 */ static inline UBool isIgnorable(int32_t order); /** * Gets the offset of the currently processed character in the source string. * @return the offset of the character. * @stable ICU 2.0 */ int32_t getOffset(void) const; /** * Sets the offset of the currently processed character in the source string. * @param newOffset the new offset. * @param status the error code status. * @return the offset of the character. * @stable ICU 2.0 */ void setOffset(int32_t newOffset, UErrorCode& status); /** * ICU "poor man's RTTI", returns a UClassID for the actual class. * * @stable ICU 2.2 */ virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. * * @stable ICU 2.2 */ static UClassID U_EXPORT2 getStaticClassID(); #ifndef U_HIDE_INTERNAL_API /** @internal */ static inline CollationElementIterator *fromUCollationElements(UCollationElements *uc) { return reinterpret_cast<CollationElementIterator *>(uc); } /** @internal */ static inline const CollationElementIterator *fromUCollationElements(const UCollationElements *uc) { return reinterpret_cast<const CollationElementIterator *>(uc); } /** @internal */ inline UCollationElements *toUCollationElements() { return reinterpret_cast<UCollationElements *>(this); } /** @internal */ inline const UCollationElements *toUCollationElements() const { return reinterpret_cast<const UCollationElements *>(this); } #endif // U_HIDE_INTERNAL_API private: friend class RuleBasedCollator; friend class UCollationPCE; /** * CollationElementIterator constructor. This takes the source string and the * collation object. The cursor will walk thru the source string based on the * predefined collation rules. If the source string is empty, NULLORDER will * be returned on the calls to next(). * @param sourceText the source string. * @param order the collation object. * @param status the error code status. */ CollationElementIterator(const UnicodeString& sourceText, const RuleBasedCollator* order, UErrorCode& status); // Note: The constructors should take settings & tailoring, not a collator, // to avoid circular dependencies. // However, for operator==() we would need to be able to compare tailoring data for equality // without making CollationData or CollationTailoring depend on TailoredSet. // (See the implementation of RuleBasedCollator::operator==().) // That might require creating an intermediate class that would be used // by both CollationElementIterator and RuleBasedCollator // but only contain the part of RBC== related to data and rules. /** * CollationElementIterator constructor. This takes the source string and the * collation object. The cursor will walk thru the source string based on the * predefined collation rules. If the source string is empty, NULLORDER will * be returned on the calls to next(). * @param sourceText the source string. * @param order the collation object. * @param status the error code status. */ CollationElementIterator(const CharacterIterator& sourceText, const RuleBasedCollator* order, UErrorCode& status); /** * Assignment operator * * @param other the object to be copied */ const CollationElementIterator& operator=(const CollationElementIterator& other); CollationElementIterator(); // default constructor not implemented /** Normalizes dir_=1 (just after setOffset()) to dir_=0 (just after reset()). */ inline int8_t normalizeDir() const { return dir_ == 1 ? 0 : dir_; } static UHashtable *computeMaxExpansions(const CollationData *data, UErrorCode &errorCode); static int32_t getMaxExpansion(const UHashtable *maxExpansions, int32_t order); // CollationElementIterator private data members ---------------------------- CollationIterator *iter_; // owned const RuleBasedCollator *rbc_; // aliased uint32_t otherHalf_; /** * <0: backwards; 0: just after reset() (previous() begins from end); * 1: just after setOffset(); >1: forward */ int8_t dir_; /** * Stores offsets from expansions and from unsafe-backwards iteration, * so that getOffset() returns intermediate offsets for the CEs * that are consistent with forward iteration. */ UVector32 *offsets_; UnicodeString string_; }; // CollationElementIterator inline method definitions -------------------------- inline int32_t CollationElementIterator::primaryOrder(int32_t order) { return (order >> 16) & 0xffff; } inline int32_t CollationElementIterator::secondaryOrder(int32_t order) { return (order >> 8) & 0xff; } inline int32_t CollationElementIterator::tertiaryOrder(int32_t order) { return order & 0xff; } inline UBool CollationElementIterator::isIgnorable(int32_t order) { return (order & 0xffff0000) == 0; } U_NAMESPACE_END #endif /* #if !UCONFIG_NO_COLLATION */ #endif /* U_SHOW_CPLUSPLUS_API */ #endif
Save
cmd:
run