ICU 71.1  71.1
uniset.h
Go to the documentation of this file.
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 ***************************************************************************
5 * Copyright (C) 1999-2016, International Business Machines Corporation
6 * and others. All Rights Reserved.
7 ***************************************************************************
8 * Date Name Description
9 * 10/20/99 alan Creation.
10 ***************************************************************************
11 */
12 
13 #ifndef UNICODESET_H
14 #define UNICODESET_H
15 
16 #include "unicode/utypes.h"
17 
18 #if U_SHOW_CPLUSPLUS_API
19 
20 #include "unicode/ucpmap.h"
21 #include "unicode/unifilt.h"
22 #include "unicode/unistr.h"
23 #include "unicode/uset.h"
24 
30 U_NAMESPACE_BEGIN
31 
32 // Forward Declarations.
33 class BMPSet;
34 class ParsePosition;
35 class RBBIRuleScanner;
36 class SymbolTable;
37 class UnicodeSetStringSpan;
38 class UVector;
39 class RuleCharacterIterator;
40 
286 private:
291  static constexpr int32_t INITIAL_CAPACITY = 25;
292  // fFlags constant
293  static constexpr uint8_t kIsBogus = 1; // This set is bogus (i.e. not valid)
294 
295  UChar32* list = stackList; // MUST be terminated with HIGH
296  int32_t capacity = INITIAL_CAPACITY; // capacity of list
297  int32_t len = 1; // length of list used; 1 <= len <= capacity
298  uint8_t fFlags = 0; // Bit flag (see constants above)
299 
300  BMPSet *bmpSet = nullptr; // The set is frozen iff either bmpSet or stringSpan is not NULL.
301  UChar32* buffer = nullptr; // internal buffer, may be NULL
302  int32_t bufferCapacity = 0; // capacity of buffer
303 
313  char16_t *pat = nullptr;
314  int32_t patLen = 0;
315 
316  UVector* strings = nullptr; // maintained in sorted order
317  UnicodeSetStringSpan *stringSpan = nullptr;
318 
324  UChar32 stackList[INITIAL_CAPACITY];
325 
326 public:
336  inline UBool isBogus(void) const;
337 
354  void setToBogus();
355 
356 public:
357 
358  enum {
363  MIN_VALUE = 0,
364 
369  MAX_VALUE = 0x10ffff
370  };
371 
372  //----------------------------------------------------------------
373  // Constructors &c
374  //----------------------------------------------------------------
375 
376 public:
377 
383 
393 
394 #ifndef U_HIDE_INTERNAL_API
399  kSerialized /* result of serialize() */
400  };
401 
412  UnicodeSet(const uint16_t buffer[], int32_t bufferLen,
413  ESerialization serialization, UErrorCode &status);
414 #endif /* U_HIDE_INTERNAL_API */
415 
424  UnicodeSet(const UnicodeString& pattern,
425  UErrorCode& status);
426 
427 #ifndef U_HIDE_INTERNAL_API
440  UnicodeSet(const UnicodeString& pattern,
441  uint32_t options,
442  const SymbolTable* symbols,
443  UErrorCode& status);
444 #endif /* U_HIDE_INTERNAL_API */
445 
459  UnicodeSet(const UnicodeString& pattern, ParsePosition& pos,
460  uint32_t options,
461  const SymbolTable* symbols,
462  UErrorCode& status);
463 
469 
474  virtual ~UnicodeSet();
475 
482 
494  virtual bool operator==(const UnicodeSet& o) const;
495 
501  inline bool operator!=(const UnicodeSet& o) const;
502 
512  virtual UnicodeSet* clone() const override;
513 
521  virtual int32_t hashCode(void) const;
522 
531  inline static UnicodeSet *fromUSet(USet *uset);
532 
541  inline static const UnicodeSet *fromUSet(const USet *uset);
542 
550  inline USet *toUSet();
551 
552 
560  inline const USet * toUSet() const;
561 
562 
563  //----------------------------------------------------------------
564  // Freezable API
565  //----------------------------------------------------------------
566 
575  inline UBool isFrozen() const;
576 
591 
601 
602  //----------------------------------------------------------------
603  // Public API
604  //----------------------------------------------------------------
605 
616 
622  static UBool resemblesPattern(const UnicodeString& pattern,
623  int32_t pos);
624 
638  UErrorCode& status);
639 
640 #ifndef U_HIDE_INTERNAL_API
658  uint32_t options,
659  const SymbolTable* symbols,
660  UErrorCode& status);
661 #endif /* U_HIDE_INTERNAL_API */
662 
695  ParsePosition& pos,
696  uint32_t options,
697  const SymbolTable* symbols,
698  UErrorCode& status);
699 
714  UBool escapeUnprintable = false) const override;
715 
739  int32_t value,
740  UErrorCode& ec);
741 
772  const UnicodeString& value,
773  UErrorCode& ec);
774 
787  virtual int32_t size(void) const;
788 
795  virtual UBool isEmpty(void) const;
796 
797 #ifndef U_HIDE_DRAFT_API
802  UBool hasStrings() const;
803 #endif // U_HIDE_DRAFT_API
804 
812  virtual UBool contains(UChar32 c) const override;
813 
822  virtual UBool contains(UChar32 start, UChar32 end) const;
823 
831  UBool contains(const UnicodeString& s) const;
832 
840  virtual UBool containsAll(const UnicodeSet& c) const;
841 
849  UBool containsAll(const UnicodeString& s) const;
850 
859  UBool containsNone(UChar32 start, UChar32 end) const;
860 
868  UBool containsNone(const UnicodeSet& c) const;
869 
878 
887  inline UBool containsSome(UChar32 start, UChar32 end) const;
888 
896  inline UBool containsSome(const UnicodeSet& s) const;
897 
905  inline UBool containsSome(const UnicodeString& s) const;
906 
925  int32_t span(const char16_t *s, int32_t length, USetSpanCondition spanCondition) const;
926 
939  inline int32_t span(const UnicodeString &s, int32_t start, USetSpanCondition spanCondition) const;
940 
958  int32_t spanBack(const char16_t *s, int32_t length, USetSpanCondition spanCondition) const;
959 
973  inline int32_t spanBack(const UnicodeString &s, int32_t limit, USetSpanCondition spanCondition) const;
974 
993  int32_t spanUTF8(const char *s, int32_t length, USetSpanCondition spanCondition) const;
994 
1012  int32_t spanBackUTF8(const char *s, int32_t length, USetSpanCondition spanCondition) const;
1013 
1018  virtual UMatchDegree matches(const Replaceable& text,
1019  int32_t& offset,
1020  int32_t limit,
1021  UBool incremental) override;
1022 
1023 private:
1046  static int32_t matchRest(const Replaceable& text,
1047  int32_t start, int32_t limit,
1048  const UnicodeString& s);
1049 
1059  int32_t findCodePoint(UChar32 c) const;
1060 
1061 public:
1062 
1070  virtual void addMatchSetTo(UnicodeSet& toUnionTo) const override;
1071 
1080  int32_t indexOf(UChar32 c) const;
1081 
1097  UChar32 charAt(int32_t index) const;
1098 
1113  virtual UnicodeSet& add(UChar32 start, UChar32 end);
1114 
1126 
1139 
1140  private:
1146  static int32_t getSingleCP(const UnicodeString& s);
1147 
1148  void _add(const UnicodeString& s);
1149 
1150  public:
1160 
1169 
1178 
1187 
1196  static UnicodeSet* U_EXPORT2 createFrom(const UnicodeString& s);
1197 
1198 
1206  static UnicodeSet* U_EXPORT2 createFromAll(const UnicodeString& s);
1207 
1219  virtual UnicodeSet& retain(UChar32 start, UChar32 end);
1220 
1221 
1231 
1243 
1257  virtual UnicodeSet& remove(UChar32 start, UChar32 end);
1258 
1270 
1281 
1295 
1308  virtual UnicodeSet& complement(UChar32 start, UChar32 end);
1309 
1321 
1332 
1345  virtual UnicodeSet& addAll(const UnicodeSet& c);
1346 
1358  virtual UnicodeSet& retainAll(const UnicodeSet& c);
1359 
1371  virtual UnicodeSet& removeAll(const UnicodeSet& c);
1372 
1384 
1391  virtual UnicodeSet& clear(void);
1392 
1418  UnicodeSet& closeOver(int32_t attribute);
1419 
1427 
1435  virtual int32_t getRangeCount(void) const;
1436 
1444  virtual UChar32 getRangeStart(int32_t index) const;
1445 
1453  virtual UChar32 getRangeEnd(int32_t index) const;
1454 
1503  int32_t serialize(uint16_t *dest, int32_t destCapacity, UErrorCode& ec) const;
1504 
1511  virtual UnicodeSet& compact();
1512 
1524  static UClassID U_EXPORT2 getStaticClassID(void);
1525 
1534  virtual UClassID getDynamicClassID(void) const override;
1535 
1536 private:
1537 
1538  // Private API for the USet API
1539 
1540  friend class USetAccess;
1541 
1542  const UnicodeString* getString(int32_t index) const;
1543 
1544  //----------------------------------------------------------------
1545  // RuleBasedTransliterator support
1546  //----------------------------------------------------------------
1547 
1548 private:
1549 
1555  virtual UBool matchesIndexValue(uint8_t v) const override;
1556 
1557 private:
1558  friend class RBBIRuleScanner;
1559 
1560  //----------------------------------------------------------------
1561  // Implementation: Clone as thawed (see ICU4J Freezable)
1562  //----------------------------------------------------------------
1563 
1564  UnicodeSet(const UnicodeSet& o, UBool /* asThawed */);
1565  UnicodeSet& copyFrom(const UnicodeSet& o, UBool asThawed);
1566 
1567  //----------------------------------------------------------------
1568  // Implementation: Pattern parsing
1569  //----------------------------------------------------------------
1570 
1571  void applyPatternIgnoreSpace(const UnicodeString& pattern,
1572  ParsePosition& pos,
1573  const SymbolTable* symbols,
1574  UErrorCode& status);
1575 
1576  void applyPattern(RuleCharacterIterator& chars,
1577  const SymbolTable* symbols,
1578  UnicodeString& rebuiltPat,
1579  uint32_t options,
1580  UnicodeSet& (UnicodeSet::*caseClosure)(int32_t attribute),
1581  int32_t depth,
1582  UErrorCode& ec);
1583 
1584  //----------------------------------------------------------------
1585  // Implementation: Utility methods
1586  //----------------------------------------------------------------
1587 
1588  static int32_t nextCapacity(int32_t minCapacity);
1589 
1590  bool ensureCapacity(int32_t newLen);
1591 
1592  bool ensureBufferCapacity(int32_t newLen);
1593 
1594  void swapBuffers(void);
1595 
1596  UBool allocateStrings(UErrorCode &status);
1597  int32_t stringsSize() const;
1598  UBool stringsContains(const UnicodeString &s) const;
1599 
1600  UnicodeString& _toPattern(UnicodeString& result,
1601  UBool escapeUnprintable) const;
1602 
1603  UnicodeString& _generatePattern(UnicodeString& result,
1604  UBool escapeUnprintable) const;
1605 
1606  static void _appendToPat(UnicodeString& buf, const UnicodeString& s, UBool escapeUnprintable);
1607 
1608  static void _appendToPat(UnicodeString& buf, UChar32 c, UBool escapeUnprintable);
1609 
1610  static void _appendToPat(UnicodeString &result, UChar32 start, UChar32 end,
1611  UBool escapeUnprintable);
1612 
1613  //----------------------------------------------------------------
1614  // Implementation: Fundamental operators
1615  //----------------------------------------------------------------
1616 
1617  void exclusiveOr(const UChar32* other, int32_t otherLen, int8_t polarity);
1618 
1619  void add(const UChar32* other, int32_t otherLen, int8_t polarity);
1620 
1621  void retain(const UChar32* other, int32_t otherLen, int8_t polarity);
1622 
1628  static UBool resemblesPropertyPattern(const UnicodeString& pattern,
1629  int32_t pos);
1630 
1631  static UBool resemblesPropertyPattern(RuleCharacterIterator& chars,
1632  int32_t iterOpts);
1633 
1673  UnicodeSet& applyPropertyPattern(const UnicodeString& pattern,
1674  ParsePosition& ppos,
1675  UErrorCode &ec);
1676 
1677  void applyPropertyPattern(RuleCharacterIterator& chars,
1678  UnicodeString& rebuiltPat,
1679  UErrorCode& ec);
1680 
1681  static const UnicodeSet* getInclusions(int32_t src, UErrorCode &status);
1682 
1687  typedef UBool (*Filter)(UChar32 codePoint, void* context);
1688 
1698  void applyFilter(Filter filter,
1699  void* context,
1700  const UnicodeSet* inclusions,
1701  UErrorCode &status);
1702 
1703  // UCPMap is now stable ICU 63
1704  void applyIntPropertyValue(const UCPMap *map,
1705  UCPMapValueFilter *filter, const void *context,
1706  UErrorCode &errorCode);
1707 
1711  void setPattern(const UnicodeString& newPat) {
1712  setPattern(newPat.getBuffer(), newPat.length());
1713  }
1714  void setPattern(const char16_t *newPat, int32_t newPatLen);
1718  void releasePattern();
1719 
1720  friend class UnicodeSetIterator;
1721 };
1722 
1723 
1724 
1725 inline bool UnicodeSet::operator!=(const UnicodeSet& o) const {
1726  return !operator==(o);
1727 }
1728 
1729 inline UBool UnicodeSet::isFrozen() const {
1730  return (UBool)(bmpSet!=NULL || stringSpan!=NULL);
1731 }
1732 
1733 inline UBool UnicodeSet::containsSome(UChar32 start, UChar32 end) const {
1734  return !containsNone(start, end);
1735 }
1736 
1737 inline UBool UnicodeSet::containsSome(const UnicodeSet& s) const {
1738  return !containsNone(s);
1739 }
1740 
1741 inline UBool UnicodeSet::containsSome(const UnicodeString& s) const {
1742  return !containsNone(s);
1743 }
1744 
1745 inline UBool UnicodeSet::isBogus() const {
1746  return (UBool)(fFlags & kIsBogus);
1747 }
1748 
1749 inline UnicodeSet *UnicodeSet::fromUSet(USet *uset) {
1750  return reinterpret_cast<UnicodeSet *>(uset);
1751 }
1752 
1753 inline const UnicodeSet *UnicodeSet::fromUSet(const USet *uset) {
1754  return reinterpret_cast<const UnicodeSet *>(uset);
1755 }
1756 
1757 inline USet *UnicodeSet::toUSet() {
1758  return reinterpret_cast<USet *>(this);
1759 }
1760 
1761 inline const USet *UnicodeSet::toUSet() const {
1762  return reinterpret_cast<const USet *>(this);
1763 }
1764 
1765 inline int32_t UnicodeSet::span(const UnicodeString &s, int32_t start, USetSpanCondition spanCondition) const {
1766  int32_t sLength=s.length();
1767  if(start<0) {
1768  start=0;
1769  } else if(start>sLength) {
1770  start=sLength;
1771  }
1772  return start+span(s.getBuffer()+start, sLength-start, spanCondition);
1773 }
1774 
1775 inline int32_t UnicodeSet::spanBack(const UnicodeString &s, int32_t limit, USetSpanCondition spanCondition) const {
1776  int32_t sLength=s.length();
1777  if(limit<0) {
1778  limit=0;
1779  } else if(limit>sLength) {
1780  limit=sLength;
1781  }
1782  return spanBack(s.getBuffer(), limit, spanCondition);
1783 }
1784 
1785 U_NAMESPACE_END
1786 
1787 #endif /* U_SHOW_CPLUSPLUS_API */
1788 
1789 #endif
#define INITIAL_CAPACITY
The initial size of an array if it is unspecified.
Definition: RunArrays.h:32
ParsePosition is a simple class used by Format and its subclasses to keep track of the current positi...
Definition: parsepos.h:52
Replaceable is an abstract base class representing a string of characters that supports the replaceme...
Definition: rep.h:77
An interface that defines both lookup protocol and parsing of symbolic names.
Definition: symtable.h:59
UnicodeFilter defines a protocol for selecting a subset of the full range (U+0000 to U+10FFFF) of Uni...
Definition: unifilt.h:65
virtual UBool matchesIndexValue(uint8_t v) const =0
Returns true if this matcher will match a character c, where c & 0xFF == v, at offset,...
UnicodeSetIterator iterates over the contents of a UnicodeSet.
Definition: usetiter.h:67
A mutable set of Unicode characters and multicharacter strings.
Definition: uniset.h:285
virtual UnicodeSet & removeAll(const UnicodeSet &c)
Removes from this set all of its elements that are contained in the specified set.
UnicodeSet * cloneAsThawed() const
Clone the set and make the clone mutable.
virtual UChar32 getRangeEnd(int32_t index) const
Iteration method that returns the last character in the specified range of this set.
UnicodeSet()
Constructs an empty set.
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...
virtual UnicodeSet & complement(UChar32 start, UChar32 end)
Complements the specified range in this set.
UnicodeSet & remove(UChar32 c)
Removes the specified character from this set if it is present.
UnicodeSet(UChar32 start, UChar32 end)
Constructs a set containing the given range.
UnicodeSet & complementAll(const UnicodeString &s)
Complement EACH of the characters in this string.
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...
void setToBogus()
Make this UnicodeSet object invalid.
UnicodeSet & retain(UChar32 c)
Retain the specified character from this set if it is present.
virtual UnicodeSet & retain(UChar32 start, UChar32 end)
Retain only the elements in this set that are contained in the specified range.
virtual void addMatchSetTo(UnicodeSet &toUnionTo) const override
Implementation of UnicodeMatcher API.
UnicodeSet & retainAll(const UnicodeString &s)
Retains EACH of the characters in this string.
virtual UChar32 getRangeStart(int32_t index) const
Iteration method that returns the first character in the specified range of this set.
UnicodeSet & complement(const UnicodeString &s)
Complement the specified string in this set.
UnicodeSet * freeze()
Freeze the set (make it immutable).
UnicodeSet & addAll(const UnicodeString &s)
Adds each of the characters in this string to the set.
UnicodeSet & remove(const UnicodeString &s)
Removes the specified string from this set if it is present.
int32_t indexOf(UChar32 c) const
Returns the index of the given character within this set, where the set is ordered by ascending code ...
virtual UnicodeSet & addAll(const UnicodeSet &c)
Adds all of the elements in the specified set to this set if they're not already present.
virtual UClassID getDynamicClassID(void) const override
Implement UnicodeFunctor API.
UnicodeSet(const UnicodeString &pattern, ParsePosition &pos, uint32_t options, const SymbolTable *symbols, UErrorCode &status)
Constructs a set from the given pattern.
virtual UnicodeString & toPattern(UnicodeString &result, UBool escapeUnprintable=false) const override
Returns a string representation of this set.
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...
virtual UnicodeSet & complement()
This is equivalent to complement(MIN_VALUE, MAX_VALUE).
virtual int32_t hashCode(void) const
Returns the hash code value for this set.
UnicodeSet & retain(const UnicodeString &s)
Retains only the specified string from this set if it is present.
virtual UBool containsAll(const UnicodeSet &c) const
Returns true if this set contains all the characters and strings of the given set.
UnicodeSet & applyPattern(const UnicodeString &pattern, UErrorCode &status)
Modifies this set to represent the set specified by the given pattern, ignoring Unicode Pattern_White...
static UnicodeSet * createFrom(const UnicodeString &s)
Makes a set from a multicharacter string.
UBool containsNone(const UnicodeString &s) const
Returns true if this set contains none of the characters of the given string.
static UnicodeSet * createFromAll(const UnicodeString &s)
Makes a set from each of the characters in the string.
virtual UnicodeSet & retainAll(const UnicodeSet &c)
Retains only the elements in this set that are contained in the specified set.
UnicodeSet(const UnicodeSet &o)
Constructs a set that is identical to the given UnicodeSet.
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...
virtual ~UnicodeSet()
Destructs the set.
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...
UChar32 charAt(int32_t index) const
Returns the character at the given index within this set, where the set is ordered by ascending code ...
UnicodeSet & closeOver(int32_t attribute)
Close this set over the given attribute.
virtual int32_t getRangeCount(void) const
Iteration method that returns the number of ranges contained in this set.
UnicodeSet & applyPattern(const UnicodeString &pattern, ParsePosition &pos, uint32_t options, const SymbolTable *symbols, UErrorCode &status)
Parses the given pattern, starting at the given position.
UBool containsNone(UChar32 start, UChar32 end) const
Returns true if this set contains none of the characters of the given range.
UnicodeSet & add(UChar32 c)
Adds the specified character to this set if it is not already present.
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...
virtual UBool contains(UChar32 start, UChar32 end) const
Returns true if this set contains every character of the given range.
UBool containsAll(const UnicodeString &s) const
Returns true if this set contains all the characters of the given string.
virtual int32_t size(void) const
Returns the number of elements in this set (its cardinality).
int32_t serialize(uint16_t *dest, int32_t destCapacity, UErrorCode &ec) const
Serializes this set into an array of 16-bit integers.
UnicodeSet & add(const UnicodeString &s)
Adds the specified multicharacter to this set if it is not already present.
UBool contains(const UnicodeString &s) const
Returns true if this set contains the given multicharacter string.
virtual UnicodeSet & removeAllStrings()
Remove all strings from this set.
virtual UnicodeSet * clone() const override
Returns a copy of this object.
static UClassID getStaticClassID(void)
Return the class ID for this class.
virtual UBool isEmpty(void) const
Returns true if this set contains no elements.
virtual bool operator==(const UnicodeSet &o) const
Compares the specified object with this set for equality.
UnicodeSet(const UnicodeString &pattern, UErrorCode &status)
Constructs a set from the given pattern.
UBool hasStrings() const
UnicodeSet & complement(UChar32 c)
Complements the specified character in this set.
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...
virtual UnicodeSet & compact()
Reallocate this objects internal structures to take up the least possible space, without changing thi...
virtual UMatchDegree matches(const Replaceable &text, int32_t &offset, int32_t limit, UBool incremental) override
Implement UnicodeMatcher::matches()
UnicodeSet & removeAll(const UnicodeString &s)
Remove EACH of the characters in this string.
virtual UnicodeSet & add(UChar32 start, UChar32 end)
Adds the specified range to this set if it is not already present.
virtual UBool contains(UChar32 c) const override
Returns true if this set contains the given character.
UnicodeSet(const uint16_t buffer[], int32_t bufferLen, ESerialization serialization, UErrorCode &status)
Constructs a set from the output of serialize().
virtual UnicodeSet & remove(UChar32 start, UChar32 end)
Removes the specified range from this set if it is present.
virtual UnicodeSet & complementAll(const UnicodeSet &c)
Complements in this set all elements contained in the specified set.
UnicodeSet(const UnicodeString &pattern, uint32_t options, const SymbolTable *symbols, UErrorCode &status)
Constructs a set from the given pattern.
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.
virtual UnicodeSet & clear(void)
Removes all of the elements from this set.
UnicodeSet & set(UChar32 start, UChar32 end)
Make this object represent the range start - end.
UnicodeSet & operator=(const UnicodeSet &o)
Assigns this object to be a copy of another.
UBool containsNone(const UnicodeSet &c) const
Returns true if this set contains none of the characters and strings of the given set.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition: unistr.h:296
int32_t length(void) const
Return the length of the UnicodeString object.
Definition: unistr.h:3890
char16_t * getBuffer(int32_t minCapacity)
Get a read/write pointer to the internal buffer.
U_EXPORT UBool operator==(const StringPiece &x, const StringPiece &y)
Global operator == for StringPiece.
UMatchDegree
Constants returned by UnicodeMatcher::matches() indicating the degree of match.
Definition: unimatch.h:33
bool operator!=(const StringPiece &x, const StringPiece &y)
Global operator != for StringPiece.
Definition: stringpiece.h:335
UProperty
Selection constants for Unicode properties.
Definition: uchar.h:195
This file defines an abstract map from Unicode code points to integer values.
uint32_t UCPMapValueFilter(const void *context, uint32_t value)
Callback function type: Modifies a map value.
Definition: ucpmap.h:114
struct UCPMap UCPMap
Abstract map from Unicode code points (U+0000..U+10FFFF) to integer values.
Definition: ucpmap.h:31
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
Definition: umachine.h:467
int8_t UBool
The ICU boolean type, a signed-byte integer.
Definition: umachine.h:269
#define U_FINAL
Defined to the C++11 "final" keyword if available.
Definition: umachine.h:141
C++ API: Unicode Filter.
C++ API: Unicode String.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition: uobject.h:96
C API: Unicode Set.
USetSpanCondition
Argument values for whether span() and similar functions continue while the current character is cont...
Definition: uset.h:159
struct USet USet
USet is the C API type corresponding to C++ class UnicodeSet.
Definition: uset.h:50
Basic definitions for ICU, for both C and C++ APIs.
#define NULL
Define NULL if necessary, to nullptr for C++ and to ((void *)0) for C.
Definition: utypes.h:188
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415
#define U_COMMON_API
Set to export library symbols from inside the common library, and to import them from outside.
Definition: utypes.h:300