18 #if U_SHOW_CPLUSPLUS_API
35 class RBBIRuleScanner;
37 class UnicodeSetStringSpan;
39 class RuleCharacterIterator;
293 static constexpr uint8_t kIsBogus = 1;
300 BMPSet *bmpSet =
nullptr;
302 int32_t bufferCapacity = 0;
313 char16_t *pat =
nullptr;
316 UVector* strings_ =
nullptr;
317 UnicodeSetStringSpan *stringSpan =
nullptr;
336 inline UBool isBogus()
const;
394 #ifndef U_HIDE_INTERNAL_API
412 UnicodeSet(
const uint16_t buffer[], int32_t bufferLen,
413 ESerialization serialization,
UErrorCode &status);
427 #ifndef U_HIDE_INTERNAL_API
525 int32_t hashCode()
const;
554 inline USet *toUSet();
564 inline const USet * toUSet()
const;
579 inline UBool isFrozen()
const;
644 #ifndef U_HIDE_INTERNAL_API
722 UBool escapeUnprintable =
false)
const override;
795 int32_t size()
const;
803 UBool isEmpty()
const;
809 UBool hasStrings()
const;
931 int32_t span(
const char16_t *s, int32_t length,
USetSpanCondition spanCondition)
const;
964 int32_t spanBack(
const char16_t *s, int32_t length,
USetSpanCondition spanCondition)
const;
999 int32_t spanUTF8(
const char *s, int32_t length,
USetSpanCondition spanCondition)
const;
1018 int32_t spanBackUTF8(
const char *s, int32_t length,
USetSpanCondition spanCondition)
const;
1027 UBool incremental)
override;
1053 int32_t start, int32_t limit,
1065 int32_t findCodePoint(
UChar32 c)
const;
1086 int32_t indexOf(
UChar32 c)
const;
1103 UChar32 charAt(int32_t index)
const;
1122 inline U_HEADER_NESTED_NAMESPACE::USetCodePoints
codePoints()
const {
1123 return U_HEADER_NESTED_NAMESPACE::USetCodePoints(toUSet());
1148 inline U_HEADER_NESTED_NAMESPACE::USetRanges
ranges()
const {
1149 return U_HEADER_NESTED_NAMESPACE::USetRanges(toUSet());
1172 inline U_HEADER_NESTED_NAMESPACE::USetStrings
strings()
const {
1173 return U_HEADER_NESTED_NAMESPACE::USetStrings(toUSet());
1176 #ifndef U_HIDE_DRAFT_API
1201 inline U_HEADER_NESTED_NAMESPACE::USetElementIterator
begin()
const {
1202 return U_HEADER_NESTED_NAMESPACE::USetElements(toUSet()).begin();
1213 inline U_HEADER_NESTED_NAMESPACE::USetElementIterator
end()
const {
1214 return U_HEADER_NESTED_NAMESPACE::USetElements(toUSet()).end();
1216 #endif // U_HIDE_DRAFT_API
1556 int32_t getRangeCount()
const;
1565 UChar32 getRangeStart(int32_t index)
const;
1574 UChar32 getRangeEnd(int32_t index)
const;
1624 int32_t serialize(uint16_t *dest, int32_t destCapacity,
UErrorCode& ec)
const;
1661 friend class USetAccess;
1679 friend class RBBIRuleScanner;
1697 void applyPattern(RuleCharacterIterator& chars,
1705 void closeOverCaseInsensitive(
bool simple);
1706 void closeOverAddCaseMappings();
1712 static int32_t nextCapacity(int32_t minCapacity);
1714 bool ensureCapacity(int32_t newLen);
1716 bool ensureBufferCapacity(int32_t newLen);
1721 int32_t stringsSize()
const;
1725 UBool escapeUnprintable)
const;
1728 UBool escapeUnprintable)
const;
1735 UBool escapeUnprintable);
1741 void exclusiveOr(
const UChar32* other, int32_t otherLen, int8_t polarity);
1743 void add(
const UChar32* other, int32_t otherLen, int8_t polarity);
1745 void retain(
const UChar32* other, int32_t otherLen, int8_t polarity);
1755 static UBool resemblesPropertyPattern(RuleCharacterIterator& chars,
1801 void applyPropertyPattern(RuleCharacterIterator& chars,
1809 typedef UBool (*Filter)(
UChar32 codePoint,
void* context);
1820 void applyFilter(Filter filter,
1831 void setPattern(
const char16_t *newPat, int32_t newPatLen);
1835 void releasePattern();
1837 friend class UnicodeSetIterator;
1846 inline UBool UnicodeSet::isFrozen()
const {
1847 return bmpSet !=
nullptr || stringSpan !=
nullptr;
1851 return !containsNone(start, end);
1855 return !containsNone(s);
1859 return !containsNone(s);
1862 inline UBool UnicodeSet::isBogus()
const {
1863 return fFlags & kIsBogus;
1871 return reinterpret_cast<const UnicodeSet *
>(uset);
1874 inline USet *UnicodeSet::toUSet() {
1875 return reinterpret_cast<USet *
>(
this);
1878 inline const USet *UnicodeSet::toUSet()
const {
1879 return reinterpret_cast<const USet *
>(
this);
1883 int32_t sLength=s.
length();
1886 }
else if(start>sLength) {
1889 return start+span(s.
getBuffer()+start, sLength-start, spanCondition);
1893 int32_t sLength=s.
length();
1896 }
else if(limit>sLength) {
1899 return spanBack(s.
getBuffer(), limit, spanCondition);