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(
void)
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 virtual int32_t hashCode(
void)
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 virtual int32_t size(
void)
const;
803 virtual UBool isEmpty(
void)
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;
1443 virtual int32_t getRangeCount(
void)
const;
1452 virtual UChar32 getRangeStart(int32_t index)
const;
1461 virtual UChar32 getRangeEnd(int32_t index)
const;
1511 int32_t serialize(uint16_t *dest, int32_t destCapacity,
UErrorCode& ec)
const;
1548 friend class USetAccess;
1566 friend class RBBIRuleScanner;
1584 void applyPattern(RuleCharacterIterator& chars,
1592 void closeOverCaseInsensitive(
bool simple);
1593 void closeOverAddCaseMappings();
1599 static int32_t nextCapacity(int32_t minCapacity);
1601 bool ensureCapacity(int32_t newLen);
1603 bool ensureBufferCapacity(int32_t newLen);
1605 void swapBuffers(
void);
1608 int32_t stringsSize()
const;
1612 UBool escapeUnprintable)
const;
1615 UBool escapeUnprintable)
const;
1622 UBool escapeUnprintable);
1628 void exclusiveOr(
const UChar32* other, int32_t otherLen, int8_t polarity);
1630 void add(
const UChar32* other, int32_t otherLen, int8_t polarity);
1632 void retain(
const UChar32* other, int32_t otherLen, int8_t polarity);
1642 static UBool resemblesPropertyPattern(RuleCharacterIterator& chars,
1688 void applyPropertyPattern(RuleCharacterIterator& chars,
1696 typedef UBool (*Filter)(
UChar32 codePoint,
void* context);
1707 void applyFilter(Filter filter,
1718 void setPattern(
const char16_t *newPat, int32_t newPatLen);
1722 void releasePattern();
1724 friend class UnicodeSetIterator;
1733 inline UBool UnicodeSet::isFrozen()
const {
1734 return (
UBool)(bmpSet!=
nullptr || stringSpan!=
nullptr);
1738 return !containsNone(start, end);
1742 return !containsNone(s);
1746 return !containsNone(s);
1749 inline UBool UnicodeSet::isBogus()
const {
1750 return (
UBool)(fFlags & kIsBogus);
1758 return reinterpret_cast<const UnicodeSet *
>(uset);
1761 inline USet *UnicodeSet::toUSet() {
1762 return reinterpret_cast<USet *
>(
this);
1765 inline const USet *UnicodeSet::toUSet()
const {
1766 return reinterpret_cast<const USet *
>(
this);
1770 int32_t sLength=s.
length();
1773 }
else if(start>sLength) {
1776 return start+span(s.
getBuffer()+start, sLength-start, spanCondition);
1780 int32_t sLength=s.
length();
1783 }
else if(limit>sLength) {
1786 return spanBack(s.
getBuffer(), limit, spanCondition);