18 #if U_SHOW_CPLUSPLUS_API
35 class RBBIRuleScanner;
37 class UnicodeSetStringSpan;
39 class RuleCharacterIterator;
289 static constexpr uint8_t kIsBogus = 1;
296 BMPSet *bmpSet =
nullptr;
298 int32_t bufferCapacity = 0;
309 char16_t *pat =
nullptr;
312 UVector* strings =
nullptr;
313 UnicodeSetStringSpan *stringSpan =
nullptr;
332 inline UBool isBogus(
void)
const;
390 #ifndef U_HIDE_INTERNAL_API
408 UnicodeSet(
const uint16_t buffer[], int32_t bufferLen,
409 ESerialization serialization,
UErrorCode &status);
423 #ifndef U_HIDE_INTERNAL_API
517 virtual int32_t hashCode(
void)
const;
546 inline USet *toUSet();
556 inline const USet * toUSet()
const;
571 inline UBool isFrozen()
const;
636 #ifndef U_HIDE_INTERNAL_API
779 virtual int32_t size(
void)
const;
787 virtual UBool isEmpty(
void)
const;
909 int32_t span(
const char16_t *s, int32_t length,
USetSpanCondition spanCondition)
const;
942 int32_t spanBack(
const char16_t *s, int32_t length,
USetSpanCondition spanCondition)
const;
977 int32_t spanUTF8(
const char *s, int32_t length,
USetSpanCondition spanCondition)
const;
996 int32_t spanBackUTF8(
const char *s, int32_t length,
USetSpanCondition spanCondition)
const;
1031 int32_t start, int32_t limit,
1043 int32_t findCodePoint(
UChar32 c)
const;
1064 int32_t indexOf(
UChar32 c)
const;
1075 UChar32 charAt(int32_t index)
const;
1392 virtual int32_t getRangeCount(
void)
const;
1401 virtual UChar32 getRangeStart(int32_t index)
const;
1410 virtual UChar32 getRangeEnd(int32_t index)
const;
1460 int32_t serialize(uint16_t *dest, int32_t destCapacity,
UErrorCode& ec)
const;
1497 friend class USetAccess;
1515 friend class RBBIRuleScanner;
1533 void applyPattern(RuleCharacterIterator& chars,
1545 static int32_t nextCapacity(int32_t minCapacity);
1547 bool ensureCapacity(int32_t newLen);
1549 bool ensureBufferCapacity(int32_t newLen);
1551 void swapBuffers(
void);
1554 UBool hasStrings()
const;
1555 int32_t stringsSize()
const;
1559 UBool escapeUnprintable)
const;
1562 UBool escapeUnprintable)
const;
1572 void exclusiveOr(
const UChar32* other, int32_t otherLen, int8_t polarity);
1574 void add(
const UChar32* other, int32_t otherLen, int8_t polarity);
1576 void retain(
const UChar32* other, int32_t otherLen, int8_t polarity);
1586 static UBool resemblesPropertyPattern(RuleCharacterIterator& chars,
1632 void applyPropertyPattern(RuleCharacterIterator& chars,
1642 typedef UBool (*Filter)(
UChar32 codePoint,
void* context);
1653 void applyFilter(Filter filter,
1659 void applyIntPropertyValue(
const UCPMap *map,
1669 void setPattern(
const char16_t *newPat, int32_t newPatLen);
1673 void releasePattern();
1675 friend class UnicodeSetIterator;
1684 inline UBool UnicodeSet::isFrozen()
const {
1689 return !containsNone(start, end);
1693 return !containsNone(s);
1697 return !containsNone(s);
1700 inline UBool UnicodeSet::isBogus()
const {
1701 return (
UBool)(fFlags & kIsBogus);
1705 return reinterpret_cast<UnicodeSet *>(uset);
1709 return reinterpret_cast<const UnicodeSet *>(uset);
1712 inline USet *UnicodeSet::toUSet() {
1713 return reinterpret_cast<USet *>(
this);
1716 inline const USet *UnicodeSet::toUSet()
const {
1717 return reinterpret_cast<const USet *>(
this);
1721 int32_t sLength=s.
length();
1724 }
else if(start>sLength) {
1727 return start+span(s.
getBuffer()+start, sLength-start, spanCondition);
1731 int32_t sLength=s.
length();
1734 }
else if(limit>sLength) {
1737 return spanBack(s.
getBuffer(), limit, spanCondition);