ICU 76.1: U_HEADER_ONLY_NAMESPACE::USetRanges Class Reference

ICU 76.1 76.1

Public Member Functions
U_HEADER_ONLY_NAMESPACE::USetRanges Class Reference

C++ "range" for iterating over the code point ranges of a USet. More...

`#include <uset.h>`

## Public Member Functions
| USetRanges (const USet *uset)
| Constructs a C++ "range" object over the code point ranges of the USet.
| USetRanges (const USetRanges &other)=default
USetRangeIterator | begin () const
USetRangeIterator | end () const

## Detailed Description

C++ "range" for iterating over the code point ranges of a USet.

using U_HEADER_NESTED_NAMESPACE::USetRanges;
LocalUSetPointer uset(uset_openPattern(u"[abcçカ🚴]", -1, &errorCode));
for (auto [start, end] : USetRanges(uset.getAlias())) {
printf("uset.range U+%04lx..U+%04lx\n", (long)start, (long)end);
}
for (auto range : USetRanges(uset.getAlias())) {
for (UChar32 c : range) {
printf("uset.range.c U+%04lx\n", (long)c);
}
}
LocalUSetPointer
"Smart pointer" class, closes a USet via uset_close().
U_HEADER_ONLY_NAMESPACE::USetRanges::end
USetRangeIterator end() const
Definition uset.h:1624
U_HEADER_ONLY_NAMESPACE::USetRanges::USetRanges
USetRanges(const USet *uset)
Constructs a C++ "range" object over the code point ranges of the USet.
Definition uset.h:1613
UChar32
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
Definition umachine.h:427
uset_openPattern
U_CAPI USet * uset_openPattern(const UChar *pattern, int32_t patternLength, UErrorCode *ec)
Creates a set from the given pattern.

C++ UnicodeSet has member functions for iteration, including ranges().

Draft
  This API may be changed in the future versions and was introduced in ICU 76

See also
  USetCodePoints
  USetStrings
  USetElements

Definition at line 1607 of file uset.h.

## Constructor & Destructor Documentation

## ◆ USetRanges() [1/2]

U_HEADER_ONLY_NAMESPACE::USetRanges::USetRanges | ( | const USet * | uset | ) |
| inline

Constructs a C++ "range" object over the code point ranges of the USet.

Draft
  This API may be changed in the future versions and was introduced in ICU 76

Definition at line 1613 of file uset.h.

## ◆ USetRanges() [2/2]

U_HEADER_ONLY_NAMESPACE::USetRanges::USetRanges | ( | const USetRanges & | other | ) |
| default

Draft
  This API may be changed in the future versions and was introduced in ICU 76

## Member Function Documentation

## ◆ begin()

USetRangeIterator U_HEADER_ONLY_NAMESPACE::USetRanges::begin | ( |  | ) | const
| inline

Draft
  This API may be changed in the future versions and was introduced in ICU 76

Definition at line 1619 of file uset.h.

## ◆ end()

USetRangeIterator U_HEADER_ONLY_NAMESPACE::USetRanges::end | ( |  | ) | const
| inline

Draft
  This API may be changed in the future versions and was introduced in ICU 76

Definition at line 1624 of file uset.h.

The documentation for this class was generated from the following file:

- common/unicode/uset.h