class USetElements
Defined at line 1875 of file ../../third_party/icu/latest/source/common/unicode/uset.h
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.
C++ UnicodeSet has member functions for iteration, including begin() and end().
Returns
an all-elements iterator.
ICU 77
Code
using U_HEADER_NESTED_NAMESPACE::USetElements;
LocalUSetPointer uset(uset_openPattern(u"[abcçカ🚴{}{abc}{de}]", -1, &errorCode));
for (auto el : USetElements(uset.getAlias())) {
int32_t len32 = el.length();
char utf8[200];
u_strToUTF8WithSub(utf8, int32_t{sizeof(utf8) - 1}, nullptr,
el.data(), len32, 0xFFFD, nullptr, errorCode);
printf("uset.element length %ld \"%s\"\n", long{len32}, utf8);
}
Public Methods
void USetElements (const USet * pUset)
Constructs a C++ "range" object over all of the elements of the USet.
ICU 77
Defined at line 1881 of file ../../third_party/icu/latest/source/common/unicode/uset.h
void USetElements (const USetElements & other)
ICU 77
Defined at line 1886 of file ../../third_party/icu/latest/source/common/unicode/uset.h
USetElementIterator begin ()
ICU 77
Defined at line 1889 of file ../../third_party/icu/latest/source/common/unicode/uset.h
USetElementIterator end ()
ICU 77
Defined at line 1894 of file ../../third_party/icu/latest/source/common/unicode/uset.h