diff options
author | romankoshelev <[email protected]> | 2023-08-09 20:07:20 +0300 |
---|---|---|
committer | romankoshelev <[email protected]> | 2023-08-09 20:59:13 +0300 |
commit | fd82fb12fb45e71a02c628e45b12c50c0dd0d308 (patch) | |
tree | f582b79f9002ab1d083e9acda600dfb3551c47b6 /contrib/libs/icu/common/uset.cpp | |
parent | bf862ddf5c6178e1bb5e4fb3f7c61015deebe284 (diff) |
Update ICU to 70.1
Diffstat (limited to 'contrib/libs/icu/common/uset.cpp')
-rw-r--r-- | contrib/libs/icu/common/uset.cpp | 52 |
1 files changed, 46 insertions, 6 deletions
diff --git a/contrib/libs/icu/common/uset.cpp b/contrib/libs/icu/common/uset.cpp index eae7981d52f..871a5d8986f 100644 --- a/contrib/libs/icu/common/uset.cpp +++ b/contrib/libs/icu/common/uset.cpp @@ -117,6 +117,12 @@ uset_removeString(USet* set, const UChar* str, int32_t strLen) { } U_CAPI void U_EXPORT2 +uset_removeAllCodePoints(USet *set, const UChar *str, int32_t length) { + UnicodeString s(length==-1, str, length); + ((UnicodeSet*) set)->UnicodeSet::removeAll(s); +} + +U_CAPI void U_EXPORT2 uset_removeAll(USet* set, const USet* remove) { ((UnicodeSet*) set)->UnicodeSet::removeAll(*(const UnicodeSet*)remove); } @@ -127,6 +133,18 @@ uset_retain(USet* set, UChar32 start, UChar32 end) { } U_CAPI void U_EXPORT2 +uset_retainString(USet *set, const UChar *str, int32_t length) { + UnicodeString s(length==-1, str, length); + ((UnicodeSet*) set)->UnicodeSet::retain(s); +} + +U_CAPI void U_EXPORT2 +uset_retainAllCodePoints(USet *set, const UChar *str, int32_t length) { + UnicodeString s(length==-1, str, length); + ((UnicodeSet*) set)->UnicodeSet::retainAll(s); +} + +U_CAPI void U_EXPORT2 uset_retainAll(USet* set, const USet* retain) { ((UnicodeSet*) set)->UnicodeSet::retainAll(*(const UnicodeSet*)retain); } @@ -142,6 +160,23 @@ uset_complement(USet* set) { } U_CAPI void U_EXPORT2 +uset_complementRange(USet *set, UChar32 start, UChar32 end) { + ((UnicodeSet*) set)->UnicodeSet::complement(start, end); +} + +U_CAPI void U_EXPORT2 +uset_complementString(USet *set, const UChar *str, int32_t length) { + UnicodeString s(length==-1, str, length); + ((UnicodeSet*) set)->UnicodeSet::complement(s); +} + +U_CAPI void U_EXPORT2 +uset_complementAllCodePoints(USet *set, const UChar *str, int32_t length) { + UnicodeString s(length==-1, str, length); + ((UnicodeSet*) set)->UnicodeSet::complementAll(s); +} + +U_CAPI void U_EXPORT2 uset_complementAll(USet* set, const USet* complement) { ((UnicodeSet*) set)->UnicodeSet::complementAll(*(const UnicodeSet*)complement); } @@ -162,6 +197,11 @@ uset_isEmpty(const USet* set) { } U_CAPI UBool U_EXPORT2 +uset_hasStrings(const USet* set) { + return ((const UnicodeSet*) set)->UnicodeSet::hasStrings(); +} + +U_CAPI UBool U_EXPORT2 uset_contains(const USet* set, UChar32 c) { return ((const UnicodeSet*) set)->UnicodeSet::contains(c); } @@ -262,6 +302,11 @@ private: U_NAMESPACE_END U_CAPI int32_t U_EXPORT2 +uset_getRangeCount(const USet *set) { + return ((const UnicodeSet *)set)->UnicodeSet::getRangeCount(); +} + +U_CAPI int32_t U_EXPORT2 uset_getItemCount(const USet* uset) { const UnicodeSet& set = *(const UnicodeSet*)uset; return set.getRangeCount() + USetAccess::getStringCount(set); @@ -295,11 +340,6 @@ uset_getItem(const USet* uset, int32_t itemIndex, } } -//U_CAPI int32_t U_EXPORT2 -//uset_getRangeCount(const USet* set) { -// return ((const UnicodeSet*) set)->getRangeCount(); -//} -// //U_CAPI UBool U_EXPORT2 //uset_getRange(const USet* set, int32_t rangeIndex, // UChar32* pStart, UChar32* pEnd) { @@ -320,7 +360,7 @@ uset_getItem(const USet* uset, int32_t itemIndex, * therefore all BMP code points precede all supplementary code points. * * Store each supplementary code point in 2 16-bit units, - * simply with higher-then-lower 16-bit halfs. + * simply with higher-then-lower 16-bit halves. * * Precede the entire list with the length. * If there are supplementary code points, then set bit 15 in the length |