ICU 55.1  55.1
uniset.h
Go to the documentation of this file.
1 /*
2 ***************************************************************************
3 * Copyright (C) 1999-2014, International Business Machines Corporation
4 * and others. All Rights Reserved.
5 ***************************************************************************
6 * Date Name Description
7 * 10/20/99 alan Creation.
8 ***************************************************************************
9 */
10 
11 #ifndef UNICODESET_H
12 #define UNICODESET_H
13 
14 #include "unicode/unifilt.h"
15 #include "unicode/unistr.h"
16 #include "unicode/uset.h"
17 
24 
25 // Forward Declarations.
26 void U_CALLCONV UnicodeSet_initInclusion(int32_t src, UErrorCode &status);
28 class BMPSet;
29 class ParsePosition;
30 class RBBIRuleScanner;
31 class SymbolTable;
32 class UnicodeSetStringSpan;
33 class UVector;
34 class RuleCharacterIterator;
35 
276 class U_COMMON_API UnicodeSet U_FINAL : public UnicodeFilter {
277 
278  int32_t len; // length of list used; 0 <= len <= capacity
279  int32_t capacity; // capacity of list
280  UChar32* list; // MUST be terminated with HIGH
281  BMPSet *bmpSet; // The set is frozen iff either bmpSet or stringSpan is not NULL.
282  UChar32* buffer; // internal buffer, may be NULL
283  int32_t bufferCapacity; // capacity of buffer
284  int32_t patLen;
285 
295  UChar *pat;
296  UVector* strings; // maintained in sorted order
297  UnicodeSetStringSpan *stringSpan;
298 
299 private:
300  enum { // constants
301  kIsBogus = 1 // This set is bogus (i.e. not valid)
302  };
303  uint8_t fFlags; // Bit flag (see constants above)
304 public:
314  inline UBool isBogus(void) const;
315 
332  void setToBogus();
333 
334 public:
335 
336  enum {
341  MIN_VALUE = 0,
342 
347  MAX_VALUE = 0x10ffff
348  };
349 
350  //----------------------------------------------------------------
351  // Constructors &c
352  //----------------------------------------------------------------
353 
354 public:
355 
361 
371 
380  UnicodeSet(const UnicodeString& pattern,
381  UErrorCode& status);
382 
383 #ifndef U_HIDE_INTERNAL_API
384 
396  UnicodeSet(const UnicodeString& pattern,
397  uint32_t options,
398  const SymbolTable* symbols,
399  UErrorCode& status);
400 #endif /* U_HIDE_INTERNAL_API */
401 
415  UnicodeSet(const UnicodeString& pattern, ParsePosition& pos,
416  uint32_t options,
417  const SymbolTable* symbols,
418  UErrorCode& status);
419 
425 
430  virtual ~UnicodeSet();
431 
438 
450  virtual UBool operator==(const UnicodeSet& o) const;
451 
457  UBool operator!=(const UnicodeSet& o) const;
458 
468  virtual UnicodeFunctor* clone() const;
469 
477  virtual int32_t hashCode(void) const;
478 
487  inline static UnicodeSet *fromUSet(USet *uset);
488 
497  inline static const UnicodeSet *fromUSet(const USet *uset);
498 
506  inline USet *toUSet();
507 
508 
516  inline const USet * toUSet() const;
517 
518 
519  //----------------------------------------------------------------
520  // Freezable API
521  //----------------------------------------------------------------
522 
531  inline UBool isFrozen() const;
532 
547 
557 
558  //----------------------------------------------------------------
559  // Public API
560  //----------------------------------------------------------------
561 
573 
579  static UBool resemblesPattern(const UnicodeString& pattern,
580  int32_t pos);
581 
595  UErrorCode& status);
596 
597 #ifndef U_HIDE_INTERNAL_API
598 
615  uint32_t options,
616  const SymbolTable* symbols,
617  UErrorCode& status);
618 #endif /* U_HIDE_INTERNAL_API */
619 
652  ParsePosition& pos,
653  uint32_t options,
654  const SymbolTable* symbols,
655  UErrorCode& status);
656 
671  UBool escapeUnprintable = FALSE) const;
672 
696  int32_t value,
697  UErrorCode& ec);
698 
729  const UnicodeString& value,
730  UErrorCode& ec);
731 
740  virtual int32_t size(void) const;
741 
748  virtual UBool isEmpty(void) const;
749 
757  virtual UBool contains(UChar32 c) const;
758 
767  virtual UBool contains(UChar32 start, UChar32 end) const;
768 
776  UBool contains(const UnicodeString& s) const;
777 
785  virtual UBool containsAll(const UnicodeSet& c) const;
786 
794  UBool containsAll(const UnicodeString& s) const;
795 
804  UBool containsNone(UChar32 start, UChar32 end) const;
805 
813  UBool containsNone(const UnicodeSet& c) const;
814 
823 
832  inline UBool containsSome(UChar32 start, UChar32 end) const;
833 
841  inline UBool containsSome(const UnicodeSet& s) const;
842 
850  inline UBool containsSome(const UnicodeString& s) const;
851 
870  int32_t span(const UChar *s, int32_t length, USetSpanCondition spanCondition) const;
871 
884  inline int32_t span(const UnicodeString &s, int32_t start, USetSpanCondition spanCondition) const;
885 
903  int32_t spanBack(const UChar *s, int32_t length, USetSpanCondition spanCondition) const;
904 
918  inline int32_t spanBack(const UnicodeString &s, int32_t limit, USetSpanCondition spanCondition) const;
919 
938  int32_t spanUTF8(const char *s, int32_t length, USetSpanCondition spanCondition) const;
939 
957  int32_t spanBackUTF8(const char *s, int32_t length, USetSpanCondition spanCondition) const;
958 
963  virtual UMatchDegree matches(const Replaceable& text,
964  int32_t& offset,
965  int32_t limit,
966  UBool incremental);
967 
968 private:
991  static int32_t matchRest(const Replaceable& text,
992  int32_t start, int32_t limit,
993  const UnicodeString& s);
994 
1004  int32_t findCodePoint(UChar32 c) const;
1005 
1006 public:
1007 
1015  virtual void addMatchSetTo(UnicodeSet& toUnionTo) const;
1016 
1025  int32_t indexOf(UChar32 c) const;
1026 
1036  UChar32 charAt(int32_t index) const;
1037 
1052  virtual UnicodeSet& add(UChar32 start, UChar32 end);
1053 
1062 
1075 
1076  private:
1082  static int32_t getSingleCP(const UnicodeString& s);
1083 
1084  void _add(const UnicodeString& s);
1085 
1086  public:
1096 
1106 
1116 
1126 
1135  static UnicodeSet* U_EXPORT2 createFrom(const UnicodeString& s);
1136 
1137 
1145  static UnicodeSet* U_EXPORT2 createFromAll(const UnicodeString& s);
1146 
1160  virtual UnicodeSet& retain(UChar32 start, UChar32 end);
1161 
1162 
1169 
1183  virtual UnicodeSet& remove(UChar32 start, UChar32 end);
1184 
1193 
1204 
1212  virtual UnicodeSet& complement(void);
1213 
1228  virtual UnicodeSet& complement(UChar32 start, UChar32 end);
1229 
1238 
1250 
1263  virtual UnicodeSet& addAll(const UnicodeSet& c);
1264 
1276  virtual UnicodeSet& retainAll(const UnicodeSet& c);
1277 
1289  virtual UnicodeSet& removeAll(const UnicodeSet& c);
1290 
1302 
1309  virtual UnicodeSet& clear(void);
1310 
1336  UnicodeSet& closeOver(int32_t attribute);
1337 
1345 
1353  virtual int32_t getRangeCount(void) const;
1354 
1362  virtual UChar32 getRangeStart(int32_t index) const;
1363 
1371  virtual UChar32 getRangeEnd(int32_t index) const;
1372 
1421  int32_t serialize(uint16_t *dest, int32_t destCapacity, UErrorCode& ec) const;
1422 
1429  virtual UnicodeSet& compact();
1430 
1442  static UClassID U_EXPORT2 getStaticClassID(void);
1443 
1452  virtual UClassID getDynamicClassID(void) const;
1453 
1454 private:
1455 
1456  // Private API for the USet API
1457 
1458  friend class USetAccess;
1459 
1460  int32_t getStringCount() const;
1461 
1462  const UnicodeString* getString(int32_t index) const;
1463 
1464  //----------------------------------------------------------------
1465  // RuleBasedTransliterator support
1466  //----------------------------------------------------------------
1467 
1468 private:
1469 
1475  virtual UBool matchesIndexValue(uint8_t v) const;
1476 
1477 private:
1478  friend class RBBIRuleScanner;
1479 
1480  //----------------------------------------------------------------
1481  // Implementation: Clone as thawed (see ICU4J Freezable)
1482  //----------------------------------------------------------------
1483 
1484  UnicodeSet(const UnicodeSet& o, UBool /* asThawed */);
1485 
1486  //----------------------------------------------------------------
1487  // Implementation: Pattern parsing
1488  //----------------------------------------------------------------
1489 
1490  void applyPatternIgnoreSpace(const UnicodeString& pattern,
1491  ParsePosition& pos,
1492  const SymbolTable* symbols,
1493  UErrorCode& status);
1494 
1495  void applyPattern(RuleCharacterIterator& chars,
1496  const SymbolTable* symbols,
1497  UnicodeString& rebuiltPat,
1498  uint32_t options,
1499  UnicodeSet& (UnicodeSet::*caseClosure)(int32_t attribute),
1500  UErrorCode& ec);
1501 
1502  //----------------------------------------------------------------
1503  // Implementation: Utility methods
1504  //----------------------------------------------------------------
1505 
1506  void ensureCapacity(int32_t newLen, UErrorCode& ec);
1507 
1508  void ensureBufferCapacity(int32_t newLen, UErrorCode& ec);
1509 
1510  void swapBuffers(void);
1511 
1512  UBool allocateStrings(UErrorCode &status);
1513 
1514  UnicodeString& _toPattern(UnicodeString& result,
1515  UBool escapeUnprintable) const;
1516 
1517  UnicodeString& _generatePattern(UnicodeString& result,
1518  UBool escapeUnprintable) const;
1519 
1520  static void _appendToPat(UnicodeString& buf, const UnicodeString& s, UBool escapeUnprintable);
1521 
1522  static void _appendToPat(UnicodeString& buf, UChar32 c, UBool escapeUnprintable);
1523 
1524  //----------------------------------------------------------------
1525  // Implementation: Fundamental operators
1526  //----------------------------------------------------------------
1527 
1528  void exclusiveOr(const UChar32* other, int32_t otherLen, int8_t polarity);
1529 
1530  void add(const UChar32* other, int32_t otherLen, int8_t polarity);
1531 
1532  void retain(const UChar32* other, int32_t otherLen, int8_t polarity);
1533 
1539  static UBool resemblesPropertyPattern(const UnicodeString& pattern,
1540  int32_t pos);
1541 
1542  static UBool resemblesPropertyPattern(RuleCharacterIterator& chars,
1543  int32_t iterOpts);
1544 
1584  UnicodeSet& applyPropertyPattern(const UnicodeString& pattern,
1585  ParsePosition& ppos,
1586  UErrorCode &ec);
1587 
1588  void applyPropertyPattern(RuleCharacterIterator& chars,
1589  UnicodeString& rebuiltPat,
1590  UErrorCode& ec);
1591 
1592  friend void U_CALLCONV UnicodeSet_initInclusion(int32_t src, UErrorCode &status);
1593  static const UnicodeSet* getInclusions(int32_t src, UErrorCode &status);
1594 
1599  typedef UBool (*Filter)(UChar32 codePoint, void* context);
1600 
1610  void applyFilter(Filter filter,
1611  void* context,
1612  int32_t src,
1613  UErrorCode &status);
1614 
1618  void setPattern(const UnicodeString& newPat);
1622  void releasePattern();
1623 
1624  friend class UnicodeSetIterator;
1625 };
1626 
1627 
1628 
1629 inline UBool UnicodeSet::operator!=(const UnicodeSet& o) const {
1630  return !operator==(o);
1631 }
1632 
1633 inline UBool UnicodeSet::isFrozen() const {
1634  return (UBool)(bmpSet!=NULL || stringSpan!=NULL);
1635 }
1636 
1637 inline UBool UnicodeSet::containsSome(UChar32 start, UChar32 end) const {
1638  return !containsNone(start, end);
1639 }
1640 
1641 inline UBool UnicodeSet::containsSome(const UnicodeSet& s) const {
1642  return !containsNone(s);
1643 }
1644 
1645 inline UBool UnicodeSet::containsSome(const UnicodeString& s) const {
1646  return !containsNone(s);
1647 }
1648 
1649 inline UBool UnicodeSet::isBogus() const {
1650  return (UBool)(fFlags & kIsBogus);
1651 }
1652 
1653 inline UnicodeSet *UnicodeSet::fromUSet(USet *uset) {
1654  return reinterpret_cast<UnicodeSet *>(uset);
1655 }
1656 
1657 inline const UnicodeSet *UnicodeSet::fromUSet(const USet *uset) {
1658  return reinterpret_cast<const UnicodeSet *>(uset);
1659 }
1660 
1661 inline USet *UnicodeSet::toUSet() {
1662  return reinterpret_cast<USet *>(this);
1663 }
1664 
1665 inline const USet *UnicodeSet::toUSet() const {
1666  return reinterpret_cast<const USet *>(this);
1667 }
1668 
1669 inline int32_t UnicodeSet::span(const UnicodeString &s, int32_t start, USetSpanCondition spanCondition) const {
1670  int32_t sLength=s.length();
1671  if(start<0) {
1672  start=0;
1673  } else if(start>sLength) {
1674  start=sLength;
1675  }
1676  return start+span(s.getBuffer()+start, sLength-start, spanCondition);
1677 }
1678 
1679 inline int32_t UnicodeSet::spanBack(const UnicodeString &s, int32_t limit, USetSpanCondition spanCondition) const {
1680  int32_t sLength=s.length();
1681  if(limit<0) {
1682  limit=0;
1683  } else if(limit>sLength) {
1684  limit=sLength;
1685  }
1686  return spanBack(s.getBuffer(), limit, spanCondition);
1687 }
1688 
1690 
1691 #endif
icu::UnicodeSet::clear
virtual UnicodeSet & clear(void)
Removes all of the elements from this set.
icu::UnicodeSet::contains
UBool contains(const UnicodeString &s) const
Returns true if this set contains the given multicharacter string.
icu::UnicodeSet::contains
virtual UBool contains(UChar32 start, UChar32 end) const
Returns true if this set contains every character of the given range.
FALSE
#define FALSE
The FALSE value of a UBool.
Definition: umachine.h:242
icu::UnicodeSet::indexOf
int32_t indexOf(UChar32 c) const
Returns the index of the given character within this set, where the set is ordered by ascending code ...
icu::UnicodeSet::add
virtual UnicodeSet & add(UChar32 start, UChar32 end)
Adds the specified range to this set if it is not already present.
icu::UnicodeSet::spanBack
int32_t spanBack(const UChar *s, int32_t length, USetSpanCondition spanCondition) const
Returns the start of the trailing substring of the input string which consists only of characters and...
icu::UnicodeSet::remove
virtual UnicodeSet & remove(UChar32 start, UChar32 end)
Removes the specified range from this set if it is present.
icu::UnicodeSet::resemblesPattern
static UBool resemblesPattern(const UnicodeString &pattern, int32_t pos)
Return true if the given position, in the given pattern, appears to be the start of a UnicodeSet patt...
icu::UnicodeSet::UnicodeSet
UnicodeSet(const UnicodeSet &o)
Constructs a set that is identical to the given UnicodeSet.
icu::UnicodeSet::complement
virtual UnicodeSet & complement(void)
Inverts this set.
icu::UnicodeSet
A mutable set of Unicode characters and multicharacter strings.
Definition: uniset.h:276
icu::UnicodeSet::getRangeStart
virtual UChar32 getRangeStart(int32_t index) const
Iteration method that returns the first character in the specified range of this set.
icu::UnicodeSet::applyPattern
UnicodeSet & applyPattern(const UnicodeString &pattern, uint32_t options, const SymbolTable *symbols, UErrorCode &status)
Modifies this set to represent the set specified by the given pattern, optionally ignoring Unicode Pa...
icu::UnicodeSet::remove
UnicodeSet & remove(UChar32 c)
Removes the specified character from this set if it is present.
UBool
int8_t UBool
The ICU boolean type.
Definition: umachine.h:234
icu::UnicodeSet::getDynamicClassID
virtual UClassID getDynamicClassID(void) const
Implement UnicodeFunctor API.
icu::UnicodeSet::spanBackUTF8
int32_t spanBackUTF8(const char *s, int32_t length, USetSpanCondition spanCondition) const
Returns the start of the trailing substring of the input string which consists only of characters and...
icu::Replaceable
Replaceable is an abstract base class representing a string of characters that supports the replaceme...
Definition: rep.h:71
icu::UnicodeSet::compact
virtual UnicodeSet & compact()
Reallocate this objects internal structures to take up the least possible space, without changing thi...
icu::UnicodeSet::isEmpty
virtual UBool isEmpty(void) const
Returns true if this set contains no elements.
U_CALLCONV
#define U_CALLCONV
Similar to U_CDECL_BEGIN/U_CDECL_END, this qualifier is necessary in callback function typedefs to ma...
Definition: platform.h:756
icu::UnicodeSet::operator==
virtual UBool operator==(const UnicodeSet &o) const
Compares the specified object with this set for equality.
icu::operator==
U_EXPORT UBool operator==(const StringPiece &x, const StringPiece &y)
Global operator == for StringPiece.
icu::UnicodeSet::add
UnicodeSet & add(const UnicodeString &s)
Adds the specified multicharacter to this set if it is not already present.
icu::UnicodeSet::getStaticClassID
static UClassID getStaticClassID(void)
Return the class ID for this class.
icu::UnicodeSet::complement
UnicodeSet & complement(const UnicodeString &s)
Complement the specified string in this set.
icu::UnicodeSet::toPattern
virtual UnicodeString & toPattern(UnicodeString &result, UBool escapeUnprintable=FALSE) const
Returns a string representation of this set.
icu::UnicodeMatcher::matchesIndexValue
virtual UBool matchesIndexValue(uint8_t v) const =0
Returns TRUE if this matcher will match a character c, where c & 0xFF == v, at offset,...
U_COMMON_API
#define U_COMMON_API
Set to export library symbols from inside the common library, and to import them from outside.
Definition: utypes.h:357
UProperty
UProperty
Selection constants for Unicode properties.
Definition: uchar.h:161
icu::UnicodeSet::charAt
UChar32 charAt(int32_t index) const
Returns the character at the given index within this set, where the set is ordered by ascending code ...
icu::SymbolTable
An interface that defines both lookup protocol and parsing of symbolic names.
Definition: symtable.h:54
icu::UnicodeSet::addAll
virtual UnicodeSet & addAll(const UnicodeSet &c)
Adds all of the elements in the specified set to this set if they're not already present.
icu::UnicodeSet::containsNone
UBool containsNone(UChar32 start, UChar32 end) const
Returns true if this set contains none of the characters of the given range.
USetSpanCondition
USetSpanCondition
Argument values for whether span() and similar functions continue while the current character is cont...
Definition: uset.h:150
icu::UnicodeSet::closeOver
UnicodeSet & closeOver(int32_t attribute)
Close this set over the given attribute.
icu::UnicodeSet::removeAll
UnicodeSet & removeAll(const UnicodeString &s)
Remove EACH of the characters in this string.
icu::UnicodeSet::complementAll
UnicodeSet & complementAll(const UnicodeString &s)
Complement EACH of the characters in this string.
icu::UnicodeString::length
int32_t length(void) const
Return the length of the UnicodeString object.
Definition: unistr.h:3653
icu::UnicodeSet::serialize
int32_t serialize(uint16_t *dest, int32_t destCapacity, UErrorCode &ec) const
Serializes this set into an array of 16-bit integers.
NULL
#define NULL
Define NULL if necessary, to 0 for C++ and to ((void *)0) for C.
Definition: utypes.h:186
icu::UnicodeSetIterator
UnicodeSetIterator iterates over the contents of a UnicodeSet.
Definition: usetiter.h:61
icu::UnicodeSet::retain
UnicodeSet & retain(UChar32 c)
Retain the specified character from this set if it is present.
unifilt.h
C++ API: Unicode Filter.
icu::UnicodeSet::complement
UnicodeSet & complement(UChar32 c)
Complements the specified character in this set.
icu::UnicodeSet::addMatchSetTo
virtual void addMatchSetTo(UnicodeSet &toUnionTo) const
Implementation of UnicodeMatcher API.
icu::UnicodeString
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition: unistr.h:246
icu::UnicodeSet::applyPropertyAlias
UnicodeSet & applyPropertyAlias(const UnicodeString &prop, const UnicodeString &value, UErrorCode &ec)
Modifies this set to contain those code points which have the given value for the given property.
UChar32
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
Definition: umachine.h:332
icu::UnicodeFunctor
UnicodeFunctor is an abstract base class for objects that perform match and/or replace operations on ...
Definition: unifunct.h:33
UClassID
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition: uobject.h:91
UErrorCode
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
Definition: utypes.h:476
icu::UnicodeSet::remove
UnicodeSet & remove(const UnicodeString &s)
Removes the specified string from this set if it is present.
icu::UnicodeSet::UnicodeSet_initInclusion
friend void UnicodeSet_initInclusion(int32_t src, UErrorCode &status)
icu::UnicodeSet::contains
virtual UBool contains(UChar32 c) const
Returns true if this set contains the given character.
icu::UnicodeSet::spanUTF8
int32_t spanUTF8(const char *s, int32_t length, USetSpanCondition spanCondition) const
Returns the length of the initial substring of the input string which consists only of characters and...
icu::UnicodeSet::containsAll
UBool containsAll(const UnicodeString &s) const
Returns true if this set contains all the characters of the given string.
icu::UnicodeSet::removeAll
virtual UnicodeSet & removeAll(const UnicodeSet &c)
Removes from this set all of its elements that are contained in the specified set.
icu::UnicodeSet::retainAll
virtual UnicodeSet & retainAll(const UnicodeSet &c)
Retains only the elements in this set that are contained in the specified set.
icu::UnicodeSet::containsNone
UBool containsNone(const UnicodeString &s) const
Returns true if this set contains none of the characters of the given string.
icu::UnicodeSet::matches
virtual UMatchDegree matches(const Replaceable &text, int32_t &offset, int32_t limit, UBool incremental)
Implement UnicodeMatcher::matches()
icu::operator!=
UBool operator!=(const StringPiece &x, const StringPiece &y)
Global operator != for StringPiece.
Definition: stringpiece.h:218
icu::UnicodeSet::applyPattern
UnicodeSet & applyPattern(const UnicodeString &pattern, UErrorCode &status)
Modifies this set to represent the set specified by the given pattern, ignoring Unicode Pattern_White...
icu::UMatchDegree
UMatchDegree
Constants returned by UnicodeMatcher::matches() indicating the degree of match.
Definition: unimatch.h:30
icu::UnicodeSet::complement
virtual UnicodeSet & complement(UChar32 start, UChar32 end)
Complements the specified range in this set.
icu::UnicodeSet::containsAll
virtual UBool containsAll(const UnicodeSet &c) const
Returns true if this set contains all the characters and strings of the given set.
icu::UnicodeSet::UnicodeSet
UnicodeSet(const UnicodeString &pattern, uint32_t options, const SymbolTable *symbols, UErrorCode &status)
Constructs a set from the given pattern.
icu::UnicodeSet::setToBogus
void setToBogus()
Make this UnicodeSet object invalid.
icu::UnicodeSet::removeAllStrings
virtual UnicodeSet & removeAllStrings()
Remove all strings from this set.
icu::UnicodeSet::addAll
UnicodeSet & addAll(const UnicodeString &s)
Adds each of the characters in this string to the set.
icu::UnicodeSet::span
int32_t span(const UChar *s, int32_t length, USetSpanCondition spanCondition) const
Returns the length of the initial substring of the input string which consists only of characters and...
icu::UnicodeSet::add
UnicodeSet & add(UChar32 c)
Adds the specified character to this set if it is not already present.
icu::UnicodeSet::applyIntPropertyValue
UnicodeSet & applyIntPropertyValue(UProperty prop, int32_t value, UErrorCode &ec)
Modifies this set to contain those code points which have the given value for the given binary or enu...
icu::UnicodeSet::UnicodeSet
UnicodeSet()
Constructs an empty set.
uset.h
C API: Unicode Set.
icu::UnicodeSet::containsNone
UBool containsNone(const UnicodeSet &c) const
Returns true if this set contains none of the characters and strings of the given set.
icu::UnicodeSet::freeze
UnicodeFunctor * freeze()
Freeze the set (make it immutable).
icu::UnicodeSet::getRangeEnd
virtual UChar32 getRangeEnd(int32_t index) const
Iteration method that returns the last character in the specified range of this set.
icu::UnicodeSet::createFrom
static UnicodeSet * createFrom(const UnicodeString &s)
Makes a set from a multicharacter string.
icu::UnicodeSet::cloneAsThawed
UnicodeFunctor * cloneAsThawed() const
Clone the set and make the clone mutable.
icu::UnicodeSet::UnicodeSet
UnicodeSet(UChar32 start, UChar32 end)
Constructs a set containing the given range.
icu::UnicodeSet::~UnicodeSet
virtual ~UnicodeSet()
Destructs the set.
icu::UnicodeSet::size
virtual int32_t size(void) const
Returns the number of elements in this set (its cardinality).
icu::UnicodeSet::operator=
UnicodeSet & operator=(const UnicodeSet &o)
Assigns this object to be a copy of another.
icu::UnicodeSet::UnicodeSet
UnicodeSet(const UnicodeString &pattern, ParsePosition &pos, uint32_t options, const SymbolTable *symbols, UErrorCode &status)
Constructs a set from the given pattern.
icu::UnicodeSet::set
UnicodeSet & set(UChar32 start, UChar32 end)
Make this object represent the range start - end.
icu::UnicodeSet_initInclusion
void UnicodeSet_initInclusion(int32_t src, UErrorCode &status)
icu::UnicodeSet::hashCode
virtual int32_t hashCode(void) const
Returns the hash code value for this set.
icu::UnicodeSet::applyPattern
UnicodeSet & applyPattern(const UnicodeString &pattern, ParsePosition &pos, uint32_t options, const SymbolTable *symbols, UErrorCode &status)
Parses the given pattern, starting at the given position.
UChar
uint16_t UChar
Define UChar to be UCHAR_TYPE, if that is #defined (for example, to char16_t), or wchar_t if that is ...
Definition: umachine.h:312
USet
struct USet USet
Definition: ucnv.h:67
icu::UnicodeSet::createFromAll
static UnicodeSet * createFromAll(const UnicodeString &s)
Makes a set from each of the characters in the string.
U_NAMESPACE_END
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:130
icu::UnicodeFilter
UnicodeFilter defines a protocol for selecting a subset of the full range (U+0000 to U+10FFFF) of Uni...
Definition: unifilt.h:59
icu::ParsePosition
ParsePosition is a simple class used by Format and its subclasses to keep track of the current positi...
Definition: parsepos.h:47
U_NAMESPACE_BEGIN
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:129
icu::UnicodeSet::clone
virtual UnicodeFunctor * clone() const
Returns a copy of this object.
icu::UnicodeSet::UnicodeSet
UnicodeSet(const UnicodeString &pattern, UErrorCode &status)
Constructs a set from the given pattern.
icu::UnicodeSet::retain
virtual UnicodeSet & retain(UChar32 start, UChar32 end)
Retain only the elements in this set that are contained in the specified range.
icu::UnicodeSet::retainAll
UnicodeSet & retainAll(const UnicodeString &s)
Retains EACH of the characters in this string.
icu::UnicodeSet::getRangeCount
virtual int32_t getRangeCount(void) const
Iteration method that returns the number of ranges contained in this set.
unistr.h
C++ API: Unicode String.
icu::UnicodeSet::complementAll
virtual UnicodeSet & complementAll(const UnicodeSet &c)
Complements in this set all elements contained in the specified set.
icu::UnicodeString::getBuffer
UChar * getBuffer(int32_t minCapacity)
Get a read/write pointer to the internal buffer.