/
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/strenum.h
(10157B)
// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * * Copyright (C) 2002-2012, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* */ #ifndef STRENUM_H #define STRENUM_H #include "unicode/utypes.h" #if U_SHOW_CPLUSPLUS_API #include "unicode/uobject.h" #include "unicode/unistr.h" /** * \file * \brief C++ API: String Enumeration */ U_NAMESPACE_BEGIN /** * Base class for 'pure' C++ implementations of uenum api. Adds a * method that returns the next UnicodeString since in C++ this can * be a common storage format for strings. * * <p>The model is that the enumeration is over strings maintained by * a 'service.' At any point, the service might change, invalidating * the enumerator (though this is expected to be rare). The iterator * returns an error if this has occurred. Lack of the error is no * guarantee that the service didn't change immediately after the * call, so the returned string still might not be 'valid' on * subsequent use.</p> * * <p>Strings may take the form of const char*, const char16_t*, or const * UnicodeString*. The type you get is determine by the variant of * 'next' that you call. In general the StringEnumeration is * optimized for one of these types, but all StringEnumerations can * return all types. Returned strings are each terminated with a NUL. * Depending on the service data, they might also include embedded NUL * characters, so API is provided to optionally return the true * length, counting the embedded NULs but not counting the terminating * NUL.</p> * * <p>The pointers returned by next, unext, and snext become invalid * upon any subsequent call to the enumeration's destructor, next, * unext, snext, or reset.</p> * * ICU 2.8 adds some default implementations and helper functions * for subclasses. * * @stable ICU 2.4 */ class U_COMMON_API StringEnumeration : public UObject { public: /** * Destructor. * @stable ICU 2.4 */ virtual ~StringEnumeration(); /** * Clone this object, an instance of a subclass of StringEnumeration. * Clones can be used concurrently in multiple threads. * If a subclass does not implement clone(), or 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 */ virtual StringEnumeration *clone() const; /** * <p>Return the number of elements that the iterator traverses. If * the iterator is out of sync with its service, status is set to * U_ENUM_OUT_OF_SYNC_ERROR, and the return value is zero.</p> * * <p>The return value will not change except possibly as a result of * a subsequent call to reset, or if the iterator becomes out of sync.</p> * * <p>This is a convenience function. It can end up being very * expensive as all the items might have to be pre-fetched * (depending on the storage format of the data being * traversed).</p> * * @param status the error code. * @return number of elements in the iterator. * * @stable ICU 2.4 */ virtual int32_t count(UErrorCode& status) const = 0; /** * <p>Returns the next element as a NUL-terminated char*. If there * are no more elements, returns NULL. If the resultLength pointer * is not NULL, the length of the string (not counting the * terminating NUL) is returned at that address. If an error * status is returned, the value at resultLength is undefined.</p> * * <p>The returned pointer is owned by this iterator and must not be * deleted by the caller. The pointer is valid until the next call * to next, unext, snext, reset, or the enumerator's destructor.</p> * * <p>If the iterator is out of sync with its service, status is set * to U_ENUM_OUT_OF_SYNC_ERROR and NULL is returned.</p> * * <p>If the native service string is a char16_t* string, it is * converted to char* with the invariant converter. If the * conversion fails (because a character cannot be converted) then * status is set to U_INVARIANT_CONVERSION_ERROR and the return * value is undefined (though not NULL).</p> * * Starting with ICU 2.8, the default implementation calls snext() * and handles the conversion. * Either next() or snext() must be implemented differently by a subclass. * * @param status the error code. * @param resultLength a pointer to receive the length, can be NULL. * @return a pointer to the string, or NULL. * * @stable ICU 2.4 */ virtual const char* next(int32_t *resultLength, UErrorCode& status); /** * <p>Returns the next element as a NUL-terminated char16_t*. If there * are no more elements, returns NULL. If the resultLength pointer * is not NULL, the length of the string (not counting the * terminating NUL) is returned at that address. If an error * status is returned, the value at resultLength is undefined.</p> * * <p>The returned pointer is owned by this iterator and must not be * deleted by the caller. The pointer is valid until the next call * to next, unext, snext, reset, or the enumerator's destructor.</p> * * <p>If the iterator is out of sync with its service, status is set * to U_ENUM_OUT_OF_SYNC_ERROR and NULL is returned.</p> * * Starting with ICU 2.8, the default implementation calls snext() * and handles the conversion. * * @param status the error code. * @param resultLength a pointer to receive the length, can be NULL. * @return a pointer to the string, or NULL. * * @stable ICU 2.4 */ virtual const char16_t* unext(int32_t *resultLength, UErrorCode& status); /** * <p>Returns the next element a UnicodeString*. If there are no * more elements, returns NULL.</p> * * <p>The returned pointer is owned by this iterator and must not be * deleted by the caller. The pointer is valid until the next call * to next, unext, snext, reset, or the enumerator's destructor.</p> * * <p>If the iterator is out of sync with its service, status is set * to U_ENUM_OUT_OF_SYNC_ERROR and NULL is returned.</p> * * Starting with ICU 2.8, the default implementation calls next() * and handles the conversion. * Either next() or snext() must be implemented differently by a subclass. * * @param status the error code. * @return a pointer to the string, or NULL. * * @stable ICU 2.4 */ virtual const UnicodeString* snext(UErrorCode& status); /** * <p>Resets the iterator. This re-establishes sync with the * service and rewinds the iterator to start at the first * element.</p> * * <p>Previous pointers returned by next, unext, or snext become * invalid, and the value returned by count might change.</p> * * @param status the error code. * * @stable ICU 2.4 */ virtual void reset(UErrorCode& status) = 0; /** * Compares this enumeration to other to check if both are equal * * @param that The other string enumeration to compare this object to * @return true if the enumerations are equal. false if not. * @stable ICU 3.6 */ virtual bool operator==(const StringEnumeration& that)const; /** * Compares this enumeration to other to check if both are not equal * * @param that The other string enumeration to compare this object to * @return true if the enumerations are equal. false if not. * @stable ICU 3.6 */ virtual bool operator!=(const StringEnumeration& that)const; protected: /** * UnicodeString field for use with default implementations and subclasses. * @stable ICU 2.8 */ UnicodeString unistr; /** * char * default buffer for use with default implementations and subclasses. * @stable ICU 2.8 */ char charsBuffer[32]; /** * char * buffer for use with default implementations and subclasses. * Allocated in constructor and in ensureCharsCapacity(). * @stable ICU 2.8 */ char *chars; /** * Capacity of chars, for use with default implementations and subclasses. * @stable ICU 2.8 */ int32_t charsCapacity; /** * Default constructor for use with default implementations and subclasses. * @stable ICU 2.8 */ StringEnumeration(); /** * Ensures that chars is at least as large as the requested capacity. * For use with default implementations and subclasses. * * @param capacity Requested capacity. * @param status ICU in/out error code. * @stable ICU 2.8 */ void ensureCharsCapacity(int32_t capacity, UErrorCode &status); /** * Converts s to Unicode and sets unistr to the result. * For use with default implementations and subclasses, * especially for implementations of snext() in terms of next(). * This is provided with a helper function instead of a default implementation * of snext() to avoid potential infinite loops between next() and snext(). * * For example: * \code * const UnicodeString* snext(UErrorCode& status) { * int32_t resultLength=0; * const char *s=next(&resultLength, status); * return setChars(s, resultLength, status); * } * \endcode * * @param s String to be converted to Unicode. * @param length Length of the string. * @param status ICU in/out error code. * @return A pointer to unistr. * @stable ICU 2.8 */ UnicodeString *setChars(const char *s, int32_t length, UErrorCode &status); }; U_NAMESPACE_END #endif /* U_SHOW_CPLUSPLUS_API */ /* STRENUM_H */ #endif
Save
cmd:
run