A C++ "range" for iterating over all of the elements of a USet.
Convenient all-in one iteration, but creates a std::u16string for each code point or string.
Code points are returned first, then empty and multi-character strings.
using U_HEADER_NESTED_NAMESPACE::USetElements;
int32_t len32 = el.length();
char utf8[200];
el.data(), len32, 0xFFFD, nullptr, errorCode);
printf("uset.element length %ld \"%s\"\n", long{len32}, utf8);
}
"Smart pointer" class, closes a USet via uset_close().
U_CAPI USet * uset_openPattern(const UChar *pattern, int32_t patternLength, UErrorCode *ec)
Creates a set from the given pattern.
U_CAPI char * u_strToUTF8WithSub(char *dest, int32_t destCapacity, int32_t *pDestLength, const UChar *src, int32_t srcLength, UChar32 subchar, int32_t *pNumSubstitutions, UErrorCode *pErrorCode)
Convert a UTF-16 string to UTF-8.
C++ UnicodeSet has member functions for iteration, including begin() and end().
- Returns
- an all-elements iterator.
- Draft:
- This API may be changed in the future versions and was introduced in ICU 77
- See also
- USetCodePoints
-
USetRanges
-
USetStrings
Definition at line 1875 of file uset.h.