31 class RBBIRuleScanner;
33 class UnicodeSetStringSpan;
35 class RuleCharacterIterator;
285 static constexpr uint8_t kIsBogus = 1;
292 BMPSet *bmpSet =
nullptr;
294 int32_t bufferCapacity = 0;
305 char16_t *pat =
nullptr;
308 UVector* strings =
nullptr;
309 UnicodeSetStringSpan *stringSpan =
nullptr;
328 inline UBool isBogus(
void)
const;
386 #ifndef U_HIDE_INTERNAL_API 404 UnicodeSet(
const uint16_t buffer[], int32_t bufferLen,
419 #ifndef U_HIDE_INTERNAL_API 513 virtual int32_t hashCode(
void)
const;
542 inline USet *toUSet();
552 inline const USet * toUSet()
const;
567 inline UBool isFrozen()
const;
632 #ifndef U_HIDE_INTERNAL_API 775 virtual int32_t size(
void)
const;
783 virtual UBool isEmpty(
void)
const;
905 int32_t span(
const char16_t *s, int32_t length,
USetSpanCondition spanCondition)
const;
938 int32_t spanBack(
const char16_t *s, int32_t length,
USetSpanCondition spanCondition)
const;
973 int32_t spanUTF8(
const char *s, int32_t length,
USetSpanCondition spanCondition)
const;
992 int32_t spanBackUTF8(
const char *s, int32_t length,
USetSpanCondition spanCondition)
const;
1027 int32_t start, int32_t limit,
1039 int32_t findCodePoint(
UChar32 c)
const;
1060 int32_t indexOf(
UChar32 c)
const;
1071 UChar32 charAt(int32_t index)
const;
1388 virtual int32_t getRangeCount(
void)
const;
1397 virtual UChar32 getRangeStart(int32_t index)
const;
1406 virtual UChar32 getRangeEnd(int32_t index)
const;
1456 int32_t serialize(uint16_t *dest, int32_t destCapacity,
UErrorCode& ec)
const;
1493 friend class USetAccess;
1511 friend class RBBIRuleScanner;
1529 void applyPattern(RuleCharacterIterator& chars,
1541 static int32_t nextCapacity(int32_t minCapacity);
1543 bool ensureCapacity(int32_t newLen);
1545 bool ensureBufferCapacity(int32_t newLen);
1547 void swapBuffers(
void);
1550 UBool hasStrings()
const;
1551 int32_t stringsSize()
const;
1555 UBool escapeUnprintable)
const;
1558 UBool escapeUnprintable)
const;
1568 void exclusiveOr(
const UChar32* other, int32_t otherLen, int8_t polarity);
1570 void add(
const UChar32* other, int32_t otherLen, int8_t polarity);
1572 void retain(
const UChar32* other, int32_t otherLen, int8_t polarity);
1582 static UBool resemblesPropertyPattern(RuleCharacterIterator& chars,
1628 void applyPropertyPattern(RuleCharacterIterator& chars,
1638 typedef UBool (*Filter)(
UChar32 codePoint,
void* context);
1649 void applyFilter(Filter filter,
1654 #ifndef U_HIDE_DRAFT_API // Skipped: ucpmap.h is draft only. 1655 void applyIntPropertyValue(
const UCPMap *map,
1666 void setPattern(
const char16_t *newPat, int32_t newPatLen);
1670 void releasePattern();
1686 return !containsNone(start, end);
1690 return !containsNone(s);
1694 return !containsNone(s);
1698 return (
UBool)(fFlags & kIsBogus);
1706 return reinterpret_cast<const UnicodeSet *
>(uset);
1710 return reinterpret_cast<USet *
>(
this);
1714 return reinterpret_cast<const USet *
>(
this);
1718 int32_t sLength=s.
length();
1721 }
else if(start>sLength) {
1724 return start+span(s.
getBuffer()+start, sLength-start, spanCondition);
1728 int32_t sLength=s.
length();
1731 }
else if(limit>sLength) {
1734 return spanBack(s.
getBuffer(), limit, spanCondition);
#define INITIAL_CAPACITY
The initial size of an array if it is unspecified.
static UClassID getStaticClassID()
ICU "poor man's RTTI", returns a UClassID for this class.
struct UCPMap UCPMap
Abstract map from Unicode code points (U+0000..U+10FFFF) to integer values.
int32_t spanBack(const char16_t *s, int32_t length, USetSpanCondition spanCondition) const
Returns the start of the trailing substring of the input string which consists only of characters and...
UMatchDegree
Constants returned by UnicodeMatcher::matches() indicating the degree of match.
U_EXPORT UBool operator==(const StringPiece &x, const StringPiece &y)
Global operator == for StringPiece.
UnicodeSetIterator iterates over the contents of a UnicodeSet.
UBool isBogus(void) const
Determine if this object contains a valid set.
UBool operator!=(const UnicodeSet &o) const
Compares the specified object with this set for equality.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
This file defines an abstract map from Unicode code points to integer values.
static UnicodeSet * fromUSet(USet *uset)
Get a UnicodeSet pointer from a USet.
virtual UBool matchesIndexValue(uint8_t v) const =0
Returns TRUE if this matcher will match a character c, where c & 0xFF == v, at offset, in the forward direction (with limit > offset).
An interface that defines both lookup protocol and parsing of symbolic names.
virtual UClassID getDynamicClassID(void) const =0
Returns a unique class ID polymorphically.
virtual UnicodeFunctor * clone() const =0
Return a copy of this object.
Replaceable is an abstract base class representing a string of characters that supports the replaceme...
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
UnicodeFilter defines a protocol for selecting a subset of the full range (U+0000 to U+10FFFF) of Uni...
virtual void addMatchSetTo(UnicodeSet &toUnionTo) const =0
Union the set of all characters that may be matched by this object into the given set...
UBool operator!=(const StringPiece &x, const StringPiece &y)
Global operator != for StringPiece.
uint32_t UCPMapValueFilter(const void *context, uint32_t value)
Callback function type: Modifies a map value.
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
#define NULL
Define NULL if necessary, to nullptr for C++ and to ((void *)0) for C.
UnicodeFunctor is an abstract base class for objects that perform match and/or replace operations on ...
virtual UMatchDegree matches(const Replaceable &text, int32_t &offset, int32_t limit, UBool incremental)
Implement UnicodeMatcher API.
A mutable set of Unicode characters and multicharacter strings.
USetSpanCondition
Argument values for whether span() and similar functions continue while the current character is cont...
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
UProperty
Selection constants for Unicode properties.
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
struct USet USet
USet is the C API type corresponding to C++ class UnicodeSet.
int32_t length(void) const
Return the length of the UnicodeString object.
ParsePosition is a simple class used by Format and its subclasses to keep track of the current positi...
#define U_FINAL
Defined to the C++11 "final" keyword if available.
char16_t * getBuffer(int32_t minCapacity)
Get a read/write pointer to the internal buffer.
virtual UnicodeString & toPattern(UnicodeString &result, UBool escapeUnprintable=FALSE) const =0
Returns a string representation of this matcher.
UBool containsSome(UChar32 start, UChar32 end) const
Returns true if this set contains one or more of the characters in the given range.
virtual UBool contains(UChar32 c) const =0
Returns true for characters that are in the selected subset.
#define FALSE
The FALSE value of a UBool.
#define U_COMMON_API
Set to export library symbols from inside the common library, and to import them from outside...
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
UBool isFrozen() const
Determines whether the set has been frozen (made immutable) or not.
USet * toUSet()
Produce a USet * pointer for this UnicodeSet.
int32_t span(const char16_t *s, int32_t length, USetSpanCondition spanCondition) const
Returns the length of the initial substring of the input string which consists only of characters and...
int8_t UBool
The ICU boolean type.