ICU 73.2  73.2
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Friends
icu::final Class Reference

This class allows one to iterate through all the strings that are canonically equivalent to a given string. More...

#include <caniter.h>

Inheritance diagram for icu::final:
icu::UObject icu::UMemory icu::UMemory icu::UMemory icu::UnicodeFilter icu::UObject icu::UObject icu::UObject icu::UObject icu::UObject icu::UObject icu::SearchIterator icu::Collator

Data Structures

struct  final
 Access to the list of edits. More...

Public Types

enum  { MIN_VALUE = 0, MAX_VALUE = 0x10ffff }
enum  ESerialization { kSerialized }
enum  { NULLORDER = (int32_t)0xffffffff }
enum  DtContextType { FORMAT, STANDALONE, DT_CONTEXT_COUNT }
 Selector for date formatting context. More...
enum  DtWidthType {
  ABBREVIATED, WIDE, NARROW, SHORT,
  DT_WIDTH_COUNT = 4
}
 Selector for date formatting width. More...
enum  EMonthPatternType {
  kLeapMonthPatternFormatWide, kLeapMonthPatternFormatAbbrev, kLeapMonthPatternFormatNarrow, kLeapMonthPatternStandaloneWide,
  kLeapMonthPatternStandaloneAbbrev, kLeapMonthPatternStandaloneNarrow, kLeapMonthPatternNumeric, kMonthPatternsCount
}
 Somewhat temporary constants for leap month pattern types, adequate for supporting just leap month patterns as needed for Chinese lunar calendar. More...
enum  ECapitalizationContextUsageType {
  kCapContextUsageOther = 0, kCapContextUsageMonthFormat, kCapContextUsageMonthStandalone, kCapContextUsageMonthNarrow,
  kCapContextUsageDayFormat, kCapContextUsageDayStandalone, kCapContextUsageDayNarrow, kCapContextUsageEraWide,
  kCapContextUsageEraAbbrev, kCapContextUsageEraNarrow, kCapContextUsageZoneLong, kCapContextUsageZoneShort,
  kCapContextUsageMetazoneLong, kCapContextUsageMetazoneShort, kCapContextUsageTypeCount = 14
}
 Constants for capitalization context usage types. More...
enum  { kMaxIntervalPatternIndex = kIPI_MAX_INDEX }
 Max index for stored interval patterns. More...

Public Member Functions

 CanonicalIterator (const UnicodeString &source, UErrorCode &status)
 Construct a CanonicalIterator object.
virtual ~CanonicalIterator ()
 Destructor Cleans pieces.
UnicodeString getSource ()
 Gets the NFD form of the current source we are iterating over.
void reset ()
 Resets the iterator so that one can start again from the beginning.
UnicodeString next ()
 Get the next canonically equivalent string.
void setSource (const UnicodeString &newSource, UErrorCode &status)
 Set a new source for this iterator.
virtual UClassID getDynamicClassID () const override
 ICU "poor man's RTTI", returns a UClassID for the actual class.
 Char16Ptr (char16_t *p)
 Copies the pointer.
 Char16Ptr (uint16_t *p)
 Converts the pointer to char16_t *.
 Char16Ptr (wchar_t *p)
 Converts the pointer to char16_t *.
 Char16Ptr (std::nullptr_t p)
 nullptr constructor.
 ~Char16Ptr ()
 Destructor.
char16_t * get () const
 Pointer access.
 operator char16_t * () const
 char16_t pointer access via type conversion (e.g., static_cast).
 ConstChar16Ptr (const char16_t *p)
 Copies the pointer.
 ConstChar16Ptr (const uint16_t *p)
 Converts the pointer to char16_t *.
 ConstChar16Ptr (const wchar_t *p)
 Converts the pointer to char16_t *.
 ConstChar16Ptr (const std::nullptr_t p)
 nullptr constructor.
 ~ConstChar16Ptr ()
 Destructor.
const char16_t * get () const
 Pointer access.
 operator const char16_t * () const
 char16_t pointer access via type conversion (e.g., static_cast).
 Edits ()
 Constructs an empty object.
 Edits (const Edits &other)
 Copy constructor.
 Edits (Edits &&src) noexcept
 Move constructor, might leave src empty.
 ~Edits ()
 Destructor.
Editsoperator= (const Edits &other)
 Assignment operator.
Editsoperator= (Edits &&src) noexcept
 Move assignment operator, might leave src empty.
void reset () noexcept
 Resets the data but may not release memory.
void addUnchanged (int32_t unchangedLength)
 Adds a no-change edit: a record for an unchanged segment of text.
void addReplace (int32_t oldLength, int32_t newLength)
 Adds a change edit: a record for a text replacement/insertion/deletion.
UBool copyErrorTo (UErrorCode &outErrorCode) const
 Sets the UErrorCode if an error occurred while recording edits.
int32_t lengthDelta () const
 How much longer is the new text compared with the old text?
UBool hasChanges () const
int32_t numberOfChanges () const
Iterator getCoarseChangesIterator () const
 Returns an Iterator for coarse-grained change edits (adjacent change edits are treated as one).
Iterator getCoarseIterator () const
 Returns an Iterator for coarse-grained change and no-change edits (adjacent change edits are treated as one).
Iterator getFineChangesIterator () const
 Returns an Iterator for fine-grained change edits (full granularity of change edits is retained).
Iterator getFineIterator () const
 Returns an Iterator for fine-grained change and no-change edits (full granularity of change edits is retained).
EditsmergeAndAppend (const Edits &ab, const Edits &bc, UErrorCode &errorCode)
 Merges the two input Edits and appends the result to this object.
 SimpleFormatter ()
 Default constructor.
 SimpleFormatter (const UnicodeString &pattern, UErrorCode &errorCode)
 Constructs a formatter from the pattern string.
 SimpleFormatter (const UnicodeString &pattern, int32_t min, int32_t max, UErrorCode &errorCode)
 Constructs a formatter from the pattern string.
 SimpleFormatter (const SimpleFormatter &other)
 Copy constructor.
SimpleFormatteroperator= (const SimpleFormatter &other)
 Assignment operator.
 ~SimpleFormatter ()
 Destructor.
UBool applyPattern (const UnicodeString &pattern, UErrorCode &errorCode)
 Changes this object according to the new pattern.
UBool applyPatternMinMaxArguments (const UnicodeString &pattern, int32_t min, int32_t max, UErrorCode &errorCode)
 Changes this object according to the new pattern.
int32_t getArgumentLimit () const
UnicodeStringformat (const UnicodeString &value0, UnicodeString &appendTo, UErrorCode &errorCode) const
 Formats the given value, appending to the appendTo builder.
UnicodeStringformat (const UnicodeString &value0, const UnicodeString &value1, UnicodeString &appendTo, UErrorCode &errorCode) const
 Formats the given values, appending to the appendTo builder.
UnicodeStringformat (const UnicodeString &value0, const UnicodeString &value1, const UnicodeString &value2, UnicodeString &appendTo, UErrorCode &errorCode) const
 Formats the given values, appending to the appendTo builder.
UnicodeStringformatAndAppend (const UnicodeString *const *values, int32_t valuesLength, UnicodeString &appendTo, int32_t *offsets, int32_t offsetsLength, UErrorCode &errorCode) const
 Formats the given values, appending to the appendTo string.
UnicodeStringformatAndReplace (const UnicodeString *const *values, int32_t valuesLength, UnicodeString &result, int32_t *offsets, int32_t offsetsLength, UErrorCode &errorCode) const
 Formats the given values, replacing the contents of the result string.
UnicodeString getTextWithNoArguments () const
 Returns the pattern text with none of the arguments.
UnicodeString getTextWithNoArguments (int32_t *offsets, int32_t offsetsLength) const
 Returns the pattern text with none of the arguments.
UBool isBogus (void) const
 Determine if this object contains a valid set.
void setToBogus ()
 Make this UnicodeSet object invalid.
 UnicodeSet ()
 Constructs an empty set.
 UnicodeSet (UChar32 start, UChar32 end)
 Constructs a set containing the given range.
 UnicodeSet (const uint16_t buffer[], int32_t bufferLen, ESerialization serialization, UErrorCode &status)
 Constructs a set from the output of serialize().
 UnicodeSet (const UnicodeString &pattern, UErrorCode &status)
 Constructs a set from the given pattern.
 UnicodeSet (const UnicodeString &pattern, uint32_t options, const SymbolTable *symbols, UErrorCode &status)
 Constructs a set from the given pattern.
 UnicodeSet (const UnicodeString &pattern, ParsePosition &pos, uint32_t options, const SymbolTable *symbols, UErrorCode &status)
 Constructs a set from the given pattern.
 UnicodeSet (const UnicodeSet &o)
 Constructs a set that is identical to the given UnicodeSet.
virtual ~UnicodeSet ()
 Destructs the set.
UnicodeSetoperator= (const UnicodeSet &o)
 Assigns this object to be a copy of another.
virtual bool operator== (const UnicodeSet &o) const
 Compares the specified object with this set for equality.
bool operator!= (const UnicodeSet &o) const
 Compares the specified object with this set for equality.
virtual UnicodeSetclone () const override
 Returns a copy of this object.
virtual int32_t hashCode (void) const
 Returns the hash code value for this set.
USettoUSet ()
 Produce a USet * pointer for this UnicodeSet.
const USettoUSet () const
 Produce a const USet * pointer for this UnicodeSet.
UBool isFrozen () const
 Determines whether the set has been frozen (made immutable) or not.
UnicodeSetfreeze ()
 Freeze the set (make it immutable).
UnicodeSetcloneAsThawed () const
 Clone the set and make the clone mutable.
UnicodeSetset (UChar32 start, UChar32 end)
 Make this object represent the range `start - end`.
UnicodeSetapplyPattern (const UnicodeString &pattern, UErrorCode &status)
 Modifies this set to represent the set specified by the given pattern, ignoring Unicode Pattern_White_Space characters.
UnicodeSetapplyPattern (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 Pattern_White_Space characters.
UnicodeSetapplyPattern (const UnicodeString &pattern, ParsePosition &pos, uint32_t options, const SymbolTable *symbols, UErrorCode &status)
 Parses the given pattern, starting at the given position.
virtual UnicodeStringtoPattern (UnicodeString &result, UBool escapeUnprintable=false) const override
 Returns a string representation of this set.
UnicodeSetapplyIntPropertyValue (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 enumerated property, as returned by u_getIntPropertyValue.
UnicodeSetapplyPropertyAlias (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 int32_t size (void) const
 Returns the number of elements in this set (its cardinality).
virtual UBool isEmpty (void) const
 Returns true if this set contains no elements.
UBool hasStrings () const
virtual UBool contains (UChar32 c) const override
 Returns true if this set contains the given character.
virtual UBool contains (UChar32 start, UChar32 end) const
 Returns true if this set contains every character of the given range.
UBool contains (const UnicodeString &s) const
 Returns true if this set contains the given multicharacter string.
virtual UBool containsAll (const UnicodeSet &c) const
 Returns true if this set contains all the characters and strings of the given set.
UBool containsAll (const UnicodeString &s) const
 Returns true if this set contains all the characters of the given string.
UBool containsNone (UChar32 start, UChar32 end) const
 Returns true if this set contains none of the characters of the given range.
UBool containsNone (const UnicodeSet &c) const
 Returns true if this set contains none of the characters and strings of the given set.
UBool containsNone (const UnicodeString &s) const
 Returns true if this set contains none of the characters of the given string.
UBool containsSome (UChar32 start, UChar32 end) const
 Returns true if this set contains one or more of the characters in the given range.
UBool containsSome (const UnicodeSet &s) const
 Returns true if this set contains one or more of the characters and strings of the given set.
UBool containsSome (const UnicodeString &s) const
 Returns true if this set contains one or more of the characters of the given string.
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 strings that are contained in this set (USET_SPAN_CONTAINED, USET_SPAN_SIMPLE), or only of characters and strings that are not contained in this set (USET_SPAN_NOT_CONTAINED).
int32_t span (const UnicodeString &s, int32_t start, USetSpanCondition spanCondition) const
 Returns the end of the substring of the input string according to the USetSpanCondition.
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 strings that are contained in this set (USET_SPAN_CONTAINED, USET_SPAN_SIMPLE), or only of characters and strings that are not contained in this set (USET_SPAN_NOT_CONTAINED).
int32_t spanBack (const UnicodeString &s, int32_t limit, USetSpanCondition spanCondition) const
 Returns the start of the substring of the input string according to the USetSpanCondition.
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 strings that are contained in this set (USET_SPAN_CONTAINED, USET_SPAN_SIMPLE), or only of characters and strings that are not contained in this set (USET_SPAN_NOT_CONTAINED).
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 strings that are contained in this set (USET_SPAN_CONTAINED, USET_SPAN_SIMPLE), or only of characters and strings that are not contained in this set (USET_SPAN_NOT_CONTAINED).
virtual UMatchDegree matches (const Replaceable &text, int32_t &offset, int32_t limit, UBool incremental) override
 Implement UnicodeMatcher::matches()
virtual void addMatchSetTo (UnicodeSet &toUnionTo) const override
 Implementation of UnicodeMatcher API.
int32_t indexOf (UChar32 c) const
 Returns the index of the given character within this set, where the set is ordered by ascending code point.
UChar32 charAt (int32_t index) const
 Returns the character at the given index within this set, where the set is ordered by ascending code point.
virtual UnicodeSetadd (UChar32 start, UChar32 end)
 Adds the specified range to this set if it is not already present.
UnicodeSetadd (UChar32 c)
 Adds the specified character to this set if it is not already present.
UnicodeSetadd (const UnicodeString &s)
 Adds the specified multicharacter to this set if it is not already present.
UnicodeSetaddAll (const UnicodeString &s)
 Adds each of the characters in this string to the set.
UnicodeSetretainAll (const UnicodeString &s)
 Retains EACH of the characters in this string.
UnicodeSetcomplementAll (const UnicodeString &s)
 Complement EACH of the characters in this string.
UnicodeSetremoveAll (const UnicodeString &s)
 Remove EACH of the characters in this string.
virtual UnicodeSetretain (UChar32 start, UChar32 end)
 Retain only the elements in this set that are contained in the specified range.
UnicodeSetretain (UChar32 c)
 Retain the specified character from this set if it is present.
UnicodeSetretain (const UnicodeString &s)
 Retains only the specified string from this set if it is present.
virtual UnicodeSetremove (UChar32 start, UChar32 end)
 Removes the specified range from this set if it is present.
UnicodeSetremove (UChar32 c)
 Removes the specified character from this set if it is present.
UnicodeSetremove (const UnicodeString &s)
 Removes the specified string from this set if it is present.
virtual UnicodeSetcomplement ()
 This is equivalent to complement(MIN_VALUE, MAX_VALUE).
virtual UnicodeSetcomplement (UChar32 start, UChar32 end)
 Complements the specified range in this set.
UnicodeSetcomplement (UChar32 c)
 Complements the specified character in this set.
UnicodeSetcomplement (const UnicodeString &s)
 Complement the specified string in this set.
virtual UnicodeSetaddAll (const UnicodeSet &c)
 Adds all of the elements in the specified set to this set if they're not already present.
virtual UnicodeSetretainAll (const UnicodeSet &c)
 Retains only the elements in this set that are contained in the specified set.
virtual UnicodeSetremoveAll (const UnicodeSet &c)
 Removes from this set all of its elements that are contained in the specified set.
virtual UnicodeSetcomplementAll (const UnicodeSet &c)
 Complements in this set all elements contained in the specified set.
virtual UnicodeSetclear (void)
 Removes all of the elements from this set.
UnicodeSetcloseOver (int32_t attribute)
 Close this set over the given attribute.
virtual UnicodeSetremoveAllStrings ()
 Remove all strings from this set.
virtual int32_t getRangeCount (void) const
 Iteration method that returns the number of ranges contained in this set.
virtual UChar32 getRangeStart (int32_t index) const
 Iteration method that returns the first character in the specified range of this set.
virtual UChar32 getRangeEnd (int32_t index) const
 Iteration method that returns the last character in the specified range of this set.
int32_t serialize (uint16_t *dest, int32_t destCapacity, UErrorCode &ec) const
 Serializes this set into an array of 16-bit integers.
virtual UnicodeSetcompact ()
 Reallocate this objects internal structures to take up the least possible space, without changing this object's value.
virtual UClassID getDynamicClassID (void) const override
 Implement UnicodeFunctor API.
 UnicodeSetIterator (const UnicodeSet &set)
 Create an iterator over the given set.
 UnicodeSetIterator ()
 Create an iterator over nothing.
virtual ~UnicodeSetIterator ()
 Destructor.
UBool isString () const
 Returns true if the current element is a string.
UChar32 getCodepoint () const
 Returns the current code point, if isString() returned false.
UChar32 getCodepointEnd () const
 Returns the end of the current code point range, if isString() returned false and nextRange() was called.
const UnicodeStringgetString ()
 Returns the current string, if isString() returned true.
UnicodeSetIterator & skipToStrings ()
 Skips over the remaining code points/ranges, if any.
UBool next ()
 Advances the iteration position to the next element in the set, which can be either a single code point or a string.
UBool nextRange ()
 Returns the next element in the set, either a code point range or a string.
void reset (const UnicodeSet &set)
 Sets this iterator to visit the elements of the given set and resets it to the start of that set.
void reset ()
 Resets this iterator to the start of the set.
virtual UClassID getDynamicClassID () const override
 ICU "poor man's RTTI", returns a UClassID for the actual class.
 CollationElementIterator (const CollationElementIterator &other)
 Copy constructor.
virtual ~CollationElementIterator ()
 Destructor.
bool operator== (const CollationElementIterator &other) const
 Returns true if "other" is the same as "this".
bool operator!= (const CollationElementIterator &other) const
 Returns true if "other" is not the same as "this".
void reset (void)
 Resets the cursor to the beginning of the string.
int32_t next (UErrorCode &status)
 Gets the ordering priority of the next character in the string.
int32_t previous (UErrorCode &status)
 Get the ordering priority of the previous collation element in the string.
int32_t getMaxExpansion (int32_t order) const
 Return the maximum length of any expansion sequences that end with the specified comparison order.
int32_t strengthOrder (int32_t order) const
 Gets the comparison order in the desired strength.
void setText (const UnicodeString &str, UErrorCode &status)
 Sets the source string.
void setText (CharacterIterator &str, UErrorCode &status)
 Sets the source string.
int32_t getOffset (void) const
 Gets the offset of the currently processed character in the source string.
void setOffset (int32_t newOffset, UErrorCode &status)
 Sets the offset of the currently processed character in the source string.
virtual UClassID getDynamicClassID () const override
 ICU "poor man's RTTI", returns a UClassID for the actual class.
UCollationElementstoUCollationElements ()
const UCollationElementstoUCollationElements () const
 DateFormatSymbols (UErrorCode &status)
 Construct a DateFormatSymbols object by loading format data from resources for the default locale, in the default calendar (Gregorian).
 DateFormatSymbols (const Locale &locale, UErrorCode &status)
 Construct a DateFormatSymbols object by loading format data from resources for the given locale, in the default calendar (Gregorian).
 DateFormatSymbols (const char *type, UErrorCode &status)
 Construct a DateFormatSymbols object by loading format data from resources for the default locale, in the default calendar (Gregorian).
 DateFormatSymbols (const Locale &locale, const char *type, UErrorCode &status)
 Construct a DateFormatSymbols object by loading format data from resources for the given locale, in the default calendar (Gregorian).
 DateFormatSymbols (const DateFormatSymbols &)
 Copy constructor.
DateFormatSymbolsoperator= (const DateFormatSymbols &)
 Assignment operator.
virtual ~DateFormatSymbols ()
 Destructor.
bool operator== (const DateFormatSymbols &other) const
 Return true if another object is semantically equal to this one.
bool operator!= (const DateFormatSymbols &other) const
 Return true if another object is semantically unequal to this one.
const UnicodeStringgetEras (int32_t &count) const
 Gets abbreviated era strings.
void setEras (const UnicodeString *eras, int32_t count)
 Sets abbreviated era strings.
const UnicodeStringgetEraNames (int32_t &count) const
 Gets era name strings.
void setEraNames (const UnicodeString *eraNames, int32_t count)
 Sets era name strings.
const UnicodeStringgetNarrowEras (int32_t &count) const
 Gets narrow era strings.
void setNarrowEras (const UnicodeString *narrowEras, int32_t count)
 Sets narrow era strings.
const UnicodeStringgetMonths (int32_t &count) const
 Gets month strings.
void setMonths (const UnicodeString *months, int32_t count)
 Sets month strings.
const UnicodeStringgetShortMonths (int32_t &count) const
 Gets short month strings.
void setShortMonths (const UnicodeString *shortMonths, int32_t count)
 Sets short month strings.
const UnicodeStringgetMonths (int32_t &count, DtContextType context, DtWidthType width) const
 Gets month strings by width and context.
void setMonths (const UnicodeString *months, int32_t count, DtContextType context, DtWidthType width)
 Sets month strings by width and context.
const UnicodeStringgetWeekdays (int32_t &count) const
 Gets wide weekday strings.
void setWeekdays (const UnicodeString *weekdays, int32_t count)
 Sets wide weekday strings.
const UnicodeStringgetShortWeekdays (int32_t &count) const
 Gets abbreviated weekday strings.
void setShortWeekdays (const UnicodeString *abbrevWeekdays, int32_t count)
 Sets abbreviated weekday strings.
const UnicodeStringgetWeekdays (int32_t &count, DtContextType context, DtWidthType width) const
 Gets weekday strings by width and context.
void setWeekdays (const UnicodeString *weekdays, int32_t count, DtContextType context, DtWidthType width)
 Sets weekday strings by width and context.
const UnicodeStringgetQuarters (int32_t &count, DtContextType context, DtWidthType width) const
 Gets quarter strings by width and context.
void setQuarters (const UnicodeString *quarters, int32_t count, DtContextType context, DtWidthType width)
 Sets quarter strings by width and context.
const UnicodeStringgetAmPmStrings (int32_t &count) const
 Gets AM/PM strings.
void setAmPmStrings (const UnicodeString *ampms, int32_t count)
 Sets ampm strings.
UnicodeStringgetTimeSeparatorString (UnicodeString &result) const
 Gets the time separator string.
void setTimeSeparatorString (const UnicodeString &newTimeSeparator)
 Sets the time separator string.
const UnicodeStringgetYearNames (int32_t &count, DtContextType context, DtWidthType width) const
 Gets cyclic year name strings if the calendar has them, by width and context.
void setYearNames (const UnicodeString *yearNames, int32_t count, DtContextType context, DtWidthType width)
 Sets cyclic year name strings by width and context.
const UnicodeStringgetZodiacNames (int32_t &count, DtContextType context, DtWidthType width) const
 Gets calendar zodiac name strings if the calendar has them, by width and context.
void setZodiacNames (const UnicodeString *zodiacNames, int32_t count, DtContextType context, DtWidthType width)
 Sets calendar zodiac name strings by width and context.
const UnicodeStringgetLeapMonthPatterns (int32_t &count) const
 Somewhat temporary function for getting complete set of leap month patterns for all contexts & widths, indexed by EMonthPatternType values.
const UnicodeString ** getZoneStrings (int32_t &rowCount, int32_t &columnCount) const
 Gets timezone strings.
void setZoneStrings (const UnicodeString *const *strings, int32_t rowCount, int32_t columnCount)
 Sets timezone strings.
UnicodeStringgetLocalPatternChars (UnicodeString &result) const
 Gets localized date-time pattern characters.
void setLocalPatternChars (const UnicodeString &newLocalPatternChars)
 Sets localized date-time pattern characters.
Locale getLocale (ULocDataLocaleType type, UErrorCode &status) const
 Returns the locale for this object.
virtual UClassID getDynamicClassID () const override
 ICU "poor man's RTTI", returns a UClassID for the actual class.
 DateIntervalInfo (UErrorCode &status)
 Default constructor.
 DateIntervalInfo (const Locale &locale, UErrorCode &status)
 Construct DateIntervalInfo for the given locale,.
 DateIntervalInfo (const DateIntervalInfo &)
 Copy constructor.
DateIntervalInfooperator= (const DateIntervalInfo &)
 Assignment operator.
virtual DateIntervalInfoclone () const
 Clone this object polymorphically.
virtual ~DateIntervalInfo ()
 Destructor.
virtual bool operator== (const DateIntervalInfo &other) const
 Return true if another object is semantically equal to this one.
bool operator!= (const DateIntervalInfo &other) const
 Return true if another object is semantically unequal to this one.
void setIntervalPattern (const UnicodeString &skeleton, UCalendarDateFields lrgDiffCalUnit, const UnicodeString &intervalPattern, UErrorCode &status)
 Provides a way for client to build interval patterns.
UnicodeStringgetIntervalPattern (const UnicodeString &skeleton, UCalendarDateFields field, UnicodeString &result, UErrorCode &status) const
 Get the interval pattern given skeleton and the largest different calendar field.
UnicodeStringgetFallbackIntervalPattern (UnicodeString &result) const
 Get the fallback interval pattern.
void setFallbackIntervalPattern (const UnicodeString &fallbackPattern, UErrorCode &status)
 Re-set the fallback interval pattern.
UBool getDefaultOrder () const
 Get default order -- whether the first date in pattern is later date or not.
virtual UClassID getDynamicClassID () const override
 ICU "poor man's RTTI", returns a UClassID for the actual class.
 RegexPattern ()
 default constructor.
 RegexPattern (const RegexPattern &source)
 Copy Constructor.
virtual ~RegexPattern ()
 Destructor.
bool operator== (const RegexPattern &that) const
 Comparison operator.
bool operator!= (const RegexPattern &that) const
 Comparison operator.
RegexPattern & operator= (const RegexPattern &source)
 Assignment operator.
virtual RegexPattern * clone () const
 Create an exact copy of this RegexPattern object.
virtual uint32_t flags () const
 Get the URegexpFlag match mode flags that were used when compiling this pattern.
virtual RegexMatcher * matcher (const UnicodeString &input, UErrorCode &status) const
 Creates a RegexMatcher that will match the given input against this pattern.
virtual RegexMatcher * matcher (UErrorCode &status) const
 Creates a RegexMatcher that will match against this pattern.
virtual UnicodeString pattern () const
 Returns the regular expression from which this pattern was compiled.
virtual UTextpatternText (UErrorCode &status) const
 Returns the regular expression from which this pattern was compiled.
virtual int32_t groupNumberFromName (const UnicodeString &groupName, UErrorCode &status) const
 Get the group number corresponding to a named capture group.
virtual int32_t groupNumberFromName (const char *groupName, int32_t nameLength, UErrorCode &status) const
 Get the group number corresponding to a named capture group.
virtual int32_t split (const UnicodeString &input, UnicodeString dest[], int32_t destCapacity, UErrorCode &status) const
 Split a string into fields.
virtual int32_t split (UText *input, UText *dest[], int32_t destCapacity, UErrorCode &status) const
 Split a string into fields.
virtual UClassID getDynamicClassID () const override
 ICU "poor man's RTTI", returns a UClassID for the actual class.
void dumpPattern () const
 Dump a compiled pattern.
 RegexMatcher (const UnicodeString &regexp, uint32_t flags, UErrorCode &status)
 Construct a RegexMatcher for a regular expression.
 RegexMatcher (UText *regexp, uint32_t flags, UErrorCode &status)
 Construct a RegexMatcher for a regular expression.
 RegexMatcher (const UnicodeString &regexp, const UnicodeString &input, uint32_t flags, UErrorCode &status)
 Construct a RegexMatcher for a regular expression.
 RegexMatcher (UText *regexp, UText *input, uint32_t flags, UErrorCode &status)
 Construct a RegexMatcher for a regular expression.
virtual ~RegexMatcher ()
 Destructor.
virtual UBool matches (UErrorCode &status)
 Attempts to match the entire input region against the pattern.
virtual UBool matches (int64_t startIndex, UErrorCode &status)
 Resets the matcher, then attempts to match the input beginning at the specified startIndex, and extending to the end of the input.
virtual UBool lookingAt (UErrorCode &status)
 Attempts to match the input string, starting from the beginning of the region, against the pattern.
virtual UBool lookingAt (int64_t startIndex, UErrorCode &status)
 Attempts to match the input string, starting from the specified index, against the pattern.
virtual UBool find ()
 Find the next pattern match in the input string.
virtual UBool find (UErrorCode &status)
 Find the next pattern match in the input string.
virtual UBool find (int64_t start, UErrorCode &status)
 Resets this RegexMatcher and then attempts to find the next substring of the input string that matches the pattern, starting at the specified index.
virtual UnicodeString group (UErrorCode &status) const
 Returns a string containing the text matched by the previous match.
virtual UnicodeString group (int32_t groupNum, UErrorCode &status) const
 Returns a string containing the text captured by the given group during the previous match operation.
virtual int32_t groupCount () const
 Returns the number of capturing groups in this matcher's pattern.
virtual UTextgroup (UText *dest, int64_t &group_len, UErrorCode &status) const
 Returns a shallow clone of the entire live input string with the UText current native index set to the beginning of the requested group.
virtual UTextgroup (int32_t groupNum, UText *dest, int64_t &group_len, UErrorCode &status) const
 Returns a shallow clone of the entire live input string with the UText current native index set to the beginning of the requested group.
virtual int32_t start (UErrorCode &status) const
 Returns the index in the input string of the start of the text matched during the previous match operation.
virtual int64_t start64 (UErrorCode &status) const
 Returns the index in the input string of the start of the text matched during the previous match operation.
virtual int32_t start (int32_t group, UErrorCode &status) const
 Returns the index in the input string of the start of the text matched by the specified capture group during the previous match operation.
virtual int64_t start64 (int32_t group, UErrorCode &status) const
 Returns the index in the input string of the start of the text matched by the specified capture group during the previous match operation.
virtual int32_t end (UErrorCode &status) const
 Returns the index in the input string of the first character following the text matched during the previous match operation.
virtual int64_t end64 (UErrorCode &status) const
 Returns the index in the input string of the first character following the text matched during the previous match operation.
virtual int32_t end (int32_t group, UErrorCode &status) const
 Returns the index in the input string of the character following the text matched by the specified capture group during the previous match operation.
virtual int64_t end64 (int32_t group, UErrorCode &status) const
 Returns the index in the input string of the character following the text matched by the specified capture group during the previous match operation.
virtual RegexMatcher & reset ()
 Resets this matcher.
virtual RegexMatcher & reset (int64_t index, UErrorCode &status)
 Resets this matcher, and set the current input position.
virtual RegexMatcher & reset (const UnicodeString &input)
 Resets this matcher with a new input string.
virtual RegexMatcher & reset (UText *input)
 Resets this matcher with a new input string.
virtual RegexMatcher & refreshInputText (UText *input, UErrorCode &status)
 Set the subject text string upon which the regular expression is looking for matches without changing any other aspect of the matching state.
virtual const UnicodeStringinput () const
 Returns the input string being matched.
virtual UTextinputText () const
 Returns the input string being matched.
virtual UTextgetInput (UText *dest, UErrorCode &status) const
 Returns the input string being matched, either by copying it into the provided UText parameter or by returning a shallow clone of the live input.
virtual RegexMatcher & region (int64_t start, int64_t limit, UErrorCode &status)
 Sets the limits of this matcher's region.
virtual RegexMatcher & region (int64_t regionStart, int64_t regionLimit, int64_t startIndex, UErrorCode &status)
 Identical to region(start, limit, status) but also allows a start position without resetting the region state.
virtual int32_t regionStart () const
 Reports the start index of this matcher's region.
virtual int64_t regionStart64 () const
 Reports the start index of this matcher's region.
virtual int32_t regionEnd () const
 Reports the end (limit) index (exclusive) of this matcher's region.
virtual int64_t regionEnd64 () const
 Reports the end (limit) index (exclusive) of this matcher's region.
virtual UBool hasTransparentBounds () const
 Queries the transparency of region bounds for this matcher.
virtual RegexMatcher & useTransparentBounds (UBool b)
 Sets the transparency of region bounds for this matcher.
virtual UBool hasAnchoringBounds () const
 Return true if this matcher is using anchoring bounds.
virtual RegexMatcher & useAnchoringBounds (UBool b)
 Set whether this matcher is using Anchoring Bounds for its region.
virtual UBool hitEnd () const
 Return true if the most recent matching operation attempted to access additional input beyond the available input text.
virtual UBool requireEnd () const
 Return true the most recent match succeeded and additional input could cause it to fail.
virtual const RegexPattern & pattern () const
 Returns the pattern that is interpreted by this matcher.
virtual UnicodeString replaceAll (const UnicodeString &replacement, UErrorCode &status)
 Replaces every substring of the input that matches the pattern with the given replacement string.
virtual UTextreplaceAll (UText *replacement, UText *dest, UErrorCode &status)
 Replaces every substring of the input that matches the pattern with the given replacement string.
virtual UnicodeString replaceFirst (const UnicodeString &replacement, UErrorCode &status)
 Replaces the first substring of the input that matches the pattern with the replacement string.
virtual UTextreplaceFirst (UText *replacement, UText *dest, UErrorCode &status)
 Replaces the first substring of the input that matches the pattern with the replacement string.
virtual RegexMatcher & appendReplacement (UnicodeString &dest, const UnicodeString &replacement, UErrorCode &status)
 Implements a replace operation intended to be used as part of an incremental find-and-replace.
virtual RegexMatcher & appendReplacement (UText *dest, UText *replacement, UErrorCode &status)
 Implements a replace operation intended to be used as part of an incremental find-and-replace.
virtual UnicodeStringappendTail (UnicodeString &dest)
 As the final step in a find-and-replace operation, append the remainder of the input string, starting at the position following the last appendReplacement(), to the destination string.
virtual UTextappendTail (UText *dest, UErrorCode &status)
 As the final step in a find-and-replace operation, append the remainder of the input string, starting at the position following the last appendReplacement(), to the destination string.
virtual int32_t split (const UnicodeString &input, UnicodeString dest[], int32_t destCapacity, UErrorCode &status)
 Split a string into fields.
virtual int32_t split (UText *input, UText *dest[], int32_t destCapacity, UErrorCode &status)
 Split a string into fields.
virtual void setTimeLimit (int32_t limit, UErrorCode &status)
 Set a processing time limit for match operations with this Matcher.
virtual int32_t getTimeLimit () const
 Get the time limit, if any, for match operations made with this Matcher.
virtual void setStackLimit (int32_t limit, UErrorCode &status)
 Set the amount of heap storage available for use by the match backtracking stack.
virtual int32_t getStackLimit () const
 Get the size of the heap storage available for use by the back tracking stack.
virtual void setMatchCallback (URegexMatchCallback *callback, const void *context, UErrorCode &status)
 Set a callback function for use with this Matcher.
virtual void getMatchCallback (URegexMatchCallback *&callback, const void *&context, UErrorCode &status)
 Get the callback function for this URegularExpression.
virtual void setFindProgressCallback (URegexFindProgressCallback *callback, const void *context, UErrorCode &status)
 Set a progress callback function for use with find operations on this Matcher.
virtual void getFindProgressCallback (URegexFindProgressCallback *&callback, const void *&context, UErrorCode &status)
 Get the find progress callback function for this URegularExpression.
void setTrace (UBool state)
 setTrace Debug function, enable/disable tracing of the matching engine.
virtual UClassID getDynamicClassID () const override
 ICU "poor man's RTTI", returns a UClassID for the actual class.
void resetPreserveRegion ()
 StringSearch (const UnicodeString &pattern, const UnicodeString &text, const Locale &locale, BreakIterator *breakiter, UErrorCode &status)
 Creating a StringSearch instance using the argument locale language rule set.
 StringSearch (const UnicodeString &pattern, const UnicodeString &text, RuleBasedCollator *coll, BreakIterator *breakiter, UErrorCode &status)
 Creating a StringSearch instance using the argument collator language rule set.
 StringSearch (const UnicodeString &pattern, CharacterIterator &text, const Locale &locale, BreakIterator *breakiter, UErrorCode &status)
 Creating a StringSearch instance using the argument locale language rule set.
 StringSearch (const UnicodeString &pattern, CharacterIterator &text, RuleBasedCollator *coll, BreakIterator *breakiter, UErrorCode &status)
 Creating a StringSearch instance using the argument collator language rule set.
 StringSearch (const StringSearch &that)
 Copy constructor that creates a StringSearch instance with the same behavior, and iterating over the same text.
virtual ~StringSearch (void)
 Destructor.
StringSearchclone () const
 Clone this object.
StringSearchoperator= (const StringSearch &that)
 Assignment operator.
virtual bool operator== (const SearchIterator &that) const override
 Equality operator.
virtual void setOffset (int32_t position, UErrorCode &status) override
 Sets the index to point to the given position, and clears any state that's affected.
virtual int32_t getOffset (void) const override
 Return the current index in the text being searched.
virtual void setText (const UnicodeString &text, UErrorCode &status) override
 Set the target text to be searched.
virtual void setText (CharacterIterator &text, UErrorCode &status) override
 Set the target text to be searched.
RuleBasedCollator * getCollator () const
 Gets the collator used for the language rules.
void setCollator (RuleBasedCollator *coll, UErrorCode &status)
 Sets the collator used for the language rules.
void setPattern (const UnicodeString &pattern, UErrorCode &status)
 Sets the pattern used for matching.
const UnicodeStringgetPattern () const
 Gets the search pattern.
virtual void reset () override
 Reset the iteration.
virtual StringSearchsafeClone () const override
 Returns a copy of StringSearch with the same behavior, and iterating over the same text, as this one.
virtual UClassID getDynamicClassID () const override
 ICU "poor man's RTTI", returns a UClassID for the actual class.
 RuleBasedCollator (const UnicodeString &rules, UErrorCode &status)
 RuleBasedCollator constructor.
 RuleBasedCollator (const UnicodeString &rules, ECollationStrength collationStrength, UErrorCode &status)
 RuleBasedCollator constructor.
 RuleBasedCollator (const UnicodeString &rules, UColAttributeValue decompositionMode, UErrorCode &status)
 RuleBasedCollator constructor.
 RuleBasedCollator (const UnicodeString &rules, ECollationStrength collationStrength, UColAttributeValue decompositionMode, UErrorCode &status)
 RuleBasedCollator constructor.
 RuleBasedCollator (const UnicodeString &rules, UParseError &parseError, UnicodeString &reason, UErrorCode &errorCode)
 TODO: document & propose as public API.
 RuleBasedCollator (const RuleBasedCollator &other)
 Copy constructor.
 RuleBasedCollator (const uint8_t *bin, int32_t length, const RuleBasedCollator *base, UErrorCode &status)
 Opens a collator from a collator binary image created using cloneBinary.
virtual ~RuleBasedCollator ()
 Destructor.
RuleBasedCollator & operator= (const RuleBasedCollator &other)
 Assignment operator.
virtual bool operator== (const Collator &other) const override
 Returns true if argument is the same as this object.
virtual RuleBasedCollator * clone () const override
 Makes a copy of this object.
virtual CollationElementIterator * createCollationElementIterator (const UnicodeString &source) const
 Creates a collation element iterator for the source string.
virtual CollationElementIterator * createCollationElementIterator (const CharacterIterator &source) const
 Creates a collation element iterator for the source.
virtual UCollationResult compare (const UnicodeString &source, const UnicodeString &target, UErrorCode &status) const override
 The comparison function compares the character data stored in two different strings.
virtual UCollationResult compare (const UnicodeString &source, const UnicodeString &target, int32_t length, UErrorCode &status) const override
 Does the same thing as compare but limits the comparison to a specified length.
virtual UCollationResult compare (const char16_t *source, int32_t sourceLength, const char16_t *target, int32_t targetLength, UErrorCode &status) const override
 The comparison function compares the character data stored in two different string arrays.
virtual UCollationResult compare (UCharIterator &sIter, UCharIterator &tIter, UErrorCode &status) const override
 Compares two strings using the Collator.
virtual UCollationResult compareUTF8 (const StringPiece &source, const StringPiece &target, UErrorCode &status) const override
 Compares two UTF-8 strings using the Collator.
virtual CollationKeygetCollationKey (const UnicodeString &source, CollationKey &key, UErrorCode &status) const override
 Transforms the string into a series of characters that can be compared with CollationKey.compare().
virtual CollationKeygetCollationKey (const char16_t *source, int32_t sourceLength, CollationKey &key, UErrorCode &status) const override
 Transforms a specified region of the string into a series of characters that can be compared with CollationKey.compare.
virtual int32_t hashCode () const override
 Generates the hash code for the rule-based collation object.
virtual Locale getLocale (ULocDataLocaleType type, UErrorCode &status) const override
 Gets the locale of the Collator.
const UnicodeStringgetRules () const
 Gets the tailoring rules for this collator.
virtual void getVersion (UVersionInfo info) const override
 Gets the version information for a Collator.
int32_t getMaxExpansion (int32_t order) const
 Returns the maximum length of any expansion sequences that end with the specified comparison order.
virtual UClassID getDynamicClassID (void) const override
 Returns a unique class ID POLYMORPHICALLY.
uint8_t * cloneRuleData (int32_t &length, UErrorCode &status) const
 Do not use this method: The caller and the ICU library might use different heaps.
int32_t cloneBinary (uint8_t *buffer, int32_t capacity, UErrorCode &status) const
 Creates a binary image of a collator.
void getRules (UColRuleOption delta, UnicodeString &buffer) const
 Returns current rules.
virtual void setAttribute (UColAttribute attr, UColAttributeValue value, UErrorCode &status) override
 Universal attribute setter.
virtual UColAttributeValue getAttribute (UColAttribute attr, UErrorCode &status) const override
 Universal attribute getter.
virtual CollatorsetMaxVariable (UColReorderCode group, UErrorCode &errorCode) override
 Sets the variable top to the top of the specified reordering group.
virtual UColReorderCode getMaxVariable () const override
 Returns the maximum reordering group whose characters are affected by UCOL_ALTERNATE_HANDLING.
virtual uint32_t setVariableTop (const char16_t *varTop, int32_t len, UErrorCode &status) override
 Sets the variable top to the primary weight of the specified string.
virtual uint32_t setVariableTop (const UnicodeString &varTop, UErrorCode &status) override
 Sets the variable top to the primary weight of the specified string.
virtual void setVariableTop (uint32_t varTop, UErrorCode &status) override
 Sets the variable top to the specified primary weight.
virtual uint32_t getVariableTop (UErrorCode &status) const override
 Gets the variable top value of a Collator.
virtual UnicodeSetgetTailoredSet (UErrorCode &status) const override
 Get a UnicodeSet that contains all the characters and sequences tailored in this collator.
virtual int32_t getSortKey (const UnicodeString &source, uint8_t *result, int32_t resultLength) const override
 Get the sort key as an array of bytes from a UnicodeString.
virtual int32_t getSortKey (const char16_t *source, int32_t sourceLength, uint8_t *result, int32_t resultLength) const override
 Get the sort key as an array of bytes from a char16_t buffer.
virtual int32_t getReorderCodes (int32_t *dest, int32_t destCapacity, UErrorCode &status) const override
 Retrieves the reordering codes for this collator.
virtual void setReorderCodes (const int32_t *reorderCodes, int32_t reorderCodesLength, UErrorCode &status) override
 Sets the ordering of scripts for this collator.
virtual UCollationResult internalCompareUTF8 (const char *left, int32_t leftLength, const char *right, int32_t rightLength, UErrorCode &errorCode) const override
 Implements ucol_strcollUTF8().
virtual int32_t internalGetShortDefinitionString (const char *locale, char *buffer, int32_t capacity, UErrorCode &status) const override
 Get the short definition string for a collator.
virtual int32_t internalNextSortKeyPart (UCharIterator *iter, uint32_t state[2], uint8_t *dest, int32_t count, UErrorCode &errorCode) const override
 Implements ucol_nextSortKeyPart().
 RuleBasedCollator ()
 Only for use in ucol_openRules().
const char * internalGetLocaleID (ULocDataLocaleType type, UErrorCode &errorCode) const
 Implements ucol_getLocaleByType().
void internalGetContractionsAndExpansions (UnicodeSet *contractions, UnicodeSet *expansions, UBool addPrefixes, UErrorCode &errorCode) const
 Implements ucol_getContractionsAndExpansions().
void internalAddContractions (UChar32 c, UnicodeSet &set, UErrorCode &errorCode) const
 Adds the contractions that start with character c to the set.
void internalBuildTailoring (const UnicodeString &rules, int32_t strength, UColAttributeValue decompositionMode, UParseError *outParseError, UnicodeString *outReason, UErrorCode &errorCode)
 Implements from-rule constructors, and ucol_openRules().
void internalGetCEs (const UnicodeString &str, UVector64 &ces, UErrorCode &errorCode) const
 Appends the CEs for the string to the vector.

Static Public Member Functions

static void permute (UnicodeString &source, UBool skipZeros, Hashtable *result, UErrorCode &status)
 Dumb recursive implementation of permutation.
static UClassID getStaticClassID ()
 ICU "poor man's RTTI", returns a UClassID for this class.
static int32_t toLower (const char *locale, uint32_t options, const char16_t *src, int32_t srcLength, char16_t *dest, int32_t destCapacity, Edits *edits, UErrorCode &errorCode)
 Lowercases a UTF-16 string and optionally records edits.
static int32_t toUpper (const char *locale, uint32_t options, const char16_t *src, int32_t srcLength, char16_t *dest, int32_t destCapacity, Edits *edits, UErrorCode &errorCode)
 Uppercases a UTF-16 string and optionally records edits.
static int32_t toTitle (const char *locale, uint32_t options, BreakIterator *iter, const char16_t *src, int32_t srcLength, char16_t *dest, int32_t destCapacity, Edits *edits, UErrorCode &errorCode)
 Titlecases a UTF-16 string and optionally records edits.
static int32_t fold (uint32_t options, const char16_t *src, int32_t srcLength, char16_t *dest, int32_t destCapacity, Edits *edits, UErrorCode &errorCode)
 Case-folds a UTF-16 string and optionally records edits.
static void utf8ToLower (const char *locale, uint32_t options, StringPiece src, ByteSink &sink, Edits *edits, UErrorCode &errorCode)
 Lowercases a UTF-8 string and optionally records edits.
static void utf8ToUpper (const char *locale, uint32_t options, StringPiece src, ByteSink &sink, Edits *edits, UErrorCode &errorCode)
 Uppercases a UTF-8 string and optionally records edits.
static void utf8ToTitle (const char *locale, uint32_t options, BreakIterator *iter, StringPiece src, ByteSink &sink, Edits *edits, UErrorCode &errorCode)
 Titlecases a UTF-8 string and optionally records edits.
static void utf8Fold (uint32_t options, StringPiece src, ByteSink &sink, Edits *edits, UErrorCode &errorCode)
 Case-folds a UTF-8 string and optionally records edits.
static int32_t utf8ToLower (const char *locale, uint32_t options, const char *src, int32_t srcLength, char *dest, int32_t destCapacity, Edits *edits, UErrorCode &errorCode)
 Lowercases a UTF-8 string and optionally records edits.
static int32_t utf8ToUpper (const char *locale, uint32_t options, const char *src, int32_t srcLength, char *dest, int32_t destCapacity, Edits *edits, UErrorCode &errorCode)
 Uppercases a UTF-8 string and optionally records edits.
static int32_t utf8ToTitle (const char *locale, uint32_t options, BreakIterator *iter, const char *src, int32_t srcLength, char *dest, int32_t destCapacity, Edits *edits, UErrorCode &errorCode)
 Titlecases a UTF-8 string and optionally records edits.
static int32_t utf8Fold (uint32_t options, const char *src, int32_t srcLength, char *dest, int32_t destCapacity, Edits *edits, UErrorCode &errorCode)
 Case-folds a UTF-8 string and optionally records edits.
static UnicodeSetfromUSet (USet *uset)
 Get a UnicodeSet pointer from a USet.
static const UnicodeSetfromUSet (const USet *uset)
 Get a UnicodeSet pointer from a const USet.
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 pattern.
static UnicodeSetcreateFrom (const UnicodeString &s)
 Makes a set from a multicharacter string.
static UnicodeSetcreateFromAll (const UnicodeString &s)
 Makes a set from each of the characters in the string.
static UClassID getStaticClassID (void)
 Return the class ID for this class.
static UClassID getStaticClassID ()
 ICU "poor man's RTTI", returns a UClassID for this class.
static int32_t primaryOrder (int32_t order)
 Gets the primary order of a collation order.
static int32_t secondaryOrder (int32_t order)
 Gets the secondary order of a collation order.
static int32_t tertiaryOrder (int32_t order)
 Gets the tertiary order of a collation order.
static UBool isIgnorable (int32_t order)
 Checks if a comparison order is ignorable.
static UClassID getStaticClassID ()
 ICU "poor man's RTTI", returns a UClassID for this class.
static CollationElementIterator * fromUCollationElements (UCollationElements *uc)
static const
CollationElementIterator * 
fromUCollationElements (const UCollationElements *uc)
static const char16_t * getPatternUChars (void)
 Get the non-localized date-time pattern characters.
static UClassID getStaticClassID ()
 ICU "poor man's RTTI", returns a UClassID for this class.
static DateFormatSymbolscreateForLocale (const Locale &locale, UErrorCode &status)
 Gets a DateFormatSymbols by locale.
static UClassID getStaticClassID ()
 ICU "poor man's RTTI", returns a UClassID for this class.
static RegexPattern * compile (const UnicodeString &regex, UParseError &pe, UErrorCode &status)
 Compiles the regular expression in string form into a RegexPattern object.
static RegexPattern * compile (UText *regex, UParseError &pe, UErrorCode &status)
 Compiles the regular expression in string form into a RegexPattern object.
static RegexPattern * compile (const UnicodeString &regex, uint32_t flags, UParseError &pe, UErrorCode &status)
 Compiles the regular expression in string form into a RegexPattern object using the specified URegexpFlag match mode flags.
static RegexPattern * compile (UText *regex, uint32_t flags, UParseError &pe, UErrorCode &status)
 Compiles the regular expression in string form into a RegexPattern object using the specified URegexpFlag match mode flags.
static RegexPattern * compile (const UnicodeString &regex, uint32_t flags, UErrorCode &status)
 Compiles the regular expression in string form into a RegexPattern object using the specified URegexpFlag match mode flags.
static RegexPattern * compile (UText *regex, uint32_t flags, UErrorCode &status)
 Compiles the regular expression in string form into a RegexPattern object using the specified URegexpFlag match mode flags.
static UBool matches (const UnicodeString &regex, const UnicodeString &input, UParseError &pe, UErrorCode &status)
 Test whether a string matches a regular expression.
static UBool matches (UText *regex, UText *input, UParseError &pe, UErrorCode &status)
 Test whether a string matches a regular expression.
static UClassID getStaticClassID ()
 ICU "poor man's RTTI", returns a UClassID for this class.
static UClassID getStaticClassID ()
 ICU "poor man's RTTI", returns a UClassID for this class.
static UClassID getStaticClassID ()
 ICU "poor man's RTTI", returns a UClassID for this class.
static UClassID getStaticClassID (void)
 Returns the class ID for this class.
static RuleBasedCollator * rbcFromUCollator (UCollator *uc)
static const RuleBasedCollator * rbcFromUCollator (const UCollator *uc)

Static Public Attributes

static const char16_t DEFAULT_TIME_SEPARATOR = 0x003a
 This default time separator is used for formatting when the locale doesn't specify any time separator, and always recognized when parsing.
static const char16_t ALTERNATE_TIME_SEPARATOR = 0x002e
 This alternate time separator is always recognized when parsing.

Protected Member Functions

virtual int32_t handleNext (int32_t position, UErrorCode &status) override
 Search forward for matching text, starting at a given location.
virtual int32_t handlePrev (int32_t position, UErrorCode &status) override
 Search backward for matching text, starting at a given location.
virtual void setLocales (const Locale &requestedLocale, const Locale &validLocale, const Locale &actualLocale) override
 Used internally by registration to define the requested and valid locales.

Friends

class number::impl::SimpleModifier
class USetAccess
class RBBIRuleScanner
class UnicodeSetIterator
class RuleBasedCollator
class UCollationPCE
class SimpleDateFormat
class DateFormatSymbolsSingleSetter
class DateIntervalFormat
 DateIntervalFormat will need access to getBestSkeleton(), parseSkeleton(), enum IntervalPatternIndex, and calendarFieldToPatternIndex().
class RegexCompile
class RegexMatcher
class RegexCImpl
class RegexPattern
class CollationElementIterator
class Collator

Detailed Description

This class allows one to iterate through all the strings that are canonically equivalent to a given string.

The RuleBasedCollator class provides the implementation of Collator, using data-driven tables.

StringSearch is a SearchIterator that provides language-sensitive text searching based on the comparison rules defined in a RuleBasedCollator object.

class RegexMatcher bundles together a regular expression pattern and input text to which the expression can be applied.

Class `RegexPattern` represents a compiled regular expression.

DateIntervalInfo is a public class for encapsulating localizable date time interval patterns.

DateFormatSymbols is a public class for encapsulating localizable date-time formatting data -- including timezone data.

The CollationElementIterator class is used as an iterator to walk through each character of an international string.

UnicodeSetIterator iterates over the contents of a UnicodeSet.

A mutable set of Unicode characters and multicharacter strings.

Formats simple patterns like "{1} was born in {0}".

Records lengths of string edits but not replacement text.

const char16_t * wrapper with implicit conversion from distinct but bit-compatible pointer types.

char16_t * wrapper with implicit conversion from distinct but bit-compatible pointer types.

Low-level C++ case mapping functions.

For example, here are some sample results: Results for: {LATIN CAPITAL LETTER A WITH RING ABOVE}{LATIN SMALL LETTER D}{COMBINING DOT ABOVE}{COMBINING CEDILLA} 1: \u0041\u030A\u0064\u0307\u0327 = {LATIN CAPITAL LETTER A}{COMBINING RING ABOVE}{LATIN SMALL LETTER D}{COMBINING DOT ABOVE}{COMBINING CEDILLA} 2: \u0041\u030A\u0064\u0327\u0307 = {LATIN CAPITAL LETTER A}{COMBINING RING ABOVE}{LATIN SMALL LETTER D}{COMBINING CEDILLA}{COMBINING DOT ABOVE} 3: \u0041\u030A\u1E0B\u0327 = {LATIN CAPITAL LETTER A}{COMBINING RING ABOVE}{LATIN SMALL LETTER D WITH DOT ABOVE}{COMBINING CEDILLA} 4: \u0041\u030A\u1E11\u0307 = {LATIN CAPITAL LETTER A}{COMBINING RING ABOVE}{LATIN SMALL LETTER D WITH CEDILLA}{COMBINING DOT ABOVE} 5: \u00C5\u0064\u0307\u0327 = {LATIN CAPITAL LETTER A WITH RING ABOVE}{LATIN SMALL LETTER D}{COMBINING DOT ABOVE}{COMBINING CEDILLA} 6: \u00C5\u0064\u0327\u0307 = {LATIN CAPITAL LETTER A WITH RING ABOVE}{LATIN SMALL LETTER D}{COMBINING CEDILLA}{COMBINING DOT ABOVE} 7: \u00C5\u1E0B\u0327 = {LATIN CAPITAL LETTER A WITH RING ABOVE}{LATIN SMALL LETTER D WITH DOT ABOVE}{COMBINING CEDILLA} 8: \u00C5\u1E11\u0307 = {LATIN CAPITAL LETTER A WITH RING ABOVE}{LATIN SMALL LETTER D WITH CEDILLA}{COMBINING DOT ABOVE} 9: \u212B\u0064\u0307\u0327 = {ANGSTROM SIGN}{LATIN SMALL LETTER D}{COMBINING DOT ABOVE}{COMBINING CEDILLA} 10: \u212B\u0064\u0327\u0307 = {ANGSTROM SIGN}{LATIN SMALL LETTER D}{COMBINING CEDILLA}{COMBINING DOT ABOVE} 11: \u212B\u1E0B\u0327 = {ANGSTROM SIGN}{LATIN SMALL LETTER D WITH DOT ABOVE}{COMBINING CEDILLA} 12: \u212B\u1E11\u0307 = {ANGSTROM SIGN}{LATIN SMALL LETTER D WITH CEDILLA}{COMBINING DOT ABOVE}
Note: the code is intended for use with small strings, and is not suitable for larger ones, since it has not been optimized for that situation. Note, CanonicalIterator is not intended to be subclassed.

Author:
M. Davis
C++ port by V. Weinstein
Stable:
ICU 2.4
Stable:
ICU 59
Stable:
ICU 59
Stable:
ICU 59

Supports replacements, insertions, deletions in linear progression. Does not support moving/reordering of text.

There are two types of edits: change edits and no-change edits. Add edits to instances of this class using addReplace(int32_t, int32_t) (for change edits) and addUnchanged(int32_t) (for no-change edits). Change edits are retained with full granularity, whereas adjacent no-change edits are always merged together. In no-change edits, there is a one-to-one mapping between code points in the source and destination strings.

After all edits have been added, instances of this class should be considered immutable, and an Edits::Iterator can be used for queries.

There are four flavors of Edits::Iterator:

For example, consider the string "abcßDeF", which case-folds to "abcssdef". This string has the following fine edits:

and the following coarse edits (note how adjacent change edits get merged together):

The "fine changes" and "coarse changes" iterators will step through only the change edits when their `Edits::Iterator::next()` methods are called. They are identical to the non-change iterators when their `Edits::Iterator::findSourceIndex()` or `Edits::Iterator::findDestinationIndex()` methods are used to walk through the string.

For examples of how to use this class, see the test `TestCaseMapEditsIteratorDocs` in UCharacterCaseTest.java.

An Edits object tracks a separate UErrorCode, but ICU string transformation functions (e.g., case mapping functions) merge any such errors into their API's UErrorCode.

Stable:
ICU 59

Minimal subset of MessageFormat; fast, simple, minimal dependencies. Supports only numbered arguments with no type nor style parameters, and formats only string values. Quoting via ASCII apostrophe compatible with ICU MessageFormat default behavior.

Factory methods set error codes for syntax errors and for too few or too many arguments/placeholders.

SimpleFormatter objects are thread-safe except for assignment and applying new patterns.

Example:

 UErrorCode errorCode = U_ZERO_ERROR;
 SimpleFormatter fmt("{1} '{born}' in {0}", errorCode);
 UnicodeString result;
 // Output: "paul {born} in england"
 fmt.format("england", "paul", result, errorCode);
 

This class is not intended for public subclassing.

See also:
MessageFormat
UMessagePatternApostropheMode
Stable:
ICU 57

Objects of this class represent character classes used in regular expressions. A character specifies a subset of Unicode code points. Legal code points are U+0000 to U+10FFFF, inclusive.

The UnicodeSet class is not designed to be subclassed.

UnicodeSet supports two APIs. The first is the operand API that allows the caller to modify the value of a UnicodeSet object. It conforms to Java 2's java.util.Set interface, although UnicodeSet does not actually implement that interface. All methods of Set are supported, with the modification that they take a character range or single character instead of an Object, and they take a UnicodeSet instead of a Collection. The operand API may be thought of in terms of boolean logic: a boolean OR is implemented by add, a boolean AND is implemented by retain, a boolean XOR is implemented by complement taking an argument, and a boolean NOT is implemented by complement with no argument. In terms of traditional set theory function names, add is a union, retain is an intersection, remove is an asymmetric difference, and complement with no argument is a set complement with respect to the superset range MIN_VALUE-MAX_VALUE

The second API is the applyPattern()/toPattern() API from the java.text.Format-derived classes. Unlike the methods that add characters, add categories, and control the logic of the set, the method applyPattern() sets all attributes of a UnicodeSet at once, based on a string pattern.

Pattern syntax

Patterns are accepted by the constructors and the applyPattern() methods and returned by the toPattern() method. These patterns follow a syntax similar to that employed by version 8 regular expression character classes. Here are some simple examples:

[] No characters
[a] The character 'a'
[ae] The characters 'a' and 'e'
[a-e] The characters 'a' through 'e' inclusive, in Unicode code point order
[\u4E01] The character U+4E01
[a{ab}{ac}] The character 'a' and the multicharacter strings "ab" and "ac"
[\p{Lu}] All characters in the general category Uppercase Letter

Any character may be preceded by a backslash in order to remove any special meaning. White space characters, as defined by UCharacter.isWhitespace(), are ignored, unless they are escaped.

Property patterns specify a set of characters having a certain property as defined by the Unicode standard. Both the POSIX-like "[:Lu:]" and the Perl-like syntax "\\p{Lu}" are recognized. For a complete list of supported property patterns, see the User's Guide for UnicodeSet at https://unicode-org.github.io/icu/userguide/strings/unicodeset. Actual determination of property data is defined by the underlying Unicode database as implemented by UCharacter.

Patterns specify individual characters, ranges of characters, and Unicode property sets. When elements are concatenated, they specify their union. To complement a set, place a '^' immediately after the opening '['. Property patterns are inverted by modifying their delimiters; "[:^foo]" and "\\P{foo}". In any other location, '^' has no special meaning.

Since ICU 70, "[^...]", "[:^foo]", "\\P{foo}", and "[:binaryProperty=No:]" perform a “code point complement” (all code points minus the original set), removing all multicharacter strings, equivalent to .complement().removeAllStrings(). The complement() API function continues to perform a symmetric difference with all code points and thus retains all multicharacter strings.

Ranges are indicated by placing two a '-' between two characters, as in "a-z". This specifies the range of all characters from the left to the right, in Unicode order. If the left character is greater than or equal to the right character it is a syntax error. If a '-' occurs as the first character after the opening '[' or '[^', or if it occurs as the last character before the closing ']', then it is taken as a literal. Thus "[a\-b]", "[-ab]", and "[ab-]" all indicate the same set of three characters, 'a', 'b', and '-'.

Sets may be intersected using the '&' operator or the asymmetric set difference may be taken using the '-' operator, for example, "[[:L:]&[\\u0000-\\u0FFF]]" indicates the set of all Unicode letters with values less than 4096. Operators ('&' and '|') have equal precedence and bind left-to-right. Thus "[[:L:]-[a-z]-[\\u0100-\\u01FF]]" is equivalent to "[[[:L:]-[a-z]]-[\\u0100-\\u01FF]]". This only really matters for difference; intersection is commutative.

[a]The set containing 'a'
[a-z]The set containing 'a' through 'z' and all letters in between, in Unicode order
[^a-z]The set containing all characters but 'a' through 'z', that is, U+0000 through 'a'-1 and 'z'+1 through U+10FFFF
[[pat1][pat2]] The union of sets specified by pat1 and pat2
[[pat1]&[pat2]] The intersection of sets specified by pat1 and pat2
[[pat1]-[pat2]] The asymmetric difference of sets specified by pat1 and pat2
[:Lu:] or \p{Lu} The set of characters having the specified Unicode property; in this case, Unicode uppercase letters
[:^Lu:] or \P{Lu} The set of characters not having the given Unicode property

Formal syntax

pattern :=  ('[' '^'? item* ']') | property
item :=  char | (char '-' char) | pattern-expr
pattern-expr :=  pattern | pattern-expr pattern | pattern-expr op pattern
op :=  '&' | '-'
special :=  '[' | ']' | '-'
char :=  any character that is not special
| ('\'
any character)
| ('\u' hex hex hex hex)
hex :=  '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' |
    'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f'
property :=  a Unicode property set pattern


Legend:
a := b   a may be replaced by b
a? zero or one instance of a
a* one or more instances of a
a | b either a or b
'a' the literal string between the quotes

Note:

Author:
Alan Liu
Stable:
ICU 2.0

It iterates over either code points or code point ranges. After all code points or ranges have been returned, it returns the multicharacter strings of the UnicodeSet, if any.

This class is not intended for public subclassing.

To iterate over code points and strings, use a loop like this:

 UnicodeSetIterator it(set);
 while (it.next()) {
     processItem(it.getString());
 }
 

Each item in the set is accessed as a string. Set elements consisting of single code points are returned as strings containing just the one code point.

To iterate over code point ranges, instead of individual code points, use a loop like this:

 UnicodeSetIterator it(set);
 while (it.nextRange()) {
   if (it.isString()) {
     processString(it.getString());
   } else {
     processCodepointRange(it.getCodepoint(), it.getCodepointEnd());
   }
 }
 

To iterate over only the strings, start with skipToStrings().

Author:
M. Davis
Stable:
ICU 2.4

Use the iterator to return the ordering priority of the positioned character. The ordering priority of a character, which we refer to as a key, defines how a character is collated in the given collation object. For example, consider the following in Slovak and in traditional Spanish collation:

        "ca" -> the first key is key('c') and second key is key('a').
        "cha" -> the first key is key('ch') and second key is key('a').

And in German phonebook collation,

  "æb"-> the first key is key('a'), the second key is key('e'), and
        the third key is key('b').  

The key of a character, is an integer composed of primary order(short), secondary order(char), and tertiary order(char). Java strictly defines the size and signedness of its primitive data types. Therefore, the static functions primaryOrder(), secondaryOrder(), and tertiaryOrder() return int32_t to ensure the correctness of the key value.

Example of the iterator usage: (without error checking)

 
   void CollationElementIterator_Example()
   {
       UnicodeString str = "This is a test";
       UErrorCode success = U_ZERO_ERROR;
       RuleBasedCollator* rbc =
           (RuleBasedCollator*) RuleBasedCollator::createInstance(success);
       CollationElementIterator* c =
           rbc->createCollationElementIterator( str );
       int32_t order = c->next(success);
       c->reset();
       order = c->previous(success);
       delete c;
       delete rbc;
   }

The method next() returns the collation order of the next character based on the comparison level of the collator. The method previous() returns the collation order of the previous character based on the comparison level of the collator. The Collation Element Iterator moves only in one direction between calls to reset(), setOffset(), or setText(). That is, next() and previous() can not be inter-used. Whenever previous() is to be called after next() or vice versa, reset(), setOffset() or setText() has to be called first to reset the status, shifting pointers to either the end or the start of the string (reset() or setText()), or the specified position (setOffset()). Hence at the next call of next() or previous(), the first or last collation order, or collation order at the specified position will be returned. If a change of direction is done without one of these calls, the result is undefined.

The result of a forward iterate (next()) and reversed result of the backward iterate (previous()) on the same string are equivalent, if collation orders with the value 0 are ignored. Character based on the comparison level of the collator. A collation order consists of primary order, secondary order and tertiary order. The data type of the collation order is int32_t.

Note, CollationElementIterator should not be subclassed.

See also:
Collator
RuleBasedCollator
Version:
1.8 Jan 16 2001

DateFormatSymbols is used by DateFormat and SimpleDateFormat.

Rather than first creating a DateFormatSymbols to get a date-time formatter by using a SimpleDateFormat constructor, clients are encouraged to create a date-time formatter using the getTimeInstance(), getDateInstance(), or getDateTimeInstance() method in DateFormat. Each of these methods can return a date/time formatter initialized with a default format pattern along with the date-time formatting data for a given or default locale. After a formatter is created, clients may modify the format pattern using the setPattern function as so desired. For more information on using these formatter factory functions, see DateFormat.

If clients decide to create a date-time formatter with a particular format pattern and locale, they can do so with new SimpleDateFormat(aPattern, new DateFormatSymbols(aLocale)). This will load the appropriate date-time formatting data from the locale.

DateFormatSymbols objects are clonable. When clients obtain a DateFormatSymbols object, they can feel free to modify the date-time formatting data as necessary. For instance, clients can replace the localized date-time format pattern characters with the ones that they feel easy to remember. Or they can change the representative cities originally picked by default to using their favorite ones.

DateFormatSymbols are not expected to be subclassed. Data for a calendar is loaded out of resource bundles. The 'type' parameter indicates the type of calendar, for example, "gregorian" or "japanese". If the type is not gregorian (or nullptr, or an empty string) then the type is appended to the resource name, for example, 'Eras_japanese' instead of 'Eras'. If the resource 'Eras_japanese' did not exist (even in root), then this class will fall back to just 'Eras', that is, Gregorian data. Therefore, the calendar implementor MUST ensure that the root locale at least contains any resources that are to be particularized for the calendar type.

It is used by DateIntervalFormat.

For most users, ordinary use of DateIntervalFormat does not need to create DateIntervalInfo object directly. DateIntervalFormat will take care of it when creating a date interval formatter when user pass in skeleton and locale.

For power users, who want to create their own date interval patterns, or want to re-set date interval patterns, they could do so by directly creating DateIntervalInfo and manipulating it.

Logically, the interval patterns are mappings from (skeleton, the_largest_different_calendar_field) to (date_interval_pattern).

A skeleton

  1. only keeps the field pattern letter and ignores all other parts in a pattern, such as space, punctuations, and string literals.
  2. hides the order of fields.
  3. might hide a field's pattern letter length.

    For those non-digit calendar fields, the pattern letter length is important, such as MMM, MMMM, and MMMMM; EEE and EEEE, and the field's pattern letter length is honored.

    For the digit calendar fields, such as M or MM, d or dd, yy or yyyy, the field pattern length is ignored and the best match, which is defined in date time patterns, will be returned without honor the field pattern letter length in skeleton.

The calendar fields we support for interval formatting are: year, month, date, day-of-week, am-pm, hour, hour-of-day, and minute. Those calendar fields can be defined in the following order: year > month > date > am-pm > hour > minute

The largest different calendar fields between 2 calendars is the first different calendar field in above order.

For example: the largest different calendar fields between "Jan 10, 2007" and "Feb 20, 2008" is year.

There is a set of pre-defined static skeleton strings. There are pre-defined interval patterns for those pre-defined skeletons in locales' resource files. For example, for a skeleton UDAT_YEAR_ABBR_MONTH_DAY, which is "yMMMd", in en_US, if the largest different calendar field between date1 and date2 is "year", the date interval pattern is "MMM d, yyyy - MMM d, yyyy", such as "Jan 10, 2007 - Jan 10, 2008". If the largest different calendar field between date1 and date2 is "month", the date interval pattern is "MMM d - MMM d, yyyy", such as "Jan 10 - Feb 10, 2007". If the largest different calendar field between date1 and date2 is "day", the date interval pattern is "MMM d-d, yyyy", such as "Jan 10-20, 2007".

For date skeleton, the interval patterns when year, or month, or date is different are defined in resource files. For time skeleton, the interval patterns when am/pm, or hour, or minute is different are defined in resource files.

There are 2 dates in interval pattern. For most locales, the first date in an interval pattern is the earlier date. There might be a locale in which the first date in an interval pattern is the later date. We use fallback format for the default order for the locale. For example, if the fallback format is "{0} - {1}", it means the first date in the interval pattern for this locale is earlier date. If the fallback format is "{1} - {0}", it means the first date is the later date. For a particular interval pattern, the default order can be overridden by prefixing "latestFirst:" or "earliestFirst:" to the interval pattern. For example, if the fallback format is "{0}-{1}", but for skeleton "yMMMd", the interval pattern when day is different is "latestFirst:d-d MMM yy", it means by default, the first date in interval pattern is the earlier date. But for skeleton "yMMMd", when day is different, the first date in "d-d MMM yy" is the later date.

The recommended way to create a DateIntervalFormat object is to pass in the locale. By using a Locale parameter, the DateIntervalFormat object is initialized with the pre-defined interval patterns for a given or default locale.

Users can also create DateIntervalFormat object by supplying their own interval patterns. It provides flexibility for power users.

After a DateIntervalInfo object is created, clients may modify the interval patterns using setIntervalPattern function as so desired. Currently, users can only set interval patterns when the following calendar fields are different: ERA, YEAR, MONTH, DATE, DAY_OF_MONTH, DAY_OF_WEEK, AM_PM, HOUR, HOUR_OF_DAY, MINUTE, SECOND, and MILLISECOND. Interval patterns when other calendar fields are different is not supported.

DateIntervalInfo objects are cloneable. When clients obtain a DateIntervalInfo object, they can feel free to modify it as necessary.

DateIntervalInfo are not expected to be subclassed. Data for a calendar is loaded out of resource bundles. Through ICU 4.4, date interval patterns are only supported in the Gregorian calendar; non-Gregorian calendars are supported from ICU 4.4.1.

Stable:
ICU 4.0

It includes factory methods for creating a RegexPattern object from the source (string) form of a regular expression, methods for creating RegexMatchers that allow the pattern to be applied to input text, and a few convenience methods for simple common uses of regular expressions.

Class RegexPattern is not intended to be subclassed.

Stable:
ICU 2.4

It includes methods for testing for matches, and for find and replace operations.

Class RegexMatcher is not intended to be subclassed.

Stable:
ICU 2.4

StringSearch ensures that language eccentricity can be handled, e.g. for the German collator, characters ß and SS will be matched if case is chosen to be ignored. See the "ICU Collation Design Document" for more information.

There are 2 match options for selection:
Let S' be the sub-string of a text string S between the offsets start and end [start, end].
A pattern string P matches a text string S at the offsets [start, end] if

 
 option 1. Some canonical equivalent of P matches some canonical equivalent
           of S'
 option 2. P matches S' and if P starts or ends with a combining mark,
           there exists no non-ignorable combining mark before or after S?
           in S respectively.
 

Option 2. will be the default.

This search has APIs similar to that of other text iteration mechanisms such as the break iterators in BreakIterator. Using these APIs, it is easy to scan through text looking for all occurrences of a given pattern. This search iterator allows changing of direction by calling a reset followed by a next or previous. Though a direction change can occur without calling reset first, this operation comes with some speed penalty. Match results in the forward direction will match the result matches in the backwards direction in the reverse order

SearchIterator provides APIs to specify the starting position within the text string to be searched, e.g. setOffset, preceding and following. Since the starting position will be set as it is specified, please take note that there are some danger points which the search may render incorrect results:

A BreakIterator can be used if only matches at logical breaks are desired. Using a BreakIterator will only give you results that exactly matches the boundaries given by the breakiterator. For instance the pattern "e" will not be found in the string "\u00e9" if a character break iterator is used.

Options are provided to handle overlapping matches. E.g. In English, overlapping matches produces the result 0 and 2 for the pattern "abab" in the text "ababab", where else mutually exclusive matches only produce the result of 0.

Though collator attributes will be taken into consideration while performing matches, there are no APIs here for setting and getting the attributes. These attributes can be set by getting the collator from getCollator and using the APIs in coll.h. Lastly to update StringSearch to the new collator attributes, reset has to be called.

Restriction:
Currently there are no composite characters that consists of a character with combining class > 0 before a character with combining class == 0. However, if such a character exists in the future, StringSearch does not guarantee the results for option 1.

Consult the SearchIterator documentation for information on and examples of how to use instances of this class to implement text searching.


 UnicodeString target("The quick brown fox jumps over the lazy dog.");
 UnicodeString pattern("fox");
 UErrorCode      error = U_ZERO_ERROR;
 StringSearch iter(pattern, target, Locale::getUS(), nullptr, status);
 for (int pos = iter.first(error);
      pos != USEARCH_DONE; 
      pos = iter.next(error))
 {
     printf("Found match at %d pos, length is %d\n", pos, iter.getMatchedLength());
 }
 

Note, StringSearch is not to be subclassed.

See also:
SearchIterator
RuleBasedCollator
Since:
ICU 2.0

The user can create a customized table-based collation.

For more information about the collation service see the User Guide.

Collation service provides correct sorting orders for most locales supported in ICU. If specific data for a locale is not available, the orders eventually falls back to the CLDR root sort order.

Sort ordering may be customized by providing your own set of rules. For more on this subject see the Collation Customization section of the User Guide.

Note, RuleBasedCollator is not to be subclassed.

See also:
Collator

Definition at line 76 of file caniter.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
NULLORDER 

NULLORDER indicates that an error has occurred while processing.

Stable:
ICU 2.0

Definition at line 126 of file coleitr.h.

anonymous enum

Max index for stored interval patterns.

Internal:
Do not use.

This API is for internal use only. ICU 4.4

Definition at line 372 of file dtitvinf.h.

anonymous enum
Enumerator:
MIN_VALUE 

Minimum value that can be stored in a UnicodeSet.

Stable:
ICU 2.4
MAX_VALUE 

Maximum value that can be stored in a UnicodeSet.

Stable:
ICU 2.4

Definition at line 358 of file uniset.h.

Selector for date formatting context.

Stable:
ICU 3.6
Enumerator:
DT_CONTEXT_COUNT 

One more than the highest normal DtContextType value.

Deprecated:
ICU 58 The numeric value may change over time, see ICU ticket #12420.

Definition at line 277 of file dtfmtsym.h.

Selector for date formatting width.

Stable:
ICU 3.6
Enumerator:
SHORT 

Short width is currently only supported for weekday names.

Stable:
ICU 51
DT_WIDTH_COUNT 

One more than the highest normal DtWidthType value.

Deprecated:
ICU 58 The numeric value may change over time, see ICU ticket #12420.

Definition at line 293 of file dtfmtsym.h.

Constants for capitalization context usage types.

Internal:
Do not use. This API is for internal use only.

Definition at line 605 of file dtfmtsym.h.

Somewhat temporary constants for leap month pattern types, adequate for supporting just leap month patterns as needed for Chinese lunar calendar.

Eventually we will add full support for different month pattern types (needed for other calendars such as Hindu) at which point this approach will be replaced by a more complete approach.

Internal:
Do not use. This API is for internal use only.

Definition at line 513 of file dtfmtsym.h.

Internal:
Do not use.

This API is for internal use only.

Definition at line 398 of file uniset.h.


Constructor & Destructor Documentation

virtual icu::final::~CanonicalIterator ( ) [virtual]

Destructor Cleans pieces.

Stable:
ICU 2.4
icu::final::~Char16Ptr ( ) [inline]

Destructor.

Stable:
ICU 59

Destructor.

Stable:
ICU 59

Destructor.

Stable:
ICU 59

Destructor.

Stable:
ICU 57
virtual icu::final::~UnicodeSet ( ) [virtual]

Destructs the set.

Stable:
ICU 2.0
virtual icu::final::~UnicodeSetIterator ( ) [virtual]

Destructor.

Stable:
ICU 2.4

Destructor.

Stable:
ICU 2.0
virtual icu::final::~DateFormatSymbols ( ) [virtual]

Destructor.

This is nonvirtual because this class is not designed to be subclassed.

Stable:
ICU 2.0
virtual icu::final::~DateIntervalInfo ( ) [virtual]

Destructor.

It is virtual to be safe, but it is not designed to be subclassed.

Stable:
ICU 4.0
virtual icu::final::~RegexPattern ( ) [virtual]

Destructor.

Note that a RegexPattern object must persist so long as any RegexMatcher objects that were created from the RegexPattern are active.

Stable:
ICU 2.4
virtual icu::final::~RegexMatcher ( ) [virtual]

Destructor.

Stable:
ICU 2.4
virtual icu::final::~StringSearch ( void  ) [virtual]

Destructor.

Cleans up the search iterator data struct. If a collator is created in the constructor, it will be destroyed here.

Stable:
ICU 2.0
virtual icu::final::~RuleBasedCollator ( ) [virtual]

Destructor.

Stable:
ICU 2.0

Member Function Documentation

virtual UnicodeSet& icu::final::add ( UChar32  start,
UChar32  end 
) [virtual]

Adds the specified range to this set if it is not already present.

If this set already contains the specified range, the call leaves this set unchanged. If start > end then an empty range is added, leaving the set unchanged. This is equivalent to a boolean logic OR, or a set UNION. A frozen set will not be modified.

Parameters:
startfirst character, inclusive, of range to be added to this set.
endlast character, inclusive, of range to be added to this set.
Stable:
ICU 2.0

Adds the specified character to this set if it is not already present.

If this set already contains the specified character, the call leaves this set unchanged. A frozen set will not be modified.

Parameters:
cthe character (code point)
Returns:
this object, for chaining
Stable:
ICU 2.0

Adds the specified multicharacter to this set if it is not already present.

If this set already contains the multicharacter, the call leaves this set unchanged. Thus "ch" => {"ch"} A frozen set will not be modified.

Parameters:
sthe source string
Returns:
this object, for chaining
Stable:
ICU 2.4

Adds each of the characters in this string to the set.

Note: "ch" => {"c", "h"} If this set already contains any particular character, it has no effect on that character. A frozen set will not be modified.

Parameters:
sthe source string
Returns:
this object, for chaining
Stable:
ICU 2.4
virtual UnicodeSet& icu::final::addAll ( const UnicodeSet c) [virtual]

Adds all of the elements in the specified set to this set if they're not already present.

This operation effectively modifies this set so that its value is the union of the two sets. The behavior of this operation is unspecified if the specified collection is modified while the operation is in progress. A frozen set will not be modified.

Parameters:
cset whose elements are to be added to this set.
See also:
add(UChar32, UChar32)
Stable:
ICU 2.0
virtual void icu::final::addMatchSetTo ( UnicodeSet toUnionTo) const [override, virtual]

Implementation of UnicodeMatcher API.

Union the set of all characters that may be matched by this object into the given set.

Parameters:
toUnionTothe set into which to union the source characters
Stable:
ICU 2.4

Implements icu::UnicodeMatcher.

void icu::final::addReplace ( int32_t  oldLength,
int32_t  newLength 
)

Adds a change edit: a record for a text replacement/insertion/deletion.

Normally called from inside ICU string transformation functions, not user code.

Stable:
ICU 59
void icu::final::addUnchanged ( int32_t  unchangedLength)

Adds a no-change edit: a record for an unchanged segment of text.

Normally called from inside ICU string transformation functions, not user code.

Stable:
ICU 59
virtual RegexMatcher& icu::final::appendReplacement ( UnicodeString dest,
const UnicodeString replacement,
UErrorCode status 
) [virtual]

Implements a replace operation intended to be used as part of an incremental find-and-replace.

The input string, starting from the end of the previous replacement and ending at the start of the current match, is appended to the destination string. Then the replacement string is appended to the output string, including handling any substitutions of captured text.

For simple, prepackaged, non-incremental find-and-replace operations, see replaceFirst() or replaceAll().

Parameters:
destA UnicodeString to which the results of the find-and-replace are appended.
replacementA UnicodeString that provides the text to be substituted for the input text that matched the regexp pattern. The replacement text may contain references to captured text from the input.
statusA reference to a UErrorCode to receive any errors. Possible errors are U_REGEX_INVALID_STATE if no match has been attempted or the last match failed, and U_INDEX_OUTOFBOUNDS_ERROR if the replacement text specifies a capture group that does not exist in the pattern.
Returns:
this RegexMatcher
Stable:
ICU 2.4
virtual RegexMatcher& icu::final::appendReplacement ( UText dest,
UText replacement,
UErrorCode status 
) [virtual]

Implements a replace operation intended to be used as part of an incremental find-and-replace.

The input string, starting from the end of the previous replacement and ending at the start of the current match, is appended to the destination string. Then the replacement string is appended to the output string, including handling any substitutions of captured text.

For simple, prepackaged, non-incremental find-and-replace operations, see replaceFirst() or replaceAll().

Parameters:
destA mutable UText to which the results of the find-and-replace are appended. Must not be nullptr.
replacementA UText that provides the text to be substituted for the input text that matched the regexp pattern. The replacement text may contain references to captured text from the input.
statusA reference to a UErrorCode to receive any errors. Possible errors are U_REGEX_INVALID_STATE if no match has been attempted or the last match failed, and U_INDEX_OUTOFBOUNDS_ERROR if the replacement text specifies a capture group that does not exist in the pattern.
Returns:
this RegexMatcher
Stable:
ICU 4.6
virtual UnicodeString& icu::final::appendTail ( UnicodeString dest) [virtual]

As the final step in a find-and-replace operation, append the remainder of the input string, starting at the position following the last appendReplacement(), to the destination string.

`appendTail()` is intended to be invoked after one or more invocations of the `RegexMatcher::appendReplacement()`.

Parameters:
destA UnicodeString to which the results of the find-and-replace are appended.
Returns:
the destination string.
Stable:
ICU 2.4
virtual UText* icu::final::appendTail ( UText dest,
UErrorCode status 
) [virtual]

As the final step in a find-and-replace operation, append the remainder of the input string, starting at the position following the last appendReplacement(), to the destination string.

`appendTail()` is intended to be invoked after one or more invocations of the `RegexMatcher::appendReplacement()`.

Parameters:
destA mutable UText to which the results of the find-and-replace are appended. Must not be nullptr.
statuserror cod
Returns:
the destination string.
Stable:
ICU 4.6
UnicodeSet& icu::final::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 enumerated property, as returned by u_getIntPropertyValue.

Prior contents of this set are lost. A frozen set will not be modified.

Parameters:
propa property in the range UCHAR_BIN_START..UCHAR_BIN_LIMIT-1 or UCHAR_INT_START..UCHAR_INT_LIMIT-1 or UCHAR_MASK_START..UCHAR_MASK_LIMIT-1.
valuea value in the range u_getIntPropertyMinValue(prop).. u_getIntPropertyMaxValue(prop), with one exception. If prop is UCHAR_GENERAL_CATEGORY_MASK, then value should not be a UCharCategory, but rather a mask value produced by U_GET_GC_MASK(). This allows grouped categories such as [:L:] to be represented.
ecerror code input/output parameter
Returns:
a reference to this set
Stable:
ICU 2.4
UBool icu::final::applyPattern ( const UnicodeString pattern,
UErrorCode errorCode 
) [inline]

Changes this object according to the new pattern.

Parameters:
patternThe pattern string.
errorCodeICU error code in/out parameter. Must fulfill U_SUCCESS before the function call. Set to U_ILLEGAL_ARGUMENT_ERROR for bad argument syntax.
Returns:
true if U_SUCCESS(errorCode).
Stable:
ICU 57

Definition at line 131 of file simpleformatter.h.

References INT32_MAX.

UnicodeSet& icu::final::applyPattern ( const UnicodeString pattern,
UErrorCode status 
)

Modifies this set to represent the set specified by the given pattern, ignoring Unicode Pattern_White_Space characters.

See the class description for the syntax of the pattern language. A frozen set will not be modified.

Parameters:
patterna string specifying what characters are in the set
statusreturns U_ILLEGAL_ARGUMENT_ERROR if the pattern contains a syntax error. Empties the set passed before applying the pattern.
Returns:
a reference to this
Stable:
ICU 2.0
UnicodeSet& icu::final::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 Pattern_White_Space characters.

See the class description for the syntax of the pattern language. A frozen set will not be modified.

Parameters:
patterna string specifying what characters are in the set
optionsbitmask for options to apply to the pattern. Valid options are USET_IGNORE_SPACE and at most one of USET_CASE_INSENSITIVE, USET_ADD_CASE_MAPPINGS, USET_SIMPLE_CASE_INSENSITIVE. These case options are mutually exclusive.
symbolsa symbol table mapping variable names to values and stand-ins to UnicodeSets; may be nullptr
statusreturns U_ILLEGAL_ARGUMENT_ERROR if the pattern contains a syntax error. Empties the set passed before applying the pattern.
Returns:
a reference to this
Internal:
Do not use. This API is for internal use only.
UnicodeSet& icu::final::applyPattern ( const UnicodeString pattern,
ParsePosition pos,
uint32_t  options,
const SymbolTable symbols,
UErrorCode status 
)

Parses the given pattern, starting at the given position.

The character at pattern.charAt(pos.getIndex()) must be '[', or the parse fails. Parsing continues until the corresponding closing ']'. If a syntax error is encountered between the opening and closing brace, the parse fails. Upon return from a successful parse, the ParsePosition is updated to point to the character following the closing ']', and a StringBuffer containing a pairs list for the parsed pattern is returned. This method calls itself recursively to parse embedded subpatterns. Empties the set passed before applying the pattern. A frozen set will not be modified.

Parameters:
patternthe string containing the pattern to be parsed. The portion of the string from pos.getIndex(), which must be a '[', to the corresponding closing ']', is parsed.
posupon entry, the position at which to being parsing. The character at pattern.charAt(pos.getIndex()) must be a '['. Upon return from a successful parse, pos.getIndex() is either the character after the closing ']' of the parsed pattern, or pattern.length() if the closing ']' is the last character of the pattern string.
optionsbitmask for options to apply to the pattern. Valid options are USET_IGNORE_SPACE and at most one of USET_CASE_INSENSITIVE, USET_ADD_CASE_MAPPINGS, USET_SIMPLE_CASE_INSENSITIVE. These case options are mutually exclusive.
symbolsa symbol table mapping variable names to values and stand-ins to UnicodeSets; may be nullptr
statusreturns U_ILLEGAL_ARGUMENT_ERROR if the pattern contains a syntax error.
Returns:
a reference to this
Stable:
ICU 2.8
UBool icu::final::applyPatternMinMaxArguments ( const UnicodeString pattern,
int32_t  min,
int32_t  max,
UErrorCode errorCode 
)

Changes this object according to the new pattern.

The number of arguments checked against the given limits is the highest argument number plus one, not the number of occurrences of arguments.

Parameters:
patternThe pattern string.
minThe pattern must have at least this many arguments.
maxThe pattern must have at most this many arguments.
errorCodeICU error code in/out parameter. Must fulfill U_SUCCESS before the function call. Set to U_ILLEGAL_ARGUMENT_ERROR for bad argument syntax and too few or too many arguments.
Returns:
true if U_SUCCESS(errorCode).
Stable:
ICU 57
UnicodeSet& icu::final::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.

Prior contents of this set are lost. A frozen set will not be modified.

Parameters:
propa property alias, either short or long. The name is matched loosely. See PropertyAliases.txt for names and a description of loose matching. If the value string is empty, then this string is interpreted as either a General_Category value alias, a Script value alias, a binary property alias, or a special ID. Special IDs are matched loosely and correspond to the following sets:

"ANY" = [\u0000-\U0010FFFF], "ASCII" = [\u0000-\u007F], "Assigned" = [:^Cn:].

Parameters:
valuea value alias, either short or long. The name is matched loosely. See PropertyValueAliases.txt for names and a description of loose matching. In addition to aliases listed, numeric values and canonical combining classes may be expressed numerically, e.g., ("nv", "0.5") or ("ccc", "220"). The value string may also be empty.
ecerror code input/output parameter
Returns:
a reference to this set
Stable:
ICU 2.4
icu::final::CanonicalIterator ( const UnicodeString source,
UErrorCode status 
)

Construct a CanonicalIterator object.

Parameters:
sourcestring to get results for
statusFill-in parameter which receives the status of this operation.
Stable:
ICU 2.4
icu::final::Char16Ptr ( char16_t *  p) [inline]

Copies the pointer.

Parameters:
ppointer
Stable:
ICU 59
icu::final::Char16Ptr ( uint16_t *  p) [inline]

Converts the pointer to char16_t *.

Parameters:
ppointer to be converted
Stable:
ICU 59
icu::final::Char16Ptr ( wchar_t *  p) [inline]

Converts the pointer to char16_t *.

(Only defined if U_SIZEOF_WCHAR_T==2.)

Parameters:
ppointer to be converted
Stable:
ICU 59
icu::final::Char16Ptr ( std::nullptr_t  p) [inline]

nullptr constructor.

Parameters:
pnullptr
Stable:
ICU 59
UChar32 icu::final::charAt ( int32_t  index) const

Returns the character at the given index within this set, where the set is ordered by ascending code point.

If the index is out of range for characters, returns (UChar32)-1. The inverse of this method is indexOf().

For iteration, this is slower than UnicodeSetIterator or getRangeCount()/getRangeStart()/getRangeEnd(), because for each call it skips linearly over index characters in the ranges.

Parameters:
indexan index from 0..size()-1
Returns:
the character at the given index, or (UChar32)-1.
Stable:
ICU 2.4
virtual UnicodeSet& icu::final::clear ( void  ) [virtual]

Removes all of the elements from this set.

This set will be empty after this call returns. A frozen set will not be modified.

Stable:
ICU 2.0
virtual RegexPattern* icu::final::clone ( ) const [virtual]

Create an exact copy of this RegexPattern object.

Since RegexPattern is not intended to be subclassed, clone() and the copy construction are equivalent operations.

Returns:
the copy of this RegexPattern
Stable:
ICU 2.4

Implements icu::UnicodeFilter.

virtual DateIntervalInfo* icu::final::clone ( ) const [virtual]

Clone this object polymorphically.

The caller owns the result and should delete it when done.

Returns:
a copy of the object
Stable:
ICU 4.0

Implements icu::UnicodeFilter.

virtual RuleBasedCollator* icu::final::clone ( ) const [override, virtual]

Makes a copy of this object.

Returns:
a copy of this object, owned by the caller
Stable:
ICU 2.0

Implements icu::UnicodeFilter.

StringSearch* icu::final::clone ( ) const [virtual]

Clone this object.

Clones can be used concurrently in multiple threads. If an error occurs, then nullptr is returned. The caller must delete the clone.

Returns:
a clone of this object
See also:
getDynamicClassID
Stable:
ICU 2.8

Implements icu::UnicodeFilter.

virtual UnicodeSet* icu::final::clone ( ) const [override, virtual]

Returns a copy of this object.

All UnicodeFunctor objects have to support cloning in order to allow classes using UnicodeFunctors, such as Transliterator, to implement cloning. If this set is frozen, then the clone will be frozen as well. Use cloneAsThawed() for a mutable clone of a frozen set.

See also:
cloneAsThawed
Stable:
ICU 2.0

Implements icu::UnicodeFilter.

Clone the set and make the clone mutable.

See the ICU4J Freezable interface for details.

Returns:
the mutable clone
See also:
freeze
isFrozen
Stable:
ICU 3.8
int32_t icu::final::cloneBinary ( uint8_t *  buffer,
int32_t  capacity,
UErrorCode status 
) const

Creates a binary image of a collator.

This binary image can be stored and later used to instantiate a collator using ucol_openBinary. This API supports preflighting.

Parameters:
buffera fill-in buffer to receive the binary image
capacitycapacity of the destination buffer
statusfor catching errors
Returns:
size of the image
See also:
ucol_openBinary
Stable:
ICU 3.4
uint8_t* icu::final::cloneRuleData ( int32_t &  length,
UErrorCode status 
) const

Do not use this method: The caller and the ICU library might use different heaps.

Use cloneBinary() instead which writes to caller-provided memory.

Returns a binary format of this collator.

Parameters:
lengthReturns the length of the data, in bytes
statusthe error code status.
Returns:
memory, owned by the caller, of size 'length' bytes.
Deprecated:
ICU 52. Use cloneBinary() instead.
UnicodeSet& icu::final::closeOver ( int32_t  attribute)

Close this set over the given attribute.

For the attribute USET_CASE_INSENSITIVE, the result is to modify this set so that:

1. For each character or string 'a' in this set, all strings or characters 'b' such that foldCase(a) == foldCase(b) are added to this set.

2. For each string 'e' in the resulting set, if e != foldCase(e), 'e' will be removed.

Example: [aq\u00DF{Bc}{bC}{Fi}] => [aAqQ\u00DF\uFB01{ss}{bc}{fi}]

(Here foldCase(x) refers to the operation u_strFoldCase, and a == b denotes that the contents are the same, not pointer comparison.)

A frozen set will not be modified.

Parameters:
attributebitmask for attributes to close over. Valid options: At most one of USET_CASE_INSENSITIVE, USET_ADD_CASE_MAPPINGS, USET_SIMPLE_CASE_INSENSITIVE. These case options are mutually exclusive. Unrelated options bits are ignored.
Returns:
a reference to this set.
Stable:
ICU 4.2
icu::final::CollationElementIterator ( const CollationElementIterator &  other)

Copy constructor.

Parameters:
otherthe object to be copied from
Stable:
ICU 2.0
virtual UnicodeSet& icu::final::compact ( ) [virtual]

Reallocate this objects internal structures to take up the least possible space, without changing this object's value.

A frozen set will not be modified.

Stable:
ICU 2.4
virtual UCollationResult icu::final::compare ( const UnicodeString source,
const UnicodeString target,
UErrorCode status 
) const [override, virtual]

The comparison function compares the character data stored in two different strings.

Returns information about whether a string is less than, greater than or equal to another string.

Parameters:
sourcethe source string to be compared with.
targetthe string that is to be compared with the source string.
statuspossible error code
Returns:
Returns an enum value. UCOL_GREATER if source is greater than target; UCOL_EQUAL if source is equal to target; UCOL_LESS if source is less than target
Stable:
ICU 2.6

Implements icu::Collator.

virtual UCollationResult icu::final::compare ( const UnicodeString source,
const UnicodeString target,
int32_t  length,
UErrorCode status 
) const [override, virtual]

Does the same thing as compare but limits the comparison to a specified length.

Parameters:
sourcethe source string to be compared with.
targetthe string that is to be compared with the source string.
lengththe length the comparison is limited to
statuspossible error code
Returns:
Returns an enum value. UCOL_GREATER if source (up to the specified length) is greater than target; UCOL_EQUAL if source (up to specified length) is equal to target; UCOL_LESS if source (up to the specified length) is less than target.
Stable:
ICU 2.6

Implements icu::Collator.

virtual UCollationResult icu::final::compare ( const char16_t *  source,
int32_t  sourceLength,
const char16_t *  target,
int32_t  targetLength,
UErrorCode status 
) const [override, virtual]

The comparison function compares the character data stored in two different string arrays.

Returns information about whether a string array is less than, greater than or equal to another string array.

Parameters:
sourcethe source string array to be compared with.
sourceLengththe length of the source string array. If this value is equal to -1, the string array is null-terminated.
targetthe string that is to be compared with the source string.
targetLengththe length of the target string array. If this value is equal to -1, the string array is null-terminated.
statuspossible error code
Returns:
Returns an enum value. UCOL_GREATER if source is greater than target; UCOL_EQUAL if source is equal to target; UCOL_LESS if source is less than target
Stable:
ICU 2.6

Implements icu::Collator.

virtual UCollationResult icu::final::compare ( UCharIterator sIter,
UCharIterator tIter,
UErrorCode status 
) const [override, virtual]

Compares two strings using the Collator.

Returns whether the first one compares less than/equal to/greater than the second one. This version takes UCharIterator input.

Parameters:
sIterthe first ("source") string iterator
tIterthe second ("target") string iterator
statusICU status
Returns:
UCOL_LESS, UCOL_EQUAL or UCOL_GREATER
Stable:
ICU 4.2

Reimplemented from icu::Collator.

virtual UCollationResult icu::final::compareUTF8 ( const StringPiece source,
const StringPiece target,
UErrorCode status 
) const [override, virtual]

Compares two UTF-8 strings using the Collator.

Returns whether the first one compares less than/equal to/greater than the second one. This version takes UTF-8 input. Note that a StringPiece can be implicitly constructed from a std::string or a NUL-terminated const char * string.

Parameters:
sourcethe first UTF-8 string
targetthe second UTF-8 string
statusICU status
Returns:
UCOL_LESS, UCOL_EQUAL or UCOL_GREATER
Stable:
ICU 51

Reimplemented from icu::Collator.

static RegexPattern* icu::final::compile ( const UnicodeString regex,
UParseError pe,
UErrorCode status 
) [static]

Compiles the regular expression in string form into a RegexPattern object.

These compile methods, rather than the constructors, are the usual way that RegexPattern objects are created.

Note that RegexPattern objects must not be deleted while RegexMatcher objects created from the pattern are active. RegexMatchers keep a pointer back to their pattern, so premature deletion of the pattern is a catastrophic error.

All URegexpFlag pattern match mode flags are set to their default values.

Note that it is often more convenient to construct a RegexMatcher directly from a pattern string rather than separately compiling the pattern and then creating a RegexMatcher object from the pattern.

Parameters:
regexThe regular expression to be compiled.
peReceives the position (line and column nubers) of any error within the regular expression.)
statusA reference to a UErrorCode to receive any errors.
Returns:
A regexPattern object for the compiled pattern.
Stable:
ICU 2.4
static RegexPattern* icu::final::compile ( UText regex,
UParseError pe,
UErrorCode status 
) [static]

Compiles the regular expression in string form into a RegexPattern object.

These compile methods, rather than the constructors, are the usual way that RegexPattern objects are created.

Note that RegexPattern objects must not be deleted while RegexMatcher objects created from the pattern are active. RegexMatchers keep a pointer back to their pattern, so premature deletion of the pattern is a catastrophic error.

All URegexpFlag pattern match mode flags are set to their default values.

Note that it is often more convenient to construct a RegexMatcher directly from a pattern string rather than separately compiling the pattern and then creating a RegexMatcher object from the pattern.

Parameters:
regexThe regular expression to be compiled. Note, the text referred to by this UText must not be deleted during the lifetime of the RegexPattern object or any RegexMatcher object created from it.
peReceives the position (line and column nubers) of any error within the regular expression.)
statusA reference to a UErrorCode to receive any errors.
Returns:
A regexPattern object for the compiled pattern.
Stable:
ICU 4.6
static RegexPattern* icu::final::compile ( const UnicodeString regex,
uint32_t  flags,
UParseError pe,
UErrorCode status 
) [static]

Compiles the regular expression in string form into a RegexPattern object using the specified URegexpFlag match mode flags.

These compile methods, rather than the constructors, are the usual way that RegexPattern objects are created.

Note that RegexPattern objects must not be deleted while RegexMatcher objects created from the pattern are active. RegexMatchers keep a pointer back to their pattern, so premature deletion of the pattern is a catastrophic error.

Note that it is often more convenient to construct a RegexMatcher directly from a pattern string instead of than separately compiling the pattern and then creating a RegexMatcher object from the pattern.

Parameters:
regexThe regular expression to be compiled.
flagsThe URegexpFlag match mode flags to be used, e.g. UREGEX_CASE_INSENSITIVE.
peReceives the position (line and column numbers) of any error within the regular expression.)
statusA reference to a UErrorCode to receive any errors.
Returns:
A regexPattern object for the compiled pattern.
Stable:
ICU 2.4
static RegexPattern* icu::final::compile ( UText regex,
uint32_t  flags,
UParseError pe,
UErrorCode status 
) [static]

Compiles the regular expression in string form into a RegexPattern object using the specified URegexpFlag match mode flags.

These compile methods, rather than the constructors, are the usual way that RegexPattern objects are created.

Note that RegexPattern objects must not be deleted while RegexMatcher objects created from the pattern are active. RegexMatchers keep a pointer back to their pattern, so premature deletion of the pattern is a catastrophic error.

Note that it is often more convenient to construct a RegexMatcher directly from a pattern string instead of than separately compiling the pattern and then creating a RegexMatcher object from the pattern.

Parameters:
regexThe regular expression to be compiled. Note, the text referred to by this UText must not be deleted during the lifetime of the RegexPattern object or any RegexMatcher object created from it.
flagsThe URegexpFlag match mode flags to be used, e.g. UREGEX_CASE_INSENSITIVE.
peReceives the position (line and column numbers) of any error within the regular expression.)
statusA reference to a UErrorCode to receive any errors.
Returns:
A regexPattern object for the compiled pattern.
Stable:
ICU 4.6
static RegexPattern* icu::final::compile ( const UnicodeString regex,
uint32_t  flags,
UErrorCode status 
) [static]

Compiles the regular expression in string form into a RegexPattern object using the specified URegexpFlag match mode flags.

These compile methods, rather than the constructors, are the usual way that RegexPattern objects are created.

Note that RegexPattern objects must not be deleted while RegexMatcher objects created from the pattern are active. RegexMatchers keep a pointer back to their pattern, so premature deletion of the pattern is a catastrophic error.

Note that it is often more convenient to construct a RegexMatcher directly from a pattern string instead of than separately compiling the pattern and then creating a RegexMatcher object from the pattern.

Parameters:
regexThe regular expression to be compiled.
flagsThe URegexpFlag match mode flags to be used, e.g. UREGEX_CASE_INSENSITIVE.
statusA reference to a UErrorCode to receive any errors.
Returns:
A regexPattern object for the compiled pattern.
Stable:
ICU 2.6
static RegexPattern* icu::final::compile ( UText regex,
uint32_t  flags,
UErrorCode status 
) [static]

Compiles the regular expression in string form into a RegexPattern object using the specified URegexpFlag match mode flags.

These compile methods, rather than the constructors, are the usual way that RegexPattern objects are created.

Note that RegexPattern objects must not be deleted while RegexMatcher objects created from the pattern are active. RegexMatchers keep a pointer back to their pattern, so premature deletion of the pattern is a catastrophic error.

Note that it is often more convenient to construct a RegexMatcher directly from a pattern string instead of than separately compiling the pattern and then creating a RegexMatcher object from the pattern.

Parameters:
regexThe regular expression to be compiled. Note, the text referred to by this UText must not be deleted during the lifetime of the RegexPattern object or any RegexMatcher object created from it.
flagsThe URegexpFlag match mode flags to be used, e.g. UREGEX_CASE_INSENSITIVE.
statusA reference to a UErrorCode to receive any errors.
Returns:
A regexPattern object for the compiled pattern.
Stable:
ICU 4.6
virtual UnicodeSet& icu::final::complement ( ) [virtual]

This is equivalent to complement(MIN_VALUE, MAX_VALUE).

Note: This performs a symmetric difference with all code points and thus retains all multicharacter strings. In order to achieve a “code point complement” (all code points minus this set), the easiest is to .complement().removeAllStrings().

A frozen set will not be modified.

Stable:
ICU 2.0
virtual UnicodeSet& icu::final::complement ( UChar32  start,
UChar32  end 
) [virtual]

Complements the specified range in this set.

Any character in the range will be removed if it is in this set, or will be added if it is not in this set. If start > end then an empty range is complemented, leaving the set unchanged. This is equivalent to a boolean logic XOR. A frozen set will not be modified.

Parameters:
startfirst character, inclusive, of range
endlast character, inclusive, of range
Stable:
ICU 2.0

Complements the specified character in this set.

The character will be removed if it is in this set, or will be added if it is not in this set. A frozen set will not be modified.

Parameters:
cthe character (code point)
Returns:
this object, for chaining
Stable:
ICU 2.0

Complement the specified string in this set.

The string will be removed if it is in this set, or will be added if it is not in this set. A frozen set will not be modified.

Parameters:
sthe string to complement
Returns:
this object, for chaining
Stable:
ICU 2.4

Complement EACH of the characters in this string.

Note: "ch" == {"c", "h"} A frozen set will not be modified.

Parameters:
sthe source string
Returns:
this object, for chaining
Stable:
ICU 2.4
virtual UnicodeSet& icu::final::complementAll ( const UnicodeSet c) [virtual]

Complements in this set all elements contained in the specified set.

Any character in the other set will be removed if it is in this set, or will be added if it is not in this set. A frozen set will not be modified.

Parameters:
cset that defines which elements will be xor'ed from this set.
Stable:
ICU 2.4
icu::final::ConstChar16Ptr ( const char16_t *  p) [inline]

Copies the pointer.

Parameters:
ppointer
Stable:
ICU 59
icu::final::ConstChar16Ptr ( const uint16_t *  p) [inline]

Converts the pointer to char16_t *.

Parameters:
ppointer to be converted
Stable:
ICU 59
icu::final::ConstChar16Ptr ( const wchar_t *  p) [inline]

Converts the pointer to char16_t *.

(Only defined if U_SIZEOF_WCHAR_T==2.)

Parameters:
ppointer to be converted
Stable:
ICU 59
icu::final::ConstChar16Ptr ( const std::nullptr_t  p) [inline]

nullptr constructor.

Parameters:
pnullptr
Stable:
ICU 59
virtual UBool icu::final::contains ( UChar32  c) const [override, virtual]

Returns true if this set contains the given character.

This function works faster with a frozen set.

Parameters:
ccharacter to be checked for containment
Returns:
true if the test condition is met
Stable:
ICU 2.0

Implements icu::UnicodeFilter.

virtual UBool icu::final::contains ( UChar32  start,
UChar32  end 
) const [virtual]

Returns true if this set contains every character of the given range.

Parameters:
startfirst character, inclusive, of the range
endlast character, inclusive, of the range
Returns:
true if the test condition is met
Stable:
ICU 2.0

Returns true if this set contains the given multicharacter string.

Parameters:
sstring to be checked for containment
Returns:
true if this set contains the specified string
Stable:
ICU 2.4
virtual UBool icu::final::containsAll ( const UnicodeSet c) const [virtual]

Returns true if this set contains all the characters and strings of the given set.

Parameters:
cset to be checked for containment
Returns:
true if the test condition is met
Stable:
ICU 2.4

Returns true if this set contains all the characters of the given string.

Parameters:
sstring containing characters to be checked for containment
Returns:
true if the test condition is met
Stable:
ICU 2.4
UBool icu::final::containsNone ( UChar32  start,
UChar32  end 
) const

Returns true if this set contains none of the characters of the given range.

Parameters:
startfirst character, inclusive, of the range
endlast character, inclusive, of the range
Returns:
true if the test condition is met
Stable:
ICU 2.4

Returns true if this set contains none of the characters and strings of the given set.

Parameters:
cset to be checked for containment
Returns:
true if the test condition is met
Stable:
ICU 2.4

Returns true if this set contains none of the characters of the given string.

Parameters:
sstring containing characters to be checked for containment
Returns:
true if the test condition is met
Stable:
ICU 2.4
UBool icu::final::containsSome ( UChar32  start,
UChar32  end 
) const [inline]

Returns true if this set contains one or more of the characters in the given range.

Parameters:
startfirst character, inclusive, of the range
endlast character, inclusive, of the range
Returns:
true if the condition is met
Stable:
ICU 2.4
UBool icu::final::containsSome ( const UnicodeSet s) const [inline]

Returns true if this set contains one or more of the characters and strings of the given set.

Parameters:
sThe set to be checked for containment
Returns:
true if the condition is met
Stable:
ICU 2.4
UBool icu::final::containsSome ( const UnicodeString s) const [inline]

Returns true if this set contains one or more of the characters of the given string.

Parameters:
sstring containing characters to be checked for containment
Returns:
true if the condition is met
Stable:
ICU 2.4
UBool icu::final::copyErrorTo ( UErrorCode outErrorCode) const

Sets the UErrorCode if an error occurred while recording edits.

Preserves older error codes in the outErrorCode. Normally called from inside ICU string transformation functions, not user code.

Parameters:
outErrorCodeSet to an error code if it does not contain one already and an error occurred while recording edits. Otherwise unchanged.
Returns:
true if U_FAILURE(outErrorCode)
Stable:
ICU 59
virtual CollationElementIterator* icu::final::createCollationElementIterator ( const UnicodeString source) const [virtual]

Creates a collation element iterator for the source string.

The caller of this method is responsible for the memory management of the return pointer.

Parameters:
sourcethe string over which the CollationElementIterator will iterate.
Returns:
the collation element iterator of the source string using this as the based Collator.
Stable:
ICU 2.2
virtual CollationElementIterator* icu::final::createCollationElementIterator ( const CharacterIterator source) const [virtual]

Creates a collation element iterator for the source.

The caller of this method is responsible for the memory management of the returned pointer.

Parameters:
sourcethe CharacterIterator which produces the characters over which the CollationElementItgerator will iterate.
Returns:
the collation element iterator of the source using this as the based Collator.
Stable:
ICU 2.2
static DateFormatSymbols* icu::final::createForLocale ( const Locale locale,
UErrorCode status 
) [static]

Gets a DateFormatSymbols by locale.

Unlike the constructors which always use gregorian calendar, this method uses the calendar in the locale. If the locale contains no explicit calendar, this method uses the default calendar for that locale.

Parameters:
localethe locale.
statuserror returned here.
Returns:
the new DateFormatSymbols which the caller owns.
Internal:
Do not use. This API is for internal use only. For ICU use only.
static UnicodeSet* icu::final::createFrom ( const UnicodeString s) [static]

Makes a set from a multicharacter string.

Thus "ch" => {"ch"}

Parameters:
sthe source string
Returns:
a newly created set containing the given string. The caller owns the return object and is responsible for deleting it.
Stable:
ICU 2.4
static UnicodeSet* icu::final::createFromAll ( const UnicodeString s) [static]

Makes a set from each of the characters in the string.

Thus "ch" => {"c", "h"}

Parameters:
sthe source string
Returns:
a newly created set containing the given characters The caller owns the return object and is responsible for deleting it.
Stable:
ICU 2.4

Construct a DateFormatSymbols object by loading format data from resources for the default locale, in the default calendar (Gregorian).

NOTE: This constructor will never fail; if it cannot get resource data for the default locale, it will return a last-resort object based on hard-coded strings.

Parameters:
statusStatus code. Failure results if the resources for the default cannot be found or cannot be loaded
Stable:
ICU 2.0
icu::final::DateFormatSymbols ( const Locale locale,
UErrorCode status 
)

Construct a DateFormatSymbols object by loading format data from resources for the given locale, in the default calendar (Gregorian).

Parameters:
localeLocale to load format data from.
statusStatus code. Failure results if the resources for the locale cannot be found or cannot be loaded
Stable:
ICU 2.0
icu::final::DateFormatSymbols ( const char *  type,
UErrorCode status 
)

Construct a DateFormatSymbols object by loading format data from resources for the default locale, in the default calendar (Gregorian).

NOTE: This constructor will never fail; if it cannot get resource data for the default locale, it will return a last-resort object based on hard-coded strings.

Parameters:
typeType of calendar (as returned by Calendar::getType). Will be used to access the correct set of strings. (nullptr or empty string defaults to "gregorian".)
statusStatus code. Failure results if the resources for the default cannot be found or cannot be loaded
Internal:
Do not use. This API is for internal use only.
icu::final::DateFormatSymbols ( const Locale locale,
const char *  type,
UErrorCode status 
)

Construct a DateFormatSymbols object by loading format data from resources for the given locale, in the default calendar (Gregorian).

Parameters:
localeLocale to load format data from.
typeType of calendar (as returned by Calendar::getType). Will be used to access the correct set of strings. (nullptr or empty string defaults to "gregorian".)
statusStatus code. Failure results if the resources for the locale cannot be found or cannot be loaded
Internal:
Do not use. This API is for internal use only.

Copy constructor.

Stable:
ICU 2.0

Default constructor.

It does not initialize any interval patterns except that it initialize default fall-back pattern as "{0} - {1}", which can be reset by setFallbackIntervalPattern(). It should be followed by setFallbackIntervalPattern() and setIntervalPattern(), and is recommended to be used only for power users who wants to create their own interval patterns and use them to create date interval formatter.

Parameters:
statusoutput param set to success/failure code on exit
Internal:
Do not use. This API is for internal use only. ICU 4.0
icu::final::DateIntervalInfo ( const Locale locale,
UErrorCode status 
)

Construct DateIntervalInfo for the given locale,.

Parameters:
localethe interval patterns are loaded from the appropriate calendar data (specified calendar or default calendar) in this locale.
statusoutput param set to success/failure code on exit
Stable:
ICU 4.0

Copy constructor.

Stable:
ICU 4.0
void icu::final::dumpPattern ( ) const

Dump a compiled pattern.

Internal debug function.

Internal:
Do not use. This API is for internal use only.
icu::final::Edits ( ) [inline]

Constructs an empty object.

Stable:
ICU 59

Definition at line 86 of file edits.h.

icu::final::Edits ( const Edits other) [inline]

Copy constructor.

Parameters:
othersource edits
Stable:
ICU 60

Definition at line 94 of file edits.h.

icu::final::Edits ( Edits &&  src) [inline]

Move constructor, might leave src empty.

This object will have the same contents that the source object had.

Parameters:
srcsource edits
Stable:
ICU 60

Definition at line 106 of file edits.h.

virtual int32_t icu::final::end ( UErrorCode status) const [virtual]

Returns the index in the input string of the first character following the text matched during the previous match operation.

Parameters:
statusA reference to a UErrorCode to receive any errors. Possible errors are U_REGEX_INVALID_STATE if no match has been attempted or the last match failed.
Returns:
the index of the last character matched, plus one. The index value returned is a native index, corresponding to code units for the underlying encoding type, for example, a byte index for UTF-8.
Stable:
ICU 2.4
virtual int32_t icu::final::end ( int32_t  group,
UErrorCode status 
) const [virtual]

Returns the index in the input string of the character following the text matched by the specified capture group during the previous match operation.

Parameters:
groupthe capture group number
statusA reference to a UErrorCode to receive any errors. Possible errors are U_REGEX_INVALID_STATE if no match has been attempted or the last match failed and U_INDEX_OUTOFBOUNDS_ERROR for a bad capture group number
Returns:
the index of the first character following the text captured by the specified group during the previous match operation. Return -1 if the capture group exists in the pattern but was not part of the match. The index value returned is a native index, corresponding to code units for the underlying encoding type, for example, a byte index for UTF8.
Stable:
ICU 2.4
virtual int64_t icu::final::end64 ( UErrorCode status) const [virtual]

Returns the index in the input string of the first character following the text matched during the previous match operation.

Parameters:
statusA reference to a UErrorCode to receive any errors. Possible errors are U_REGEX_INVALID_STATE if no match has been attempted or the last match failed.
Returns:
the index of the last character matched, plus one. The index value returned is a native index, corresponding to code units for the underlying encoding type, for example, a byte index for UTF-8.
Stable:
ICU 4.6
virtual int64_t icu::final::end64 ( int32_t  group,
UErrorCode status 
) const [virtual]

Returns the index in the input string of the character following the text matched by the specified capture group during the previous match operation.

Parameters:
groupthe capture group number
statusA reference to a UErrorCode to receive any errors. Possible errors are U_REGEX_INVALID_STATE if no match has been attempted or the last match failed and U_INDEX_OUTOFBOUNDS_ERROR for a bad capture group number
Returns:
the index of the first character following the text captured by the specified group during the previous match operation. Return -1 if the capture group exists in the pattern but was not part of the match. The index value returned is a native index, corresponding to code units for the underlying encoding type, for example, a byte index for UTF8.
Stable:
ICU 4.6
virtual UBool icu::final::find ( ) [virtual]

Find the next pattern match in the input string.

The find begins searching the input at the location following the end of the previous match, or at the start of the string if there is no previous match. If a match is found, `start()`, `end()` and `group()` will provide more information regarding the match. Note that if the input string is changed by the application, use find(startPos, status) instead of find(), because the saved starting position may not be valid with the altered input string.

Returns:
true if a match is found.
Stable:
ICU 2.4
virtual UBool icu::final::find ( UErrorCode status) [virtual]

Find the next pattern match in the input string.

The find begins searching the input at the location following the end of the previous match, or at the start of the string if there is no previous match. If a match is found, `start()`, `end()` and `group()` will provide more information regarding the match.

Note that if the input string is changed by the application, use find(startPos, status) instead of find(), because the saved starting position may not be valid with the altered input string.

Parameters:
statusA reference to a UErrorCode to receive any errors.
Returns:
true if a match is found.
Stable:
ICU 55
virtual UBool icu::final::find ( int64_t  start,
UErrorCode status 
) [virtual]

Resets this RegexMatcher and then attempts to find the next substring of the input string that matches the pattern, starting at the specified index.

Parameters:
startThe (native) index in the input string to begin the search.
statusA reference to a UErrorCode to receive any errors.
Returns:
true if a match is found.
Stable:
ICU 2.4
virtual uint32_t icu::final::flags ( ) const [virtual]

Get the URegexpFlag match mode flags that were used when compiling this pattern.

Returns:
the URegexpFlag match mode flags
Stable:
ICU 2.4
static int32_t icu::final::fold ( uint32_t  options,
const char16_t *  src,
int32_t  srcLength,
char16_t *  dest,
int32_t  destCapacity,
Edits edits,
UErrorCode errorCode 
) [static]

Case-folds a UTF-16 string and optionally records edits.

Case folding is locale-independent and not context-sensitive, but there is an option for whether to include or exclude mappings for dotted I and dotless i that are marked with 'T' in CaseFolding.txt.

The result may be longer or shorter than the original. The source string and the destination buffer must not overlap.

Parameters:
optionsOptions bit set, usually 0. See U_OMIT_UNCHANGED_TEXT, U_EDITS_NO_RESET, U_FOLD_CASE_DEFAULT, U_FOLD_CASE_EXCLUDE_SPECIAL_I.
srcThe original string.
srcLengthThe length of the original string. If -1, then src must be NUL-terminated.
destA buffer for the result string. The result will be NUL-terminated if the buffer is large enough. The contents is undefined in case of failure.
destCapacityThe size of the buffer (number of char16_ts). If it is 0, then dest may be nullptr and the function will only return the length of the result without writing any of the result string.
editsRecords edits for index mapping, working with styled text, and getting only changes (if any). The Edits contents is undefined if any error occurs. This function calls edits->reset() first unless options includes U_EDITS_NO_RESET. edits can be nullptr.
errorCodeReference to an in/out error code value which must not indicate a failure before the function call.
Returns:
The length of the result string, if successful. When the result would be longer than destCapacity, the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set.
See also:
u_strFoldCase
Stable:
ICU 59
UnicodeString& icu::final::format ( const UnicodeString value0,
UnicodeString appendTo,
UErrorCode errorCode 
) const

Formats the given value, appending to the appendTo builder.

The argument value must not be the same object as appendTo. getArgumentLimit() must be at most 1.

Parameters:
value0Value for argument {0}.
appendToGets the formatted pattern and value appended.
errorCodeICU error code in/out parameter. Must fulfill U_SUCCESS before the function call.
Returns:
appendTo
Stable:
ICU 57
UnicodeString& icu::final::format ( const UnicodeString value0,
const UnicodeString value1,
UnicodeString appendTo,
UErrorCode errorCode 
) const

Formats the given values, appending to the appendTo builder.

An argument value must not be the same object as appendTo. getArgumentLimit() must be at most 2.

Parameters:
value0Value for argument {0}.
value1Value for argument {1}.
appendToGets the formatted pattern and values appended.
errorCodeICU error code in/out parameter. Must fulfill U_SUCCESS before the function call.
Returns:
appendTo
Stable:
ICU 57
UnicodeString& icu::final::format ( const UnicodeString value0,
const UnicodeString value1,
const UnicodeString value2,
UnicodeString appendTo,
UErrorCode errorCode 
) const

Formats the given values, appending to the appendTo builder.

An argument value must not be the same object as appendTo. getArgumentLimit() must be at most 3.

Parameters:
value0Value for argument {0}.
value1Value for argument {1}.
value2Value for argument {2}.
appendToGets the formatted pattern and values appended.
errorCodeICU error code in/out parameter. Must fulfill U_SUCCESS before the function call.
Returns:
appendTo
Stable:
ICU 57
UnicodeString& icu::final::formatAndAppend ( const UnicodeString *const *  values,
int32_t  valuesLength,
UnicodeString appendTo,
int32_t *  offsets,
int32_t  offsetsLength,
UErrorCode errorCode 
) const

Formats the given values, appending to the appendTo string.

Parameters:
valuesThe argument values. An argument value must not be the same object as appendTo. Can be nullptr if valuesLength==getArgumentLimit()==0.
valuesLengthThe length of the values array. Must be at least getArgumentLimit().
appendToGets the formatted pattern and values appended.
offsetsoffsets[i] receives the offset of where values[i] replaced pattern argument {i}. Can be shorter or longer than values. Can be nullptr if offsetsLength==0. If there is no {i} in the pattern, then offsets[i] is set to -1.
offsetsLengthThe length of the offsets array.
errorCodeICU error code in/out parameter. Must fulfill U_SUCCESS before the function call.
Returns:
appendTo
Stable:
ICU 57
UnicodeString& icu::final::formatAndReplace ( const UnicodeString *const *  values,
int32_t  valuesLength,
UnicodeString result,
int32_t *  offsets,
int32_t  offsetsLength,
UErrorCode errorCode 
) const

Formats the given values, replacing the contents of the result string.

May optimize by actually appending to the result if it is the same object as the value corresponding to the initial argument in the pattern.

Parameters:
valuesThe argument values. An argument value may be the same object as result. Can be nullptr if valuesLength==getArgumentLimit()==0.
valuesLengthThe length of the values array. Must be at least getArgumentLimit().
resultGets its contents replaced by the formatted pattern and values.
offsetsoffsets[i] receives the offset of where values[i] replaced pattern argument {i}. Can be shorter or longer than values. Can be nullptr if offsetsLength==0. If there is no {i} in the pattern, then offsets[i] is set to -1.
offsetsLengthThe length of the offsets array.
errorCodeICU error code in/out parameter. Must fulfill U_SUCCESS before the function call.
Returns:
result
Stable:
ICU 57

Freeze the set (make it immutable).

Once frozen, it cannot be unfrozen and is therefore thread-safe until it is deleted. See the ICU4J Freezable interface for details. Freezing the set may also make some operations faster, for example contains() and span(). A frozen set will not be modified. (It remains frozen.)

Returns:
this set.
See also:
isFrozen
cloneAsThawed
Stable:
ICU 3.8
static CollationElementIterator* icu::final::fromUCollationElements ( UCollationElements uc) [inline, static]
Internal:
Do not use.

This API is for internal use only.

Definition at line 293 of file coleitr.h.

static const CollationElementIterator* icu::final::fromUCollationElements ( const UCollationElements uc) [inline, static]
Internal:
Do not use.

This API is for internal use only.

Definition at line 297 of file coleitr.h.

static UnicodeSet* icu::final::fromUSet ( USet uset) [inline, static]

Get a UnicodeSet pointer from a USet.

Parameters:
useta USet (the ICU plain C type for UnicodeSet)
Returns:
the corresponding UnicodeSet pointer.
Stable:
ICU 4.2
static const UnicodeSet* icu::final::fromUSet ( const USet uset) [inline, static]

Get a UnicodeSet pointer from a const USet.

Parameters:
useta const USet (the ICU plain C type for UnicodeSet)
Returns:
the corresponding UnicodeSet pointer.
Stable:
ICU 4.2
char16_t* icu::final::get ( ) const [inline]

Pointer access.

Returns:
the wrapped pointer
Stable:
ICU 59
const char16_t* icu::final::get ( ) const [inline]

Pointer access.

Returns:
the wrapped pointer
Stable:
ICU 59
const UnicodeString* icu::final::getAmPmStrings ( int32_t &  count) const

Gets AM/PM strings.

For example: "AM" and "PM".

Parameters:
countFilled in with length of the array.
Returns:
the weekday strings. (DateFormatSymbols retains ownership.)
Stable:
ICU 2.0
int32_t icu::final::getArgumentLimit ( ) const [inline]
Returns:
The max argument number + 1.
Stable:
ICU 57

Definition at line 157 of file simpleformatter.h.

virtual UColAttributeValue icu::final::getAttribute ( UColAttribute  attr,
UErrorCode status 
) const [override, virtual]

Universal attribute getter.

Parameters:
attrattribute type
statusto indicate whether the operation went on smoothly or there were errors
Returns:
attribute value
Stable:
ICU 2.2

Implements icu::Collator.

Iterator icu::final::getCoarseChangesIterator ( ) const [inline]

Returns an Iterator for coarse-grained change edits (adjacent change edits are treated as one).

Can be used to perform simple string updates. Skips no-change edits.

Returns:
an Iterator that merges adjacent changes.
Stable:
ICU 59

Definition at line 438 of file edits.h.

Iterator icu::final::getCoarseIterator ( ) const [inline]

Returns an Iterator for coarse-grained change and no-change edits (adjacent change edits are treated as one).

Can be used to perform simple string updates. Adjacent change edits are treated as one edit.

Returns:
an Iterator that merges adjacent changes.
Stable:
ICU 59

Definition at line 450 of file edits.h.

UChar32 icu::final::getCodepoint ( ) const [inline]

Returns the current code point, if isString() returned false.

Otherwise returns an undefined result.

Stable:
ICU 2.4

Returns the end of the current code point range, if isString() returned false and nextRange() was called.

Otherwise returns an undefined result.

Stable:
ICU 2.4
virtual CollationKey& icu::final::getCollationKey ( const UnicodeString source,
CollationKey key,
UErrorCode status 
) const [override, virtual]

Transforms the string into a series of characters that can be compared with CollationKey.compare().

Note that sort keys are often less efficient than simply doing comparison. For more details, see the ICU User Guide.

Parameters:
sourcethe source string.
keythe transformed key of the source string.
statusthe error code status.
Returns:
the transformed key.
See also:
CollationKey
Stable:
ICU 2.0

Implements icu::Collator.

virtual CollationKey& icu::final::getCollationKey ( const char16_t *  source,
int32_t  sourceLength,
CollationKey key,
UErrorCode status 
) const [override, virtual]

Transforms a specified region of the string into a series of characters that can be compared with CollationKey.compare.

Note that sort keys are often less efficient than simply doing comparison. For more details, see the ICU User Guide.

Parameters:
sourcethe source string.
sourceLengththe length of the source string.
keythe transformed key of the source string.
statusthe error code status.
Returns:
the transformed key.
See also:
CollationKey
Stable:
ICU 2.0

Implements icu::Collator.

RuleBasedCollator* icu::final::getCollator ( ) const

Gets the collator used for the language rules.

Caller may modify but must not delete the RuleBasedCollator! Modifications to this collator will affect the original collator passed in to the StringSearch> constructor or to setCollator, if any.

Returns:
collator used for string search
Stable:
ICU 2.0

Get default order -- whether the first date in pattern is later date or not.

return default date ordering in interval pattern. true if the first date in pattern is later date, false otherwise.

Stable:
ICU 4.0
virtual UClassID icu::final::getDynamicClassID ( ) const [override, virtual]

ICU "poor man's RTTI", returns a UClassID for the actual class.

Stable:
ICU 2.2

Reimplemented from icu::UObject.

virtual UClassID icu::final::getDynamicClassID ( ) const [override, virtual]

ICU "poor man's RTTI", returns a UClassID for the actual class.

Stable:
ICU 2.4

Reimplemented from icu::UObject.

virtual UClassID icu::final::getDynamicClassID ( ) const [override, virtual]

ICU "poor man's RTTI", returns a UClassID for the actual class.

Stable:
ICU 2.2

Reimplemented from icu::UObject.

virtual UClassID icu::final::getDynamicClassID ( ) const [override, virtual]

ICU "poor man's RTTI", returns a UClassID for the actual class.

Stable:
ICU 4.0

Reimplemented from icu::UObject.

virtual UClassID icu::final::getDynamicClassID ( ) const [override, virtual]

ICU "poor man's RTTI", returns a UClassID for the actual class.

Stable:
ICU 2.2

Reimplemented from icu::UObject.

virtual UClassID icu::final::getDynamicClassID ( void  ) const [override, virtual]

Returns a unique class ID POLYMORPHICALLY.

Pure virtual override. This method is to implement a simple version of RTTI, since not all C++ compilers support genuine RTTI. Polymorphic operator==() and clone() methods call this method.

Returns:
The class ID for this object. All objects of a given class have the same class ID. Objects of other classes have different class IDs.
Stable:
ICU 2.0

Reimplemented from icu::UObject.

virtual UClassID icu::final::getDynamicClassID ( ) const [override, virtual]

ICU "poor man's RTTI", returns a UClassID for the actual class.

Stable:
ICU 2.4

Reimplemented from icu::UObject.

virtual UClassID icu::final::getDynamicClassID ( ) const [override, virtual]

ICU "poor man's RTTI", returns a UClassID for the actual class.

Stable:
ICU 2.2

Reimplemented from icu::UObject.

virtual UClassID icu::final::getDynamicClassID ( void  ) const [override, virtual]

Implement UnicodeFunctor API.

Returns:
The class ID for this object. All objects of a given class have the same class ID. Objects of other classes have different class IDs.
Stable:
ICU 2.4

Reimplemented from icu::UObject.

virtual UClassID icu::final::getDynamicClassID ( ) const [override, virtual]

ICU "poor man's RTTI", returns a UClassID for the actual class.

Stable:
ICU 2.2

Reimplemented from icu::UObject.

const UnicodeString* icu::final::getEraNames ( int32_t &  count) const

Gets era name strings.

For example: "Anno Domini" and "Before Christ".

Parameters:
countFilled in with length of the array.
Returns:
the era name strings.
Stable:
ICU 3.4
const UnicodeString* icu::final::getEras ( int32_t &  count) const

Gets abbreviated era strings.

For example: "AD" and "BC".

Parameters:
countFilled in with length of the array.
Returns:
the era strings.
Stable:
ICU 2.0

Get the fallback interval pattern.

Parameters:
resultoutput param to receive the pattern
Returns:
a reference to 'result'
Stable:
ICU 4.0
virtual void icu::final::getFindProgressCallback ( URegexFindProgressCallback *&  callback,
const void *&  context,
UErrorCode status 
) [virtual]

Get the find progress callback function for this URegularExpression.

Parameters:
callbackOut parameter, receives a pointer to the user-supplied callback function.
contextOut parameter, receives the user context pointer that was set when uregex_setFindProgressCallback() was called.
statusA reference to a UErrorCode to receive any errors.
Stable:
ICU 4.6
Iterator icu::final::getFineChangesIterator ( ) const [inline]

Returns an Iterator for fine-grained change edits (full granularity of change edits is retained).

Can be used for modifying styled text. Skips no-change edits.

Returns:
an Iterator that separates adjacent changes.
Stable:
ICU 59

Definition at line 462 of file edits.h.

Iterator icu::final::getFineIterator ( ) const [inline]

Returns an Iterator for fine-grained change and no-change edits (full granularity of change edits is retained).

Can be used for modifying styled text.

Returns:
an Iterator that separates adjacent changes.
Stable:
ICU 59

Definition at line 473 of file edits.h.

virtual UText* icu::final::getInput ( UText dest,
UErrorCode status 
) const [virtual]

Returns the input string being matched, either by copying it into the provided UText parameter or by returning a shallow clone of the live input.

Note that copying the entire input may cause significant performance and memory issues.

Parameters:
destThe UText into which the input should be copied, or nullptr to create a new UText
statuserror code
Returns:
dest if non-nullptr, a shallow copy of the input text otherwise
Stable:
ICU 4.6
UnicodeString& icu::final::getIntervalPattern ( const UnicodeString skeleton,
UCalendarDateFields  field,
UnicodeString result,
UErrorCode status 
) const

Get the interval pattern given skeleton and the largest different calendar field.

Parameters:
skeletonthe skeleton
fieldthe largest different calendar field
resultoutput param to receive the pattern
statusoutput param set to success/failure code on exit
Returns:
a reference to 'result'
Stable:
ICU 4.0
const UnicodeString* icu::final::getLeapMonthPatterns ( int32_t &  count) const

Somewhat temporary function for getting complete set of leap month patterns for all contexts & widths, indexed by EMonthPatternType values.

Returns nullptr if calendar does not have leap month patterns. Note, there is currently no setter for this. Eventually we will add full support for different month pattern types (needed for other calendars such as Hindu) at which point this approach will be replaced by a more complete approach.

Parameters:
countFilled in with length of the array (may be 0).
Returns:
The leap month patterns (DateFormatSymbols retains ownership). May be nullptr if there are no leap month patterns for this calendar.
Internal:
Do not use. This API is for internal use only.
virtual Locale icu::final::getLocale ( ULocDataLocaleType  type,
UErrorCode status 
) const [override, virtual]

Gets the locale of the Collator.

Parameters:
typecan be either requested, valid or actual locale. For more information see the definition of ULocDataLocaleType in uloc.h
statusthe error code status.
Returns:
locale where the collation data lives. If the collator was instantiated from rules, locale is empty.
Deprecated:
ICU 2.8 likely to change in ICU 3.0, based on feedback

Implements icu::Collator.

Locale icu::final::getLocale ( ULocDataLocaleType  type,
UErrorCode status 
) const [virtual]

Returns the locale for this object.

Two flavors are available: valid and actual locale.

Stable:
ICU 2.8

Implements icu::Collator.

Gets localized date-time pattern characters.

For example: 'u', 't', etc.

Note: ICU no longer provides localized date-time pattern characters for a locale starting ICU 3.8. This method returns the non-localized date-time pattern characters unless user defined localized data is set by setLocalPatternChars.

Parameters:
resultOutput param which will receive the localized date-time pattern characters.
Returns:
A reference to 'result'.
Stable:
ICU 2.0
virtual void icu::final::getMatchCallback ( URegexMatchCallback *&  callback,
const void *&  context,
UErrorCode status 
) [virtual]

Get the callback function for this URegularExpression.

Parameters:
callbackOut parameter, receives a pointer to the user-supplied callback function.
contextOut parameter, receives the user context pointer that was set when uregex_setMatchCallback() was called.
statusA reference to a UErrorCode to receive any errors.
Stable:
ICU 4.0
int32_t icu::final::getMaxExpansion ( int32_t  order) const

Return the maximum length of any expansion sequences that end with the specified comparison order.

Parameters:
ordera collation order returned by previous or next.
Returns:
maximum size of the expansion sequences ending with the collation element or 1 if collation element does not occur at the end of any expansion sequence
Stable:
ICU 2.0
int32_t icu::final::getMaxExpansion ( int32_t  order) const

Returns the maximum length of any expansion sequences that end with the specified comparison order.

This is specific to the kind of collation element values and sequences returned by the CollationElementIterator. Call CollationElementIterator::getMaxExpansion() instead.

Parameters:
ordera collation order returned by CollationElementIterator::previous or CollationElementIterator::next.
Returns:
maximum size of the expansion sequences ending with the collation element, or 1 if the collation element does not occur at the end of any expansion sequence
See also:
CollationElementIterator::getMaxExpansion
Deprecated:
ICU 51 Use CollationElementIterator::getMaxExpansion() instead.
virtual UColReorderCode icu::final::getMaxVariable ( ) const [override, virtual]

Returns the maximum reordering group whose characters are affected by UCOL_ALTERNATE_HANDLING.

Returns:
the maximum variable reordering group.
See also:
setMaxVariable
Stable:
ICU 53

Reimplemented from icu::Collator.

const UnicodeString* icu::final::getMonths ( int32_t &  count) const

Gets month strings.

For example: "January", "February", etc.

Parameters:
countFilled in with length of the array.
Returns:
the month strings. (DateFormatSymbols retains ownership.)
Stable:
ICU 2.0
const UnicodeString* icu::final::getMonths ( int32_t &  count,
DtContextType  context,
DtWidthType  width 
) const

Gets month strings by width and context.

For example: "January", "February", etc.

Parameters:
countFilled in with length of the array.
contextThe formatting context, either FORMAT or STANDALONE
widthThe width of returned strings, either WIDE, ABBREVIATED, or NARROW.
Returns:
the month strings. (DateFormatSymbols retains ownership.)
Stable:
ICU 3.4
const UnicodeString* icu::final::getNarrowEras ( int32_t &  count) const

Gets narrow era strings.

For example: "A" and "B".

Parameters:
countFilled in with length of the array.
Returns:
the narrow era strings.
Stable:
ICU 4.2
int32_t icu::final::getOffset ( void  ) const [virtual]

Gets the offset of the currently processed character in the source string.

Returns:
the offset of the character.
Stable:
ICU 2.0

Implements icu::SearchIterator.

virtual int32_t icu::final::getOffset ( void  ) const [override, virtual]

Return the current index in the text being searched.

If the iteration has gone past the end of the text (or past the beginning for a backwards search), USEARCH_DONE is returned.

Returns:
current index in the text being searched.
Stable:
ICU 2.0

Implements icu::SearchIterator.

Gets the search pattern.

Returns:
pattern used for matching
Stable:
ICU 2.0
static const char16_t* icu::final::getPatternUChars ( void  ) [static]

Get the non-localized date-time pattern characters.

Returns:
the non-localized date-time pattern characters
Stable:
ICU 2.0
const UnicodeString* icu::final::getQuarters ( int32_t &  count,
DtContextType  context,
DtWidthType  width 
) const

Gets quarter strings by width and context.

For example: "1st Quarter", "2nd Quarter", etc.

Parameters:
countFilled in with length of the array.
contextThe formatting context, either FORMAT or STANDALONE
widthThe width of returned strings, either WIDE, ABBREVIATED, or NARROW.
Returns:
the quarter strings. (DateFormatSymbols retains ownership.)
Stable:
ICU 3.6
virtual int32_t icu::final::getRangeCount ( void  ) const [virtual]

Iteration method that returns the number of ranges contained in this set.

See also:
getRangeStart
getRangeEnd
Stable:
ICU 2.4
virtual UChar32 icu::final::getRangeEnd ( int32_t  index) const [virtual]

Iteration method that returns the last character in the specified range of this set.

See also:
getRangeStart
getRangeEnd
Stable:
ICU 2.4
virtual UChar32 icu::final::getRangeStart ( int32_t  index) const [virtual]

Iteration method that returns the first character in the specified range of this set.

See also:
getRangeCount
getRangeEnd
Stable:
ICU 2.4
virtual int32_t icu::final::getReorderCodes ( int32_t *  dest,
int32_t  destCapacity,
UErrorCode status 
) const [override, virtual]

Retrieves the reordering codes for this collator.

Parameters:
destThe array to fill with the script ordering.
destCapacityThe length of dest. If it is 0, then dest may be nullptr and the function will only return the length of the result without writing any codes (pre-flighting).
statusA reference to an error code value, which must not indicate a failure before the function call.
Returns:
The length of the script ordering array.
See also:
ucol_setReorderCodes
Collator::getEquivalentReorderCodes
Collator::setReorderCodes
Stable:
ICU 4.8

Reimplemented from icu::Collator.

Gets the tailoring rules for this collator.

Returns:
the collation tailoring from which this collator was created
Stable:
ICU 2.0
void icu::final::getRules ( UColRuleOption  delta,
UnicodeString buffer 
) const

Returns current rules.

Delta defines whether full rules are returned or just the tailoring.

getRules(void) should normally be used instead. See https://unicode-org.github.io/icu/userguide/collation/customization#building-on-existing-locales

Parameters:
deltaone of UCOL_TAILORING_ONLY, UCOL_FULL_RULES.
bufferUnicodeString to store the result rules
Stable:
ICU 2.2
See also:
UCOL_FULL_RULES
const UnicodeString* icu::final::getShortMonths ( int32_t &  count) const

Gets short month strings.

For example: "Jan", "Feb", etc.

Parameters:
countFilled in with length of the array.
Returns:
the short month strings. (DateFormatSymbols retains ownership.)
Stable:
ICU 2.0
const UnicodeString* icu::final::getShortWeekdays ( int32_t &  count) const

Gets abbreviated weekday strings.

For example: "Sun", "Mon", etc. (Note: The method name is misleading; it does not get the CLDR-style "short" weekday strings, e.g. "Su", "Mo", etc.)

Parameters:
countFilled in with length of the array.
Returns:
the abbreviated weekday strings. (DateFormatSymbols retains ownership.)
Stable:
ICU 2.0
virtual int32_t icu::final::getSortKey ( const UnicodeString source,
uint8_t *  result,
int32_t  resultLength 
) const [override, virtual]

Get the sort key as an array of bytes from a UnicodeString.

Note that sort keys are often less efficient than simply doing comparison. For more details, see the ICU User Guide.

Parameters:
sourcestring to be processed.
resultbuffer to store result in. If nullptr, number of bytes needed will be returned.
resultLengthlength of the result buffer. If if not enough the buffer will be filled to capacity.
Returns:
Number of bytes needed for storing the sort key
Stable:
ICU 2.0

Implements icu::Collator.

virtual int32_t icu::final::getSortKey ( const char16_t *  source,
int32_t  sourceLength,
uint8_t *  result,
int32_t  resultLength 
) const [override, virtual]

Get the sort key as an array of bytes from a char16_t buffer.

Note that sort keys are often less efficient than simply doing comparison. For more details, see the ICU User Guide.

Parameters:
sourcestring to be processed.
sourceLengthlength of string to be processed. If -1, the string is 0 terminated and length will be decided by the function.
resultbuffer to store result in. If nullptr, number of bytes needed will be returned.
resultLengthlength of the result buffer. If if not enough the buffer will be filled to capacity.
Returns:
Number of bytes needed for storing the sort key
Stable:
ICU 2.2

Implements icu::Collator.

Gets the NFD form of the current source we are iterating over.

Returns:
gets the source: NOTE: it is the NFD form of source
Stable:
ICU 2.4
virtual int32_t icu::final::getStackLimit ( ) const [virtual]

Get the size of the heap storage available for use by the back tracking stack.

Returns:
the maximum backtracking stack size, in bytes, or zero if the stack size is unlimited.
Stable:
ICU 4.0

ICU "poor man's RTTI", returns a UClassID for this class.

Stable:
ICU 2.2

Reimplemented from icu::UnicodeFilter.

ICU "poor man's RTTI", returns a UClassID for this class.

Stable:
ICU 2.4

Reimplemented from icu::UnicodeFilter.

ICU "poor man's RTTI", returns a UClassID for this class.

Stable:
ICU 2.2

Reimplemented from icu::UnicodeFilter.

ICU "poor man's RTTI", returns a UClassID for this class.

Stable:
ICU 4.0

Reimplemented from icu::UnicodeFilter.

ICU "poor man's RTTI", returns a UClassID for this class.

Stable:
ICU 2.2

Reimplemented from icu::UnicodeFilter.

static UClassID icu::final::getStaticClassID ( void  ) [static]

Returns the class ID for this class.

This is useful only for comparing to a return value from getDynamicClassID(). For example:

 Base* polymorphic_pointer = createPolymorphicObject();
 if (polymorphic_pointer->getDynamicClassID() ==
                                          Derived::getStaticClassID()) ...
 
Returns:
The class ID for all objects of this class.
Stable:
ICU 2.0

Reimplemented from icu::UnicodeFilter.

ICU "poor man's RTTI", returns a UClassID for this class.

Stable:
ICU 2.4

Reimplemented from icu::UnicodeFilter.

ICU "poor man's RTTI", returns a UClassID for this class.

Stable:
ICU 2.2

Reimplemented from icu::UnicodeFilter.

static UClassID icu::final::getStaticClassID ( void  ) [static]

Return the class ID for this class.

This is useful only for comparing to a return value from getDynamicClassID(). For example:

 .      Base* polymorphic_pointer = createPolymorphicObject();
 .      if (polymorphic_pointer->getDynamicClassID() ==
 .          Derived::getStaticClassID()) ...
 
Returns:
The class ID for all objects of this class.
Stable:
ICU 2.0

Reimplemented from icu::UnicodeFilter.

ICU "poor man's RTTI", returns a UClassID for this class.

Stable:
ICU 2.2

Reimplemented from icu::UnicodeFilter.

const UnicodeString& icu::final::getString ( )

Returns the current string, if isString() returned true.

If the current iteration item is a code point, a UnicodeString containing that single code point is returned.

Ownership of the returned string remains with the iterator. The string is guaranteed to remain valid only until the iterator is advanced to the next item, or until the iterator is deleted.

Stable:
ICU 2.4
virtual UnicodeSet* icu::final::getTailoredSet ( UErrorCode status) const [override, virtual]

Get a UnicodeSet that contains all the characters and sequences tailored in this collator.

Parameters:
statuserror code of the operation
Returns:
a pointer to a UnicodeSet object containing all the code points and sequences that may sort differently than in the root collator. The object must be disposed of by using delete
Stable:
ICU 2.4

Reimplemented from icu::Collator.

Returns the pattern text with none of the arguments.

Like formatting with all-empty string values.

Stable:
ICU 57

Definition at line 270 of file simpleformatter.h.

UnicodeString icu::final::getTextWithNoArguments ( int32_t *  offsets,
int32_t  offsetsLength 
) const [inline]

Returns the pattern text with none of the arguments.

Like formatting with all-empty string values.

TODO(ICU-20406): Replace this with an Iterator interface.

Parameters:
offsetsoffsets[i] receives the offset of where {i} was located before it was replaced by an empty string. For example, "a{0}b{1}" produces offset 1 for i=0 and 2 for i=1. Can be nullptr if offsetsLength==0. If there is no {i} in the pattern, then offsets[i] is set to -1.
offsetsLengthThe length of the offsets array.
Internal:
Do not use. This API is for internal use only.

Definition at line 294 of file simpleformatter.h.

virtual int32_t icu::final::getTimeLimit ( ) const [virtual]

Get the time limit, if any, for match operations made with this Matcher.

Returns:
the maximum allowed time for a match, in units of processing steps.
Stable:
ICU 4.0

Gets the time separator string.

For example: ":".

Parameters:
resultOutput param which will receive the time separator string.
Returns:
A reference to 'result'.
Internal:
Do not use. This API is for internal use only.
virtual uint32_t icu::final::getVariableTop ( UErrorCode status) const [override, virtual]

Gets the variable top value of a Collator.

Parameters:
statuserror code (not changed by function). If error code is set, the return value is undefined.
Returns:
the variable top primary weight
See also:
getMaxVariable
Stable:
ICU 2.0

Implements icu::Collator.

virtual void icu::final::getVersion ( UVersionInfo  info) const [override, virtual]

Gets the version information for a Collator.

Parameters:
infothe version # information, the result will be filled in
Stable:
ICU 2.0

Implements icu::Collator.

const UnicodeString* icu::final::getWeekdays ( int32_t &  count) const

Gets wide weekday strings.

For example: "Sunday", "Monday", etc.

Parameters:
countFilled in with length of the array.
Returns:
the weekday strings. (DateFormatSymbols retains ownership.)
Stable:
ICU 2.0
const UnicodeString* icu::final::getWeekdays ( int32_t &  count,
DtContextType  context,
DtWidthType  width 
) const

Gets weekday strings by width and context.

For example: "Sunday", "Monday", etc.

Parameters:
countFilled in with length of the array.
contextThe formatting context, either FORMAT or STANDALONE
widthThe width of returned strings, either WIDE, ABBREVIATED, SHORT, or NARROW
Returns:
the month strings. (DateFormatSymbols retains ownership.)
Stable:
ICU 3.4
const UnicodeString* icu::final::getYearNames ( int32_t &  count,
DtContextType  context,
DtWidthType  width 
) const

Gets cyclic year name strings if the calendar has them, by width and context.

For example: "jia-zi", "yi-chou", etc.

Parameters:
countFilled in with length of the array.
contextThe usage context: FORMAT, STANDALONE.
widthThe requested name width: WIDE, ABBREVIATED, NARROW.
Returns:
The year name strings (DateFormatSymbols retains ownership), or null if they are not available for this calendar.
Stable:
ICU 54
const UnicodeString* icu::final::getZodiacNames ( int32_t &  count,
DtContextType  context,
DtWidthType  width 
) const

Gets calendar zodiac name strings if the calendar has them, by width and context.

For example: "Rat", "Ox", "Tiger", etc.

Parameters:
countFilled in with length of the array.
contextThe usage context: FORMAT, STANDALONE.
widthThe requested name width: WIDE, ABBREVIATED, NARROW.
Returns:
The zodiac name strings (DateFormatSymbols retains ownership), or null if they are not available for this calendar.
Stable:
ICU 54
const UnicodeString** icu::final::getZoneStrings ( int32_t &  rowCount,
int32_t &  columnCount 
) const

Gets timezone strings.

These strings are stored in a 2-dimensional array.

Parameters:
rowCountOutput param to receive number of rows.
columnCountOutput param to receive number of columns.
Returns:
The timezone strings as a 2-d array. (DateFormatSymbols retains ownership.)
Deprecated:
ICU 3.6
virtual UnicodeString icu::final::group ( UErrorCode status) const [virtual]

Returns a string containing the text matched by the previous match.

If the pattern can match an empty string, an empty string may be returned.

Parameters:
statusA reference to a UErrorCode to receive any errors. Possible errors are U_REGEX_INVALID_STATE if no match has been attempted or the last match failed.
Returns:
a string containing the matched input text.
Stable:
ICU 2.4
virtual UnicodeString icu::final::group ( int32_t  groupNum,
UErrorCode status 
) const [virtual]

Returns a string containing the text captured by the given group during the previous match operation.

Group(0) is the entire match.

A zero length string is returned both for capture groups that did not participate in the match and for actual zero length matches. To distinguish between these two cases use the function start(), which returns -1 for non-participating groups.

Parameters:
groupNumthe capture group number
statusA reference to a UErrorCode to receive any errors. Possible errors are U_REGEX_INVALID_STATE if no match has been attempted or the last match failed and U_INDEX_OUTOFBOUNDS_ERROR for a bad capture group number.
Returns:
the captured text
Stable:
ICU 2.4
virtual UText* icu::final::group ( UText dest,
int64_t &  group_len,
UErrorCode status 
) const [virtual]

Returns a shallow clone of the entire live input string with the UText current native index set to the beginning of the requested group.

Parameters:
destThe UText into which the input should be cloned, or nullptr to create a new UText
group_lenA reference to receive the length of the desired capture group
statusA reference to a UErrorCode to receive any errors. Possible errors are U_REGEX_INVALID_STATE if no match has been attempted or the last match failed and U_INDEX_OUTOFBOUNDS_ERROR for a bad capture group number.
Returns:
dest if non-nullptr, a shallow copy of the input text otherwise
Stable:
ICU 4.6
virtual UText* icu::final::group ( int32_t  groupNum,
UText dest,
int64_t &  group_len,
UErrorCode status 
) const [virtual]

Returns a shallow clone of the entire live input string with the UText current native index set to the beginning of the requested group.

A group length of zero is returned both for capture groups that did not participate in the match and for actual zero length matches. To distinguish between these two cases use the function start(), which returns -1 for non-participating groups.

Parameters:
groupNumThe capture group number.
destThe UText into which the input should be cloned, or nullptr to create a new UText.
group_lenA reference to receive the length of the desired capture group
statusA reference to a UErrorCode to receive any errors. Possible errors are U_REGEX_INVALID_STATE if no match has been attempted or the last match failed and U_INDEX_OUTOFBOUNDS_ERROR for a bad capture group number.
Returns:
dest if non-nullptr, a shallow copy of the input text otherwise
Stable:
ICU 4.6
virtual int32_t icu::final::groupCount ( ) const [virtual]

Returns the number of capturing groups in this matcher's pattern.

Returns:
the number of capture groups
Stable:
ICU 2.4
virtual int32_t icu::final::groupNumberFromName ( const UnicodeString groupName,
UErrorCode status 
) const [virtual]

Get the group number corresponding to a named capture group.

The returned number can be used with any function that access capture groups by number.

The function returns an error status if the specified name does not appear in the pattern.

Parameters:
groupNameThe capture group name.
statusA UErrorCode to receive any errors.
Stable:
ICU 55
virtual int32_t icu::final::groupNumberFromName ( const char *  groupName,
int32_t  nameLength,
UErrorCode status 
) const [virtual]

Get the group number corresponding to a named capture group.

The returned number can be used with any function that access capture groups by number.

The function returns an error status if the specified name does not appear in the pattern.

Parameters:
groupNameThe capture group name, platform invariant characters only.
nameLengthThe length of the name, or -1 if the name is nul-terminated.
statusA UErrorCode to receive any errors.
Stable:
ICU 55
virtual int32_t icu::final::handleNext ( int32_t  position,
UErrorCode status 
) [override, protected, virtual]

Search forward for matching text, starting at a given location.

Clients should not call this method directly; instead they should call SearchIterator#next.

If a match is found, this method returns the index at which the match starts and calls SearchIterator#setMatchLength with the number of characters in the target text that make up the match. If no match is found, the method returns USEARCH_DONE.

The StringSearch is adjusted so that its current index (as returned by getOffset) is the match position if one was found. If a match is not found, USEARCH_DONE will be returned and the StringSearch will be adjusted to the index USEARCH_DONE.

Parameters:
positionThe index in the target text at which the search starts
statusfor errors if any occurs
Returns:
The index at which the matched text in the target starts, or USEARCH_DONE if no match was found.
Stable:
ICU 2.0

Implements icu::SearchIterator.

virtual int32_t icu::final::handlePrev ( int32_t  position,
UErrorCode status 
) [override, protected, virtual]

Search backward for matching text, starting at a given location.

Clients should not call this method directly; instead they should call SearchIterator.previous(), which this method overrides.

If a match is found, this method returns the index at which the match starts and calls SearchIterator#setMatchLength with the number of characters in the target text that make up the match. If no match is found, the method returns USEARCH_DONE.

The StringSearch is adjusted so that its current index (as returned by getOffset) is the match position if one was found. If a match is not found, USEARCH_DONE will be returned and the StringSearch will be adjusted to the index USEARCH_DONE.

Parameters:
positionThe index in the target text at which the search starts.
statusfor errors if any occurs
Returns:
The index at which the matched text in the target starts, or USEARCH_DONE if no match was found.
Stable:
ICU 2.0

Implements icu::SearchIterator.

virtual UBool icu::final::hasAnchoringBounds ( ) const [virtual]

Return true if this matcher is using anchoring bounds.

By default, matchers use anchoring region bounds.

Returns:
true if this matcher is using anchoring bounds.
Stable:
ICU 4.0
UBool icu::final::hasChanges ( ) const [inline]
Returns:
true if there are any change edits
Stable:
ICU 59

Definition at line 177 of file edits.h.

virtual int32_t icu::final::hashCode ( ) const [override, virtual]

Generates the hash code for the rule-based collation object.

Returns:
the hash code.
Stable:
ICU 2.0

Implements icu::Collator.

virtual int32_t icu::final::hashCode ( void  ) const [virtual]

Returns the hash code value for this set.

Returns:
the hash code value for this set.
See also:
Object::hashCode()
Stable:
ICU 2.0

Implements icu::Collator.

Returns:
true if this set contains multi-character strings or the empty string.
Stable:
ICU 70
virtual UBool icu::final::hasTransparentBounds ( ) const [virtual]

Queries the transparency of region bounds for this matcher.

See useTransparentBounds for a description of transparent and opaque bounds. By default, a matcher uses opaque region boundaries.

Returns:
true if this matcher is using opaque bounds, false if it is not.
Stable:
ICU 4.0
virtual UBool icu::final::hitEnd ( ) const [virtual]

Return true if the most recent matching operation attempted to access additional input beyond the available input text.

In this case, additional input text could change the results of the match.

hitEnd() is defined for both successful and unsuccessful matches. In either case hitEnd() will return true if if the end of the text was reached at any point during the matching process.

Returns:
true if the most recent match hit the end of input
Stable:
ICU 4.0
int32_t icu::final::indexOf ( UChar32  c) const

Returns the index of the given character within this set, where the set is ordered by ascending code point.

If the character is not in this set, return -1. The inverse of this method is charAt().

Returns:
an index from 0..size()-1, or -1
Stable:
ICU 2.4
virtual const UnicodeString& icu::final::input ( ) const [virtual]

Returns the input string being matched.

Ownership of the string belongs to the matcher; it should not be altered or deleted. This method will work even if the input was originally supplied as a UText.

Returns:
the input string
Stable:
ICU 2.4
virtual UText* icu::final::inputText ( ) const [virtual]

Returns the input string being matched.

This is the live input text; it should not be altered or deleted. This method will work even if the input was originally supplied as a UnicodeString.

Returns:
the input text
Stable:
ICU 4.6
void icu::final::internalAddContractions ( UChar32  c,
UnicodeSet set,
UErrorCode errorCode 
) const

Adds the contractions that start with character c to the set.

Ignores prefixes. Used by AlphabeticIndex.

Internal:
Do not use. This API is for internal use only.
void icu::final::internalBuildTailoring ( const UnicodeString rules,
int32_t  strength,
UColAttributeValue  decompositionMode,
UParseError outParseError,
UnicodeString outReason,
UErrorCode errorCode 
)

Implements from-rule constructors, and ucol_openRules().

Internal:
Do not use. This API is for internal use only.
virtual UCollationResult icu::final::internalCompareUTF8 ( const char *  left,
int32_t  leftLength,
const char *  right,
int32_t  rightLength,
UErrorCode errorCode 
) const [override, virtual]

Implements ucol_strcollUTF8().

Internal:
Do not use. This API is for internal use only.

Reimplemented from icu::Collator.

void icu::final::internalGetCEs ( const UnicodeString str,
UVector64 &  ces,
UErrorCode errorCode 
) const

Appends the CEs for the string to the vector.

Internal:
Do not use. This API is for internal use only. for tests & tools
void icu::final::internalGetContractionsAndExpansions ( UnicodeSet contractions,
UnicodeSet expansions,
UBool  addPrefixes,
UErrorCode errorCode 
) const

Implements ucol_getContractionsAndExpansions().

Gets this collator's sets of contraction strings and/or characters and strings that map to multiple collation elements (expansions). If addPrefixes is true, then contractions that are expressed as prefix/pre-context rules are included.

Parameters:
contractionsif not nullptr, the set to hold the contractions
expansionsif not nullptr, the set to hold the expansions
addPrefixesinclude prefix contextual mappings
errorCodein/out ICU error code
Internal:
Do not use. This API is for internal use only.
const char* icu::final::internalGetLocaleID ( ULocDataLocaleType  type,
UErrorCode errorCode 
) const

Implements ucol_getLocaleByType().

Needed because the lifetime of the locale ID string must match that of the collator. getLocale() returns a copy of a Locale, with minimal lifetime in a C wrapper.

Internal:
Do not use. This API is for internal use only.
virtual int32_t icu::final::internalGetShortDefinitionString ( const char *  locale,
char *  buffer,
int32_t  capacity,
UErrorCode status 
) const [override, virtual]

Get the short definition string for a collator.

This internal API harvests the collator's locale and the attribute set and produces a string that can be used for opening a collator with the same attributes using the ucol_openFromShortString API. This string will be normalized. The structure and the syntax of the string is defined in the "Naming collators" section of the users guide: https://unicode-org.github.io/icu/userguide/collation/concepts#collator-naming-scheme This function supports preflighting.

This is internal, and intended to be used with delegate converters.

Parameters:
localea locale that will appear as a collators locale in the resulting short string definition. If nullptr, the locale will be harvested from the collator.
bufferspace to hold the resulting string
capacitycapacity of the buffer
statusfor returning errors. All the preflighting errors are featured
Returns:
length of the resulting string
See also:
ucol_openFromShortString
ucol_normalizeShortDefinitionString
ucol_getShortDefinitionString
Internal:
Do not use. This API is for internal use only.

Reimplemented from icu::Collator.

virtual int32_t icu::final::internalNextSortKeyPart ( UCharIterator iter,
uint32_t  state[2],
uint8_t *  dest,
int32_t  count,
UErrorCode errorCode 
) const [override, virtual]

Implements ucol_nextSortKeyPart().

Internal:
Do not use. This API is for internal use only.

Reimplemented from icu::Collator.

UBool icu::final::isBogus ( void  ) const [inline]

Determine if this object contains a valid set.

A bogus set has no value. It is different from an empty set. It can be used to indicate that no set value is available.

Returns:
true if the set is bogus/invalid, false otherwise
See also:
setToBogus()
Stable:
ICU 4.0
virtual UBool icu::final::isEmpty ( void  ) const [virtual]

Returns true if this set contains no elements.

Returns:
true if this set contains no elements.
Stable:
ICU 2.0
UBool icu::final::isFrozen ( ) const [inline]

Determines whether the set has been frozen (made immutable) or not.

See the ICU4J Freezable interface for details.

Returns:
true/false for whether the set has been frozen
See also:
freeze
cloneAsThawed
Stable:
ICU 3.8
static UBool icu::final::isIgnorable ( int32_t  order) [inline, static]

Checks if a comparison order is ignorable.

Parameters:
orderthe collation order.
Returns:
true if a character is ignorable, false otherwise.
Stable:
ICU 2.0
UBool icu::final::isString ( ) const [inline]

Returns true if the current element is a string.

If so, the caller can retrieve it with getString(). If this method returns false, the current element is a code point or code point range, depending on whether next() or nextRange() was called. Elements of types string and codepoint can both be retrieved with the function getString(). Elements of type codepoint can also be retrieved with getCodepoint(). For ranges, getCodepoint() returns the starting codepoint of the range, and getCodepointEnd() returns the end of the range.

Stable:
ICU 2.4
int32_t icu::final::lengthDelta ( ) const [inline]

How much longer is the new text compared with the old text?

Returns:
new length minus old length
Stable:
ICU 59

Definition at line 172 of file edits.h.

virtual UBool icu::final::lookingAt ( UErrorCode status) [virtual]

Attempts to match the input string, starting from the beginning of the region, against the pattern.

Like the matches() method, this function always starts at the beginning of the input region; unlike that function, it does not require that the entire region be matched.

If the match succeeds then more information can be obtained via the start(), end(), and group() functions.

Parameters:
statusA reference to a UErrorCode to receive any errors.
Returns:
true if there is a match at the start of the input string.
Stable:
ICU 2.4
virtual UBool icu::final::lookingAt ( int64_t  startIndex,
UErrorCode status 
) [virtual]

Attempts to match the input string, starting from the specified index, against the pattern.

The match may be of any length, and is not required to extend to the end of the input string. Contrast with match().

If the match succeeds then more information can be obtained via the start(), end(), and group() functions.

Parameters:
startIndexThe input string (native) index at which to begin matching.
statusA reference to a UErrorCode to receive any errors.
Returns:
true if there is a match.
Stable:
ICU 2.8
virtual RegexMatcher* icu::final::matcher ( const UnicodeString input,
UErrorCode status 
) const [virtual]

Creates a RegexMatcher that will match the given input against this pattern.

The RegexMatcher can then be used to perform match, find or replace operations on the input. Note that a RegexPattern object must not be deleted while RegexMatchers created from it still exist and might possibly be used again.

The matcher will retain a reference to the supplied input string, and all regexp pattern matching operations happen directly on this original string. It is critical that the string not be altered or deleted before use by the regular expression operations is complete.

Parameters:
inputThe input string to which the regular expression will be applied.
statusA reference to a UErrorCode to receive any errors.
Returns:
A RegexMatcher object for this pattern and input.
Stable:
ICU 2.4
virtual RegexMatcher* icu::final::matcher ( UErrorCode status) const [virtual]

Creates a RegexMatcher that will match against this pattern.

The RegexMatcher can be used to perform match, find or replace operations. Note that a RegexPattern object must not be deleted while RegexMatchers created from it still exist and might possibly be used again.

Parameters:
statusA reference to a UErrorCode to receive any errors.
Returns:
A RegexMatcher object for this pattern and input.
Stable:
ICU 2.6
static UBool icu::final::matches ( const UnicodeString regex,
const UnicodeString input,
UParseError pe,
UErrorCode status 
) [static]

Test whether a string matches a regular expression.

This convenience function both compiles the regular expression and applies it in a single operation. Note that if the same pattern needs to be applied repeatedly, this method will be less efficient than creating and reusing a RegexMatcher object.

Parameters:
regexThe regular expression
inputThe string data to be matched
peReceives the position of any syntax errors within the regular expression
statusA reference to a UErrorCode to receive any errors.
Returns:
True if the regular expression exactly matches the full input string.
Stable:
ICU 2.4
static UBool icu::final::matches ( UText regex,
UText input,
UParseError pe,
UErrorCode status 
) [static]

Test whether a string matches a regular expression.

This convenience function both compiles the regular expression and applies it in a single operation. Note that if the same pattern needs to be applied repeatedly, this method will be less efficient than creating and reusing a RegexMatcher object.

Parameters:
regexThe regular expression
inputThe string data to be matched
peReceives the position of any syntax errors within the regular expression
statusA reference to a UErrorCode to receive any errors.
Returns:
True if the regular expression exactly matches the full input string.
Stable:
ICU 4.6
virtual UBool icu::final::matches ( UErrorCode status) [virtual]

Attempts to match the entire input region against the pattern.

Parameters:
statusA reference to a UErrorCode to receive any errors.
Returns:
true if there is a match
Stable:
ICU 2.4
virtual UBool icu::final::matches ( int64_t  startIndex,
UErrorCode status 
) [virtual]

Resets the matcher, then attempts to match the input beginning at the specified startIndex, and extending to the end of the input.

The input region is reset to include the entire input string. A successful match must extend to the end of the input.

Parameters:
startIndexThe input string (native) index at which to begin matching.
statusA reference to a UErrorCode to receive any errors.
Returns:
true if there is a match
Stable:
ICU 2.8
virtual UMatchDegree icu::final::matches ( const Replaceable text,
int32_t &  offset,
int32_t  limit,
UBool  incremental 
) [override, virtual]

Implement UnicodeMatcher::matches()

Stable:
ICU 2.4

Reimplemented from icu::UnicodeFilter.

Edits& icu::final::mergeAndAppend ( const Edits ab,
const Edits bc,
UErrorCode errorCode 
)

Merges the two input Edits and appends the result to this object.

Consider two string transformations (for example, normalization and case mapping) where each records Edits in addition to writing an output string.
Edits ab reflect how substrings of input string a map to substrings of intermediate string b.
Edits bc reflect how substrings of intermediate string b map to substrings of output string c.
This function merges ab and bc such that the additional edits recorded in this object reflect how substrings of input string a map to substrings of output string c.

If unrelated Edits are passed in where the output string of the first has a different length than the input string of the second, then a U_ILLEGAL_ARGUMENT_ERROR is reported.

Parameters:
abreflects how substrings of input string a map to substrings of intermediate string b.
bcreflects how substrings of intermediate string b map to substrings of output string c.
errorCodeICU error code. Its input value must pass the U_SUCCESS() test, or else the function returns immediately. Check for U_FAILURE() on output or use with function chaining. (See User Guide for details.)
Returns:
*this, with the merged edits appended
Stable:
ICU 60

Get the next canonically equivalent string.


Warning: The strings are not guaranteed to be in any particular order.

Returns:
the next string that is canonically equivalent. A bogus string is returned when the iteration is done.
Stable:
ICU 2.4
int32_t icu::final::next ( UErrorCode status)

Gets the ordering priority of the next character in the string.

Parameters:
statusthe error code status.
Returns:
the next character's ordering. otherwise returns NULLORDER if an error has occurred or if the end of string has been reached
Stable:
ICU 2.0

Reimplemented from icu::SearchIterator.

Advances the iteration position to the next element in the set, which can be either a single code point or a string.

If there are no more elements in the set, return false.

If isString() == true, the value is a string, otherwise the value is a single code point. Elements of either type can be retrieved with the function getString(), while elements of consisting of a single code point can be retrieved with getCodepoint()

The order of iteration is all code points in sorted order, followed by all strings sorted order. Do not mix calls to next() and nextRange() without calling reset() between them. The results of doing so are undefined.

Returns:
true if there was another element in the set.
Stable:
ICU 2.4

Returns the next element in the set, either a code point range or a string.

If there are no more elements in the set, return false. If isString() == true, the value is a string and can be accessed with getString(). Otherwise the value is a range of one or more code points from getCodepoint() to getCodepointeEnd() inclusive.

The order of iteration is all code points ranges in sorted order, followed by all strings sorted order. Ranges are disjoint and non-contiguous. The value returned from getString() is undefined unless isString() == true. Do not mix calls to next() and nextRange() without calling reset() between them. The results of doing so are undefined.

Returns:
true if there was another element in the set.
Stable:
ICU 2.4
int32_t icu::final::numberOfChanges ( ) const [inline]
Returns:
the number of change edits
Stable:
ICU 60

Definition at line 183 of file edits.h.

icu::final::operator char16_t * ( ) const [inline]

char16_t pointer access via type conversion (e.g., static_cast).

Returns:
the wrapped pointer
Stable:
ICU 59

Definition at line 90 of file char16ptr.h.

icu::final::operator const char16_t * ( ) const [inline]

char16_t pointer access via type conversion (e.g., static_cast).

Returns:
the wrapped pointer
Stable:
ICU 59

Definition at line 198 of file char16ptr.h.

bool icu::final::operator!= ( const RegexPattern &  that) const [inline]

Comparison operator.

Two RegexPattern objects are considered equal if they were constructed from identical source patterns using the same URegexpFlag settings.

Parameters:
thata RegexPattern object to compare with "this".
Returns:
true if the objects are different.
Stable:
ICU 2.4

Definition at line 132 of file regex.h.

References icu::operator==().

bool icu::final::operator!= ( const CollationElementIterator &  other) const

Returns true if "other" is not the same as "this".

Parameters:
otherthe object to be compared
Returns:
true if "other" is not the same as "this"
Stable:
ICU 2.0
bool icu::final::operator!= ( const DateFormatSymbols other) const [inline]

Return true if another object is semantically unequal to this one.

Parameters:
otherthe DateFormatSymbols object to be compared with.
Returns:
true if other is semantically unequal to this.
Stable:
ICU 2.0

Definition at line 186 of file dtfmtsym.h.

References icu::operator==().

bool icu::final::operator!= ( const DateIntervalInfo other) const

Return true if another object is semantically unequal to this one.

Parameters:
otherthe DateIntervalInfo object to be compared with.
Returns:
true if other is semantically unequal to this.
Stable:
ICU 4.0
bool icu::final::operator!= ( const UnicodeSet o) const [inline]

Compares the specified object with this set for equality.

Returns true if the specified set is not equal to this set.

Stable:
ICU 2.0
SimpleFormatter& icu::final::operator= ( const SimpleFormatter other)

Assignment operator.

Stable:
ICU 57
Edits& icu::final::operator= ( const Edits other)

Assignment operator.

Parameters:
othersource edits
Returns:
*this
Stable:
ICU 60
Edits& icu::final::operator= ( Edits &&  src)

Move assignment operator, might leave src empty.

This object will have the same contents that the source object had. The behavior is undefined if *this and src are the same object.

Parameters:
srcsource edits
Returns:
*this
Stable:
ICU 60
RegexPattern& icu::final::operator= ( const RegexPattern &  source)

Assignment operator.

After assignment, this RegexPattern will behave identically to the source object.

Stable:
ICU 2.4
DateFormatSymbols& icu::final::operator= ( const DateFormatSymbols )

Assignment operator.

Stable:
ICU 2.0
DateIntervalInfo& icu::final::operator= ( const DateIntervalInfo )

Assignment operator.

Stable:
ICU 4.0
RuleBasedCollator& icu::final::operator= ( const RuleBasedCollator &  other)

Assignment operator.

Parameters:
otherother RuleBasedCollator object to copy from.
Stable:
ICU 2.0
StringSearch& icu::final::operator= ( const StringSearch that)

Assignment operator.

Sets this iterator to have the same behavior, and iterate over the same text, as the one passed in.

Parameters:
thatinstance to be copied.
Stable:
ICU 2.0
UnicodeSet& icu::final::operator= ( const UnicodeSet o)

Assigns this object to be a copy of another.

A frozen set will not be modified.

Stable:
ICU 2.0
bool icu::final::operator== ( const RegexPattern &  that) const

Comparison operator.

Two RegexPattern objects are considered equal if they were constructed from identical source patterns using the same URegexpFlag settings.

Parameters:
thata RegexPattern object to compare with "this".
Returns:
true if the objects are equivalent.
Stable:
ICU 2.4
bool icu::final::operator== ( const CollationElementIterator &  other) const

Returns true if "other" is the same as "this".

Parameters:
otherthe object to be compared
Returns:
true if "other" is the same as "this"
Stable:
ICU 2.0
bool icu::final::operator== ( const DateFormatSymbols other) const

Return true if another object is semantically equal to this one.

Parameters:
otherthe DateFormatSymbols object to be compared with.
Returns:
true if other is semantically equal to this.
Stable:
ICU 2.0
virtual bool icu::final::operator== ( const DateIntervalInfo other) const [virtual]

Return true if another object is semantically equal to this one.

Parameters:
otherthe DateIntervalInfo object to be compared with.
Returns:
true if other is semantically equal to this.
Stable:
ICU 4.0
virtual bool icu::final::operator== ( const Collator other) const [override, virtual]

Returns true if argument is the same as this object.

Parameters:
otherCollator object to be compared.
Returns:
true if arguments is the same as this object.
Stable:
ICU 2.0

Reimplemented from icu::Collator.

virtual bool icu::final::operator== ( const SearchIterator that) const [override, virtual]

Equality operator.

Parameters:
thatinstance to be compared.
Returns:
true if both instances have the same attributes, breakiterators, collators and iterate over the same text while looking for the same pattern.
Stable:
ICU 2.0

Reimplemented from icu::SearchIterator.

virtual bool icu::final::operator== ( const UnicodeSet o) const [virtual]

Compares the specified object with this set for equality.

Returns true if the two sets have the same size, and every member of the specified set is contained in this set (or equivalently, every member of this set is contained in the specified set).

Parameters:
oset to be compared for equality with this set.
Returns:
true if the specified set is equal to this set.
Stable:
ICU 2.0
virtual UnicodeString icu::final::pattern ( ) const [virtual]

Returns the regular expression from which this pattern was compiled.

This method will work even if the pattern was compiled from a UText.

Note: If the pattern was originally compiled from a UText, and that UText was modified, the returned string may no longer reflect the RegexPattern object.

Stable:
ICU 2.4
virtual const RegexPattern& icu::final::pattern ( ) const [virtual]

Returns the pattern that is interpreted by this matcher.

Returns:
the RegexPattern for this RegexMatcher
Stable:
ICU 2.4
virtual UText* icu::final::patternText ( UErrorCode status) const [virtual]

Returns the regular expression from which this pattern was compiled.

This method will work even if the pattern was compiled from a UnicodeString.

Note: This is the original input, not a clone. If the pattern was originally compiled from a UText, and that UText was modified, the returned UText may no longer reflect the RegexPattern object.

Stable:
ICU 4.6
static void icu::final::permute ( UnicodeString source,
UBool  skipZeros,
Hashtable *  result,
UErrorCode status 
) [static]

Dumb recursive implementation of permutation.

TODO: optimize

Parameters:
sourcethe string to find permutations for
skipZerosdetermine if skip zeros
resultthe results in a set.
statusFill-in parameter which receives the status of this operation.
Internal:
Do not use. This API is for internal use only.
int32_t icu::final::previous ( UErrorCode status)

Get the ordering priority of the previous collation element in the string.

Parameters:
statusthe error code status.
Returns:
the previous element's ordering. otherwise returns NULLORDER if an error has occurred or if the start of string has been reached
Stable:
ICU 2.0

Reimplemented from icu::SearchIterator.

static int32_t icu::final::primaryOrder ( int32_t  order) [inline, static]

Gets the primary order of a collation order.

Parameters:
orderthe collation order
Returns:
the primary order of a collation order.
Stable:
ICU 2.0
static RuleBasedCollator* icu::final::rbcFromUCollator ( UCollator uc) [inline, static]
Internal:
Do not use.

This API is for internal use only.

Definition at line 786 of file tblcoll.h.

static const RuleBasedCollator* icu::final::rbcFromUCollator ( const UCollator uc) [inline, static]
Internal:
Do not use.

This API is for internal use only.

Definition at line 790 of file tblcoll.h.

virtual RegexMatcher& icu::final::refreshInputText ( UText input,
UErrorCode status 
) [virtual]

Set the subject text string upon which the regular expression is looking for matches without changing any other aspect of the matching state.

The new and previous text strings must have the same content.

This function is intended for use in environments where ICU is operating on strings that may move around in memory. It provides a mechanism for notifying ICU that the string has been relocated, and providing a new UText to access the string in its new position.

Note that the regular expression implementation never copies the underlying text of a string being matched, but always operates directly on the original text provided by the user. Refreshing simply drops the references to the old text and replaces them with references to the new.

Caution: this function is normally used only by very specialized, system-level code. One example use case is with garbage collection that moves the text in memory.

Parameters:
inputThe new (moved) text string.
statusReceives errors detected by this function.
Stable:
ICU 4.8
icu::final::RegexMatcher ( const UnicodeString regexp,
uint32_t  flags,
UErrorCode status 
)

Construct a RegexMatcher for a regular expression.

This is a convenience method that avoids the need to explicitly create a RegexPattern object. Note that if several RegexMatchers need to be created for the same expression, it will be more efficient to separately create and cache a RegexPattern object, and use its matcher() method to create the RegexMatcher objects.

Parameters:
regexpThe Regular Expression to be compiled.
flagsURegexpFlag options, such as UREGEX_CASE_INSENSITIVE.
statusAny errors are reported by setting this UErrorCode variable.
Stable:
ICU 2.6
icu::final::RegexMatcher ( UText regexp,
uint32_t  flags,
UErrorCode status 
)

Construct a RegexMatcher for a regular expression.

This is a convenience method that avoids the need to explicitly create a RegexPattern object. Note that if several RegexMatchers need to be created for the same expression, it will be more efficient to separately create and cache a RegexPattern object, and use its matcher() method to create the RegexMatcher objects.

Parameters:
regexpThe regular expression to be compiled.
flagsURegexpFlag options, such as UREGEX_CASE_INSENSITIVE.
statusAny errors are reported by setting this UErrorCode variable.
Stable:
ICU 4.6
icu::final::RegexMatcher ( const UnicodeString regexp,
const UnicodeString input,
uint32_t  flags,
UErrorCode status 
)

Construct a RegexMatcher for a regular expression.

This is a convenience method that avoids the need to explicitly create a RegexPattern object. Note that if several RegexMatchers need to be created for the same expression, it will be more efficient to separately create and cache a RegexPattern object, and use its matcher() method to create the RegexMatcher objects.

The matcher will retain a reference to the supplied input string, and all regexp pattern matching operations happen directly on the original string. It is critical that the string not be altered or deleted before use by the regular expression operations is complete.

Parameters:
regexpThe Regular Expression to be compiled.
inputThe string to match. The matcher retains a reference to the caller's string; mo copy is made.
flagsURegexpFlag options, such as UREGEX_CASE_INSENSITIVE.
statusAny errors are reported by setting this UErrorCode variable.
Stable:
ICU 2.6
icu::final::RegexMatcher ( UText regexp,
UText input,
uint32_t  flags,
UErrorCode status 
)

Construct a RegexMatcher for a regular expression.

This is a convenience method that avoids the need to explicitly create a RegexPattern object. Note that if several RegexMatchers need to be created for the same expression, it will be more efficient to separately create and cache a RegexPattern object, and use its matcher() method to create the RegexMatcher objects.

The matcher will make a shallow clone of the supplied input text, and all regexp pattern matching operations happen on this clone. While read-only operations on the supplied text are permitted, it is critical that the underlying string not be altered or deleted before use by the regular expression operations is complete.

Parameters:
regexpThe Regular Expression to be compiled.
inputThe string to match. The matcher retains a shallow clone of the text.
flagsURegexpFlag options, such as UREGEX_CASE_INSENSITIVE.
statusAny errors are reported by setting this UErrorCode variable.
Stable:
ICU 4.6
icu::final::RegexPattern ( )

default constructor.

Create a RegexPattern object that refers to no actual pattern. Not normally needed; RegexPattern objects are usually created using the factory method `compile()`.

Stable:
ICU 2.4
icu::final::RegexPattern ( const RegexPattern &  source)

Copy Constructor.

Create a new RegexPattern object that is equivalent to the source object.

Parameters:
sourcethe pattern object to be copied.
Stable:
ICU 2.4
virtual RegexMatcher& icu::final::region ( int64_t  start,
int64_t  limit,
UErrorCode status 
) [virtual]

Sets the limits of this matcher's region.

The region is the part of the input string that will be searched to find a match. Invoking this method resets the matcher, and then sets the region to start at the index specified by the start parameter and end at the index specified by the end parameter.

Depending on the transparency and anchoring being used (see useTransparentBounds and useAnchoringBounds), certain constructs such as anchors may behave differently at or around the boundaries of the region

The function will fail if start is greater than limit, or if either index is less than zero or greater than the length of the string being matched.

Parameters:
startThe (native) index to begin searches at.
limitThe index to end searches at (exclusive).
statusA reference to a UErrorCode to receive any errors.
Stable:
ICU 4.0
virtual RegexMatcher& icu::final::region ( int64_t  regionStart,
int64_t  regionLimit,
int64_t  startIndex,
UErrorCode status 
) [virtual]

Identical to region(start, limit, status) but also allows a start position without resetting the region state.

Parameters:
regionStartThe region start
regionLimitthe limit of the region
startIndexThe (native) index within the region bounds at which to begin searches.
statusA reference to a UErrorCode to receive any errors. If startIndex is not within the specified region bounds, U_INDEX_OUTOFBOUNDS_ERROR is returned.
Stable:
ICU 4.6
virtual int32_t icu::final::regionEnd ( ) const [virtual]

Reports the end (limit) index (exclusive) of this matcher's region.

The searches this matcher conducts are limited to finding matches within regionStart (inclusive) and regionEnd (exclusive).

Returns:
The ending point (native) of this matcher's region.
Stable:
ICU 4.0
virtual int64_t icu::final::regionEnd64 ( ) const [virtual]

Reports the end (limit) index (exclusive) of this matcher's region.

The searches this matcher conducts are limited to finding matches within regionStart (inclusive) and regionEnd (exclusive).

Returns:
The ending point (native) of this matcher's region.
Stable:
ICU 4.6
virtual int32_t icu::final::regionStart ( ) const [virtual]

Reports the start index of this matcher's region.

The searches this matcher conducts are limited to finding matches within regionStart (inclusive) and regionEnd (exclusive).

Returns:
The starting (native) index of this matcher's region.
Stable:
ICU 4.0
virtual int64_t icu::final::regionStart64 ( ) const [virtual]

Reports the start index of this matcher's region.

The searches this matcher conducts are limited to finding matches within regionStart (inclusive) and regionEnd (exclusive).

Returns:
The starting (native) index of this matcher's region.
Stable:
ICU 4.6
virtual UnicodeSet& icu::final::remove ( UChar32  start,
UChar32  end 
) [virtual]

Removes the specified range from this set if it is present.

The set will not contain the specified range once the call returns. If start > end then an empty range is removed, leaving the set unchanged. A frozen set will not be modified.

Parameters:
startfirst character, inclusive, of range to be removed from this set.
endlast character, inclusive, of range to be removed from this set.
Stable:
ICU 2.0

Removes the specified character from this set if it is present.

The set will not contain the specified range once the call returns. A frozen set will not be modified.

Parameters:
cthe character (code point)
Returns:
this object, for chaining
Stable:
ICU 2.0

Removes the specified string from this set if it is present.

The set will not contain the specified character once the call returns. A frozen set will not be modified.

Parameters:
sthe source string
Returns:
this object, for chaining
Stable:
ICU 2.4

Remove EACH of the characters in this string.

Note: "ch" == {"c", "h"} A frozen set will not be modified.

Parameters:
sthe source string
Returns:
this object, for chaining
Stable:
ICU 2.4
virtual UnicodeSet& icu::final::removeAll ( const UnicodeSet c) [virtual]

Removes from this set all of its elements that are contained in the specified set.

This operation effectively modifies this set so that its value is the asymmetric set difference of the two sets. A frozen set will not be modified.

Parameters:
cset that defines which elements will be removed from this set.
Stable:
ICU 2.0
virtual UnicodeSet& icu::final::removeAllStrings ( ) [virtual]

Remove all strings from this set.

Returns:
a reference to this set.
Stable:
ICU 4.2
virtual UnicodeString icu::final::replaceAll ( const UnicodeString replacement,
UErrorCode status 
) [virtual]

Replaces every substring of the input that matches the pattern with the given replacement string.

This is a convenience function that provides a complete find-and-replace-all operation.

This method first resets this matcher. It then scans the input string looking for matches of the pattern. Input that is not part of any match is left unchanged; each match is replaced in the result by the replacement string. The replacement string may contain references to capture groups.

Parameters:
replacementa string containing the replacement text.
statusa reference to a UErrorCode to receive any errors.
Returns:
a string containing the results of the find and replace.
Stable:
ICU 2.4
virtual UText* icu::final::replaceAll ( UText replacement,
UText dest,
UErrorCode status 
) [virtual]

Replaces every substring of the input that matches the pattern with the given replacement string.

This is a convenience function that provides a complete find-and-replace-all operation.

This method first resets this matcher. It then scans the input string looking for matches of the pattern. Input that is not part of any match is left unchanged; each match is replaced in the result by the replacement string. The replacement string may contain references to capture groups.

Parameters:
replacementa string containing the replacement text.
desta mutable UText in which the results are placed. If nullptr, a new UText will be created (which may not be mutable).
statusa reference to a UErrorCode to receive any errors.
Returns:
a string containing the results of the find and replace. If a pre-allocated UText was provided, it will always be used and returned.
Stable:
ICU 4.6
virtual UnicodeString icu::final::replaceFirst ( const UnicodeString replacement,
UErrorCode status 
) [virtual]

Replaces the first substring of the input that matches the pattern with the replacement string.

This is a convenience function that provides a complete find-and-replace operation.

This function first resets this RegexMatcher. It then scans the input string looking for a match of the pattern. Input that is not part of the match is appended directly to the result string; the match is replaced in the result by the replacement string. The replacement string may contain references to captured groups.

The state of the matcher (the position at which a subsequent find() would begin) after completing a replaceFirst() is not specified. The RegexMatcher should be reset before doing additional find() operations.

Parameters:
replacementa string containing the replacement text.
statusa reference to a UErrorCode to receive any errors.
Returns:
a string containing the results of the find and replace.
Stable:
ICU 2.4
virtual UText* icu::final::replaceFirst ( UText replacement,
UText dest,
UErrorCode status 
) [virtual]

Replaces the first substring of the input that matches the pattern with the replacement string.

This is a convenience function that provides a complete find-and-replace operation.

This function first resets this RegexMatcher. It then scans the input string looking for a match of the pattern. Input that is not part of the match is appended directly to the result string; the match is replaced in the result by the replacement string. The replacement string may contain references to captured groups.

The state of the matcher (the position at which a subsequent find() would begin) after completing a replaceFirst() is not specified. The RegexMatcher should be reset before doing additional find() operations.

Parameters:
replacementa string containing the replacement text.
desta mutable UText in which the results are placed. If nullptr, a new UText will be created (which may not be mutable).
statusa reference to a UErrorCode to receive any errors.
Returns:
a string containing the results of the find and replace. If a pre-allocated UText was provided, it will always be used and returned.
Stable:
ICU 4.6
virtual UBool icu::final::requireEnd ( ) const [virtual]

Return true the most recent match succeeded and additional input could cause it to fail.

If this method returns false and a match was found, then more input might change the match but the match won't be lost. If a match was not found, then requireEnd has no meaning.

Returns:
true if more input could cause the most recent match to no longer match.
Stable:
ICU 4.0
static UBool icu::final::resemblesPattern ( const UnicodeString pattern,
int32_t  pos 
) [static]

Return true if the given position, in the given pattern, appears to be the start of a UnicodeSet pattern.

Stable:
ICU 2.4
void icu::final::reset ( ) [virtual]

Resets the iterator so that one can start again from the beginning.

Stable:
ICU 2.4

Reimplemented from icu::SearchIterator.

void icu::final::reset ( ) [virtual]

Resets the data but may not release memory.

Stable:
ICU 59

Reimplemented from icu::SearchIterator.

void icu::final::reset ( void  ) [virtual]

Resets the cursor to the beginning of the string.

Stable:
ICU 2.0

Reimplemented from icu::SearchIterator.

void icu::final::reset ( const UnicodeSet set)

Sets this iterator to visit the elements of the given set and resets it to the start of that set.

The iterator is valid only so long as set is valid.

Parameters:
setthe set to iterate over.
Stable:
ICU 2.4
void icu::final::reset ( ) [virtual]

Resets this iterator to the start of the set.

Stable:
ICU 2.4

Reimplemented from icu::SearchIterator.

virtual void icu::final::reset ( ) [override, virtual]

Reset the iteration.

Search will begin at the start of the text string if a forward iteration is initiated before a backwards iteration. Otherwise if a backwards iteration is initiated before a forwards iteration, the search will begin at the end of the text string.

Stable:
ICU 2.0

Reimplemented from icu::SearchIterator.

virtual RegexMatcher& icu::final::reset ( ) [virtual]

Resets this matcher.

The effect is to remove any memory of previous matches, and to cause subsequent find() operations to begin at the beginning of the input string.

Returns:
this RegexMatcher.
Stable:
ICU 2.4

Reimplemented from icu::SearchIterator.

virtual RegexMatcher& icu::final::reset ( int64_t  index,
UErrorCode status 
) [virtual]

Resets this matcher, and set the current input position.

The effect is to remove any memory of previous matches, and to cause subsequent find() operations to begin at the specified (native) position in the input string.

The matcher's region is reset to its default, which is the entire input string.

An alternative to this function is to set a match region beginning at the desired index.

Returns:
this RegexMatcher.
Stable:
ICU 2.8
virtual RegexMatcher& icu::final::reset ( const UnicodeString input) [virtual]

Resets this matcher with a new input string.

This allows instances of RegexMatcher to be reused, which is more efficient than creating a new RegexMatcher for each input string to be processed.

Parameters:
inputThe new string on which subsequent pattern matches will operate. The matcher retains a reference to the callers string, and operates directly on that. Ownership of the string remains with the caller. Because no copy of the string is made, it is essential that the caller not delete the string until after regexp operations on it are done. Note that while a reset on the matcher with an input string that is then modified across/during matcher operations may be supported currently for UnicodeString, this was not originally intended behavior, and support for this is not guaranteed in upcoming versions of ICU.
Returns:
this RegexMatcher.
Stable:
ICU 2.4
virtual RegexMatcher& icu::final::reset ( UText input) [virtual]

Resets this matcher with a new input string.

This allows instances of RegexMatcher to be reused, which is more efficient than creating a new RegexMatcher for each input string to be processed.

Parameters:
inputThe new string on which subsequent pattern matches will operate. The matcher makes a shallow clone of the given text; ownership of the original string remains with the caller. Because no deep copy of the text is made, it is essential that the caller not modify the string until after regexp operations on it are done.
Returns:
this RegexMatcher.
Stable:
ICU 4.6
Internal:
Do not use.

This API is for internal use only.

virtual UnicodeSet& icu::final::retain ( UChar32  start,
UChar32  end 
) [virtual]

Retain only the elements in this set that are contained in the specified range.

If start > end then an empty range is retained, leaving the set empty. This is equivalent to a boolean logic AND, or a set INTERSECTION. A frozen set will not be modified.

Parameters:
startfirst character, inclusive, of range
endlast character, inclusive, of range
Stable:
ICU 2.0

Retain the specified character from this set if it is present.

A frozen set will not be modified.

Parameters:
cthe character (code point)
Returns:
this object, for chaining
Stable:
ICU 2.0

Retains only the specified string from this set if it is present.

Upon return this set will be empty if it did not contain s, or will only contain s if it did contain s. A frozen set will not be modified.

Parameters:
sthe source string
Returns:
this object, for chaining
Stable:
ICU 69

Retains EACH of the characters in this string.

Note: "ch" == {"c", "h"} A frozen set will not be modified.

Parameters:
sthe source string
Returns:
this object, for chaining
Stable:
ICU 2.4
virtual UnicodeSet& icu::final::retainAll ( const UnicodeSet c) [virtual]

Retains only the elements in this set that are contained in the specified set.

In other words, removes from this set all of its elements that are not contained in the specified set. This operation effectively modifies this set so that its value is the intersection of the two sets. A frozen set will not be modified.

Parameters:
cset that defines which elements this set will retain.
Stable:
ICU 2.0
icu::final::RuleBasedCollator ( const UnicodeString rules,
UErrorCode status 
)

RuleBasedCollator constructor.

This takes the table rules and builds a collation table out of them. Please see RuleBasedCollator class description for more details on the collation rule syntax.

Parameters:
rulesthe collation rules to build the collation table from.
statusreporting a success or an error.
Stable:
ICU 2.0
icu::final::RuleBasedCollator ( const UnicodeString rules,
ECollationStrength  collationStrength,
UErrorCode status 
)

RuleBasedCollator constructor.

This takes the table rules and builds a collation table out of them. Please see RuleBasedCollator class description for more details on the collation rule syntax.

Parameters:
rulesthe collation rules to build the collation table from.
collationStrengthstrength for comparison
statusreporting a success or an error.
Stable:
ICU 2.0
icu::final::RuleBasedCollator ( const UnicodeString rules,
UColAttributeValue  decompositionMode,
UErrorCode status 
)

RuleBasedCollator constructor.

This takes the table rules and builds a collation table out of them. Please see RuleBasedCollator class description for more details on the collation rule syntax.

Parameters:
rulesthe collation rules to build the collation table from.
decompositionModethe normalisation mode
statusreporting a success or an error.
Stable:
ICU 2.0
icu::final::RuleBasedCollator ( const UnicodeString rules,
ECollationStrength  collationStrength,
UColAttributeValue  decompositionMode,
UErrorCode status 
)

RuleBasedCollator constructor.

This takes the table rules and builds a collation table out of them. Please see RuleBasedCollator class description for more details on the collation rule syntax.

Parameters:
rulesthe collation rules to build the collation table from.
collationStrengthstrength for comparison
decompositionModethe normalisation mode
statusreporting a success or an error.
Stable:
ICU 2.0
icu::final::RuleBasedCollator ( const UnicodeString rules,
UParseError parseError,
UnicodeString reason,
UErrorCode errorCode 
)

TODO: document & propose as public API.

Internal:
Do not use.

This API is for internal use only.

icu::final::RuleBasedCollator ( const RuleBasedCollator &  other)

Copy constructor.

Parameters:
otherthe RuleBasedCollator object to be copied
Stable:
ICU 2.0
icu::final::RuleBasedCollator ( const uint8_t *  bin,
int32_t  length,
const RuleBasedCollator *  base,
UErrorCode status 
)

Opens a collator from a collator binary image created using cloneBinary.

Binary image used in instantiation of the collator remains owned by the user and should stay around for the lifetime of the collator. The API also takes a base collator which must be the root collator.

Parameters:
binbinary image owned by the user and required through the lifetime of the collator
lengthsize of the image. If negative, the API will try to figure out the length of the image
baseBase collator, for lookup of untailored characters. Must be the root collator, must not be nullptr. The base is required to be present through the lifetime of the collator.
statusfor catching errors
Returns:
newly created collator
See also:
cloneBinary
Stable:
ICU 3.4
icu::final::RuleBasedCollator ( )

Only for use in ucol_openRules().

Internal:
Do not use. This API is for internal use only.
virtual StringSearch* icu::final::safeClone ( ) const [override, virtual]

Returns a copy of StringSearch with the same behavior, and iterating over the same text, as this one.

Note that all data will be replicated, except for the user-specified collator and the breakiterator.

Returns:
cloned object
Stable:
ICU 2.0

Reimplemented from icu::Collator.

static int32_t icu::final::secondaryOrder ( int32_t  order) [inline, static]

Gets the secondary order of a collation order.

Parameters:
orderthe collation order
Returns:
the secondary order of a collation order.
Stable:
ICU 2.0
int32_t icu::final::serialize ( uint16_t *  dest,
int32_t  destCapacity,
UErrorCode ec 
) const

Serializes this set into an array of 16-bit integers.

Serialization (currently) only records the characters in the set; multicharacter strings are ignored.

The array has following format (each line is one 16-bit integer):

length = (n+2*m) | (m!=0?0x8000:0) bmpLength = n; present if m!=0 bmp[0] bmp[1] ... bmp[n-1] supp-high[0] supp-low[0] supp-high[1] supp-low[1] ... supp-high[m-1] supp-low[m-1]

The array starts with a header. After the header are n bmp code points, then m supplementary code points. Either n or m or both may be zero. n+2*m is always <= 0x7FFF.

If there are no supplementary characters (if m==0) then the header is one 16-bit integer, 'length', with value n.

If there are supplementary characters (if m!=0) then the header is two 16-bit integers. The first, 'length', has value (n+2*m)|0x8000. The second, 'bmpLength', has value n.

After the header the code points are stored in ascending order. Supplementary code points are stored as most significant 16 bits followed by least significant 16 bits.

Parameters:
destpointer to buffer of destCapacity 16-bit integers. May be nullptr only if destCapacity is zero.
destCapacitysize of dest, or zero. Must not be negative.
ecerror code. Will be set to U_INDEX_OUTOFBOUNDS_ERROR if n+2*m > 0x7FFF. Will be set to U_BUFFER_OVERFLOW_ERROR if n+2*m+(m!=0?2:1) > destCapacity.
Returns:
the total length of the serialized format, including the header, that is, n+2*m+(m!=0?2:1), or 0 on error other than U_BUFFER_OVERFLOW_ERROR.
Stable:
ICU 2.4
UnicodeSet& icu::final::set ( UChar32  start,
UChar32  end 
)

Make this object represent the range `start - end`.

If `start > end` then this object is set to an empty range. A frozen set will not be modified.

Parameters:
startfirst character in the set, inclusive
endlast character in the set, inclusive
Stable:
ICU 2.4
void icu::final::setAmPmStrings ( const UnicodeString ampms,
int32_t  count 
)

Sets ampm strings.

For example: "AM" and "PM".

Parameters:
ampmsthe new ampm strings. (not adopted; caller retains ownership)
countFilled in with length of the array.
Stable:
ICU 2.0
virtual void icu::final::setAttribute ( UColAttribute  attr,
UColAttributeValue  value,
UErrorCode status 
) [override, virtual]

Universal attribute setter.

Parameters:
attrattribute type
valueattribute value
statusto indicate whether the operation went on smoothly or there were errors
Stable:
ICU 2.2

Implements icu::Collator.

void icu::final::setCollator ( RuleBasedCollator *  coll,
UErrorCode status 
)

Sets the collator used for the language rules.

User retains the ownership of this collator, thus the responsibility of deletion lies with the user. The iterator's position will not be changed by this method.

Parameters:
collcollator
statusfor errors if any
Stable:
ICU 2.0
void icu::final::setEraNames ( const UnicodeString eraNames,
int32_t  count 
)

Sets era name strings.

For example: "Anno Domini" and "Before Christ".

Parameters:
eraNamesArray of era name strings (DateFormatSymbols retains ownership.)
countFilled in with length of the array.
Stable:
ICU 3.6
void icu::final::setEras ( const UnicodeString eras,
int32_t  count 
)

Sets abbreviated era strings.

For example: "AD" and "BC".

Parameters:
erasArray of era strings (DateFormatSymbols retains ownership.)
countFilled in with length of the array.
Stable:
ICU 2.0
void icu::final::setFallbackIntervalPattern ( const UnicodeString fallbackPattern,
UErrorCode status 
)

Re-set the fallback interval pattern.

In construction, default fallback pattern is set as "{0} - {1}". And constructor taking locale as parameter will set the fallback pattern as what defined in the locale resource file.

This method provides a way for user to replace the fallback pattern.

Parameters:
fallbackPatternfall-back interval pattern.
statusoutput param set to success/failure code on exit
Stable:
ICU 4.0
virtual void icu::final::setFindProgressCallback ( URegexFindProgressCallback callback,
const void *  context,
UErrorCode status 
) [virtual]

Set a progress callback function for use with find operations on this Matcher.

During find operations, the callback will be invoked after each return from a match attempt, giving the application the opportunity to terminate a long-running find operation.

Parameters:
callbackA pointer to the user-supplied callback function.
contextUser context pointer. The value supplied at the time the callback function is set will be saved and passed to the callback each time that it is called.
statusA reference to a UErrorCode to receive any errors.
Stable:
ICU 4.6
void icu::final::setIntervalPattern ( const UnicodeString skeleton,
UCalendarDateFields  lrgDiffCalUnit,
const UnicodeString intervalPattern,
UErrorCode status 
)

Provides a way for client to build interval patterns.

User could construct DateIntervalInfo by providing a list of skeletons and their patterns.

For example:

 UErrorCode status = U_ZERO_ERROR;
 DateIntervalInfo dIntervalInfo = new DateIntervalInfo();
 dIntervalInfo->setFallbackIntervalPattern("{0} ~ {1}");
 dIntervalInfo->setIntervalPattern("yMd", UCAL_YEAR, "'from' yyyy-M-d 'to' yyyy-M-d", status);
 dIntervalInfo->setIntervalPattern("yMMMd", UCAL_MONTH, "'from' yyyy MMM d 'to' MMM d", status);
 dIntervalInfo->setIntervalPattern("yMMMd", UCAL_DAY, "yyyy MMM d-d", status, status);
 

Restriction: Currently, users can only set interval patterns when the following calendar fields are different: ERA, YEAR, MONTH, DATE, DAY_OF_MONTH, DAY_OF_WEEK, AM_PM, HOUR, HOUR_OF_DAY, MINUTE, SECOND and MILLISECOND. Interval patterns when other calendar fields are different are not supported.

Parameters:
skeletonthe skeleton on which interval pattern based
lrgDiffCalUnitthe largest different calendar unit.
intervalPatternthe interval pattern on the largest different calendar unit. For example, if lrgDiffCalUnit is "year", the interval pattern for en_US when year is different could be "'from' yyyy 'to' yyyy".
statusoutput param set to success/failure code on exit
Stable:
ICU 4.0
virtual void icu::final::setLocales ( const Locale requestedLocale,
const Locale validLocale,
const Locale actualLocale 
) [override, protected, virtual]

Used internally by registration to define the requested and valid locales.

Parameters:
requestedLocalethe requested locale
validLocalethe valid locale
actualLocalethe actual locale
Internal:
Do not use. This API is for internal use only.

Reimplemented from icu::Collator.

void icu::final::setLocalPatternChars ( const UnicodeString newLocalPatternChars)

Sets localized date-time pattern characters.

For example: 'u', 't', etc.

Parameters:
newLocalPatternCharsthe new localized date-time pattern characters.
Stable:
ICU 2.0
virtual void icu::final::setMatchCallback ( URegexMatchCallback callback,
const void *  context,
UErrorCode status 
) [virtual]

Set a callback function for use with this Matcher.

During matching operations the function will be called periodically, giving the application the opportunity to terminate a long-running match.

Parameters:
callbackA pointer to the user-supplied callback function.
contextUser context pointer. The value supplied at the time the callback function is set will be saved and passed to the callback each time that it is called.
statusA reference to a UErrorCode to receive any errors.
Stable:
ICU 4.0
virtual Collator& icu::final::setMaxVariable ( UColReorderCode  group,
UErrorCode errorCode 
) [override, virtual]

Sets the variable top to the top of the specified reordering group.

The variable top determines the highest-sorting character which is affected by UCOL_ALTERNATE_HANDLING. If that attribute is set to UCOL_NON_IGNORABLE, then the variable top has no effect.

Parameters:
groupone of UCOL_REORDER_CODE_SPACE, UCOL_REORDER_CODE_PUNCTUATION, UCOL_REORDER_CODE_SYMBOL, UCOL_REORDER_CODE_CURRENCY; or UCOL_REORDER_CODE_DEFAULT to restore the default max variable group
errorCodeStandard ICU error code. Its input value must pass the U_SUCCESS() test, or else the function returns immediately. Check for U_FAILURE() on output or use with function chaining. (See User Guide for details.)
Returns:
*this
See also:
getMaxVariable
Stable:
ICU 53

Reimplemented from icu::Collator.

void icu::final::setMonths ( const UnicodeString months,
int32_t  count 
)

Sets month strings.

For example: "January", "February", etc.

Parameters:
monthsthe new month strings. (not adopted; caller retains ownership)
countFilled in with length of the array.
Stable:
ICU 2.0
void icu::final::setMonths ( const UnicodeString months,
int32_t  count,
DtContextType  context,
DtWidthType  width 
)

Sets month strings by width and context.

For example: "January", "February", etc.

Parameters:
monthsThe new month strings. (not adopted; caller retains ownership)
countFilled in with length of the array.
contextThe formatting context, either FORMAT or STANDALONE
widthThe width of returned strings, either WIDE, ABBREVIATED, or NARROW.
Stable:
ICU 3.6
void icu::final::setNarrowEras ( const UnicodeString narrowEras,
int32_t  count 
)

Sets narrow era strings.

For example: "A" and "B".

Parameters:
narrowErasArray of narrow era strings (DateFormatSymbols retains ownership.)
countFilled in with length of the array.
Stable:
ICU 4.2
void icu::final::setOffset ( int32_t  newOffset,
UErrorCode status 
) [virtual]

Sets the offset of the currently processed character in the source string.

Parameters:
newOffsetthe new offset.
statusthe error code status.
Returns:
the offset of the character.
Stable:
ICU 2.0

Implements icu::SearchIterator.

virtual void icu::final::setOffset ( int32_t  position,
UErrorCode status 
) [override, virtual]

Sets the index to point to the given position, and clears any state that's affected.

This method takes the argument index and sets the position in the text string accordingly without checking if the index is pointing to a valid starting point to begin searching.

Parameters:
positionwithin the text to be set. If position is less than or greater than the text range for searching, an U_INDEX_OUTOFBOUNDS_ERROR will be returned
statusfor errors if it occurs
Stable:
ICU 2.0

Implements icu::SearchIterator.

void icu::final::setPattern ( const UnicodeString pattern,
UErrorCode status 
)

Sets the pattern used for matching.

The iterator's position will not be changed by this method.

Parameters:
patternsearch pattern to be found
statusfor errors if any. If the pattern length is 0 then an U_ILLEGAL_ARGUMENT_ERROR is returned.
Stable:
ICU 2.0
void icu::final::setQuarters ( const UnicodeString quarters,
int32_t  count,
DtContextType  context,
DtWidthType  width 
)

Sets quarter strings by width and context.

For example: "1st Quarter", "2nd Quarter", etc.

Parameters:
quartersThe new quarter strings. (not adopted; caller retains ownership)
countFilled in with length of the array.
contextThe formatting context, either FORMAT or STANDALONE
widthThe width of returned strings, either WIDE, ABBREVIATED, or NARROW.
Stable:
ICU 3.6
virtual void icu::final::setReorderCodes ( const int32_t *  reorderCodes,
int32_t  reorderCodesLength,
UErrorCode status 
) [override, virtual]

Sets the ordering of scripts for this collator.

Parameters:
reorderCodesAn array of script codes in the new order. This can be nullptr if the length is also set to 0. An empty array will clear any reordering codes on the collator.
reorderCodesLengthThe length of reorderCodes.
statuserror code
See also:
ucol_setReorderCodes
Collator::getReorderCodes
Collator::getEquivalentReorderCodes
Stable:
ICU 4.8

Reimplemented from icu::Collator.

void icu::final::setShortMonths ( const UnicodeString shortMonths,
int32_t  count 
)

Sets short month strings.

For example: "Jan", "Feb", etc.

Parameters:
countFilled in with length of the array.
shortMonthsthe new short month strings. (not adopted; caller retains ownership)
Stable:
ICU 2.0
void icu::final::setShortWeekdays ( const UnicodeString abbrevWeekdays,
int32_t  count 
)

Sets abbreviated weekday strings.

For example: "Sun", "Mon", etc. (Note: The method name is misleading; it does not set the CLDR-style "short" weekday strings, e.g. "Su", "Mo", etc.)

Parameters:
abbrevWeekdaysthe new abbreviated weekday strings. (not adopted; caller retains ownership)
countFilled in with length of the array.
Stable:
ICU 2.0
void icu::final::setSource ( const UnicodeString newSource,
UErrorCode status 
)

Set a new source for this iterator.

Allows object reuse.

Parameters:
newSourcethe source string to iterate against. This allows the same iterator to be used while changing the source string, saving object creation.
statusFill-in parameter which receives the status of this operation.
Stable:
ICU 2.4
virtual void icu::final::setStackLimit ( int32_t  limit,
UErrorCode status 
) [virtual]

Set the amount of heap storage available for use by the match backtracking stack.

The matcher is also reset, discarding any results from previous matches.

ICU uses a backtracking regular expression engine, with the backtrack stack maintained on the heap. This function sets the limit to the amount of memory that can be used for this purpose. A backtracking stack overflow will result in an error from the match operation that caused it.

A limit is desirable because a malicious or poorly designed pattern can use excessive memory, potentially crashing the process. A limit is enabled by default.

Parameters:
limitThe maximum size, in bytes, of the matching backtrack stack. A value of zero means no limit. The limit must be greater or equal to zero.
statusA reference to a UErrorCode to receive any errors.
Stable:
ICU 4.0
void icu::final::setText ( const UnicodeString str,
UErrorCode status 
) [virtual]

Sets the source string.

Parameters:
strthe source string.
statusthe error code status.
Stable:
ICU 2.0

Reimplemented from icu::SearchIterator.

void icu::final::setText ( CharacterIterator str,
UErrorCode status 
) [virtual]

Sets the source string.

Parameters:
strthe source character iterator.
statusthe error code status.
Stable:
ICU 2.0

Reimplemented from icu::SearchIterator.

virtual void icu::final::setText ( const UnicodeString text,
UErrorCode status 
) [override, virtual]

Set the target text to be searched.

Text iteration will hence begin at the start of the text string. This method is useful if you want to re-use an iterator to search for the same pattern within a different body of text.

Parameters:
texttext string to be searched
statusfor errors if any. If the text length is 0 then an U_ILLEGAL_ARGUMENT_ERROR is returned.
Stable:
ICU 2.0

Reimplemented from icu::SearchIterator.

virtual void icu::final::setText ( CharacterIterator text,
UErrorCode status 
) [override, virtual]

Set the target text to be searched.

Text iteration will hence begin at the start of the text string. This method is useful if you want to re-use an iterator to search for the same pattern within a different body of text. Note: No parsing of the text within the CharacterIterator will be done during searching for this version. The block of text in CharacterIterator will be used as it is.

Parameters:
texttext string to be searched
statusfor errors if any. If the text length is 0 then an U_ILLEGAL_ARGUMENT_ERROR is returned.
Stable:
ICU 2.0

Reimplemented from icu::SearchIterator.

virtual void icu::final::setTimeLimit ( int32_t  limit,
UErrorCode status 
) [virtual]

Set a processing time limit for match operations with this Matcher.

Some patterns, when matching certain strings, can run in exponential time. For practical purposes, the match operation may appear to be in an infinite loop. When a limit is set a match operation will fail with an error if the limit is exceeded.

The units of the limit are steps of the match engine. Correspondence with actual processor time will depend on the speed of the processor and the details of the specific pattern, but will typically be on the order of milliseconds.

By default, the matching time is not limited.

Parameters:
limitThe limit value, or 0 for no limit.
statusA reference to a UErrorCode to receive any errors.
Stable:
ICU 4.0
void icu::final::setTimeSeparatorString ( const UnicodeString newTimeSeparator)

Sets the time separator string.

For example: ":".

Parameters:
newTimeSeparatorthe new time separator string.
Internal:
Do not use. This API is for internal use only.

Make this UnicodeSet object invalid.

The string will test true with isBogus().

A bogus set has no value. It is different from an empty set. It can be used to indicate that no set value is available.

This utility function is used throughout the UnicodeSet implementation to indicate that a UnicodeSet operation failed, and may be used in other functions, especially but not exclusively when such functions do not take a UErrorCode for simplicity.

See also:
isBogus()
Stable:
ICU 4.0
void icu::final::setTrace ( UBool  state)

setTrace Debug function, enable/disable tracing of the matching engine.

For internal ICU development use only. DO NO USE!!!!

Internal:
Do not use. This API is for internal use only.
virtual uint32_t icu::final::setVariableTop ( const char16_t *  varTop,
int32_t  len,
UErrorCode status 
) [override, virtual]

Sets the variable top to the primary weight of the specified string.

Beginning with ICU 53, the variable top is pinned to the top of one of the supported reordering groups, and it must not be beyond the last of those groups. See setMaxVariable().

Parameters:
varTopone or more (if contraction) char16_ts to which the variable top should be set
lenlength of variable top string. If -1 it is considered to be zero terminated.
statuserror code. If error code is set, the return value is undefined. Errors set by this function are:
U_CE_NOT_FOUND_ERROR if more than one character was passed and there is no such contraction
U_ILLEGAL_ARGUMENT_ERROR if the variable top is beyond the last reordering group supported by setMaxVariable()
Returns:
variable top primary weight
Deprecated:
ICU 53 Call setMaxVariable() instead.

Implements icu::Collator.

virtual uint32_t icu::final::setVariableTop ( const UnicodeString varTop,
UErrorCode status 
) [override, virtual]

Sets the variable top to the primary weight of the specified string.

Beginning with ICU 53, the variable top is pinned to the top of one of the supported reordering groups, and it must not be beyond the last of those groups. See setMaxVariable().

Parameters:
varTopa UnicodeString size 1 or more (if contraction) of char16_ts to which the variable top should be set
statuserror code. If error code is set, the return value is undefined. Errors set by this function are:
U_CE_NOT_FOUND_ERROR if more than one character was passed and there is no such contraction
U_ILLEGAL_ARGUMENT_ERROR if the variable top is beyond the last reordering group supported by setMaxVariable()
Returns:
variable top primary weight
Deprecated:
ICU 53 Call setMaxVariable() instead.

Implements icu::Collator.

virtual void icu::final::setVariableTop ( uint32_t  varTop,
UErrorCode status 
) [override, virtual]

Sets the variable top to the specified primary weight.

Beginning with ICU 53, the variable top is pinned to the top of one of the supported reordering groups, and it must not be beyond the last of those groups. See setMaxVariable().

Parameters:
varTopprimary weight, as returned by setVariableTop or ucol_getVariableTop
statuserror code
Deprecated:
ICU 53 Call setMaxVariable() instead.

Implements icu::Collator.

void icu::final::setWeekdays ( const UnicodeString weekdays,
int32_t  count 
)

Sets wide weekday strings.

For example: "Sunday", "Monday", etc.

Parameters:
weekdaysthe new weekday strings. (not adopted; caller retains ownership)
countFilled in with length of the array.
Stable:
ICU 2.0
void icu::final::setWeekdays ( const UnicodeString weekdays,
int32_t  count,
DtContextType  context,
DtWidthType  width 
)

Sets weekday strings by width and context.

For example: "Sunday", "Monday", etc.

Parameters:
weekdaysThe new weekday strings. (not adopted; caller retains ownership)
countFilled in with length of the array.
contextThe formatting context, either FORMAT or STANDALONE
widthThe width of returned strings, either WIDE, ABBREVIATED, SHORT, or NARROW
Stable:
ICU 3.6
void icu::final::setYearNames ( const UnicodeString yearNames,
int32_t  count,
DtContextType  context,
DtWidthType  width 
)

Sets cyclic year name strings by width and context.

For example: "jia-zi", "yi-chou", etc.

Parameters:
yearNamesThe new cyclic year name strings (not adopted; caller retains ownership).
countThe length of the array.
contextThe usage context: FORMAT, STANDALONE (currently only FORMAT is supported).
widthThe name width: WIDE, ABBREVIATED, NARROW (currently only ABBREVIATED is supported).
Stable:
ICU 54
void icu::final::setZodiacNames ( const UnicodeString zodiacNames,
int32_t  count,
DtContextType  context,
DtWidthType  width 
)

Sets calendar zodiac name strings by width and context.

For example: "Rat", "Ox", "Tiger", etc.

Parameters:
zodiacNamesThe new zodiac name strings (not adopted; caller retains ownership).
countThe length of the array.
contextThe usage context: FORMAT, STANDALONE (currently only FORMAT is supported).
widthThe name width: WIDE, ABBREVIATED, NARROW (currently only ABBREVIATED is supported).
Stable:
ICU 54
void icu::final::setZoneStrings ( const UnicodeString *const *  strings,
int32_t  rowCount,
int32_t  columnCount 
)

Sets timezone strings.

These strings are stored in a 2-dimensional array.

Note: SimpleDateFormat no longer use the zone strings stored in a DateFormatSymbols. Therefore, the time zone strings set by this method have no effects in an instance of SimpleDateFormat for formatting time zones.

Parameters:
stringsThe timezone strings as a 2-d array to be copied. (not adopted; caller retains ownership)
rowCountThe number of rows (count of first index).
columnCountThe number of columns (count of second index).
Stable:
ICU 2.0

Default constructor.

Stable:
ICU 57

Definition at line 68 of file simpleformatter.h.

icu::final::SimpleFormatter ( const UnicodeString pattern,
UErrorCode errorCode 
) [inline]

Constructs a formatter from the pattern string.

Parameters:
patternThe pattern string.
errorCodeICU error code in/out parameter. Must fulfill U_SUCCESS before the function call. Set to U_ILLEGAL_ARGUMENT_ERROR for bad argument syntax.
Stable:
ICU 57

Definition at line 79 of file simpleformatter.h.

icu::final::SimpleFormatter ( const UnicodeString pattern,
int32_t  min,
int32_t  max,
UErrorCode errorCode 
) [inline]

Constructs a formatter from the pattern string.

The number of arguments checked against the given limits is the highest argument number plus one, not the number of occurrences of arguments.

Parameters:
patternThe pattern string.
minThe pattern must have at least this many arguments.
maxThe pattern must have at most this many arguments.
errorCodeICU error code in/out parameter. Must fulfill U_SUCCESS before the function call. Set to U_ILLEGAL_ARGUMENT_ERROR for bad argument syntax and too few or too many arguments.
Stable:
ICU 57

Definition at line 97 of file simpleformatter.h.

icu::final::SimpleFormatter ( const SimpleFormatter other) [inline]

Copy constructor.

Stable:
ICU 57

Definition at line 106 of file simpleformatter.h.

virtual int32_t icu::final::size ( void  ) const [virtual]

Returns the number of elements in this set (its cardinality).

Note than the elements of a set may include both individual codepoints and strings.

This is slower than getRangeCount() because it counts the code points of all ranges.

Returns:
the number of elements in this set (its cardinality).
Stable:
ICU 2.0
See also:
getRangeCount
UnicodeSetIterator& icu::final::skipToStrings ( ) [inline]

Skips over the remaining code points/ranges, if any.

A following call to next() or nextRange() will yield a string, if there is one. No-op if next() would return false, or if it would yield a string anyway.

Returns:
*this
Stable:
ICU 70
See also:
UnicodeSet::strings()

Definition at line 176 of file usetiter.h.

int32_t icu::final::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 strings that are contained in this set (USET_SPAN_CONTAINED, USET_SPAN_SIMPLE), or only of characters and strings that are not contained in this set (USET_SPAN_NOT_CONTAINED).

See USetSpanCondition for details. Similar to the strspn() C library function. Unpaired surrogates are treated according to contains() of their surrogate code points. This function works faster with a frozen set and with a non-negative string length argument.

Parameters:
sstart of the string
lengthof the string; can be -1 for NUL-terminated
spanConditionspecifies the containment condition
Returns:
the length of the initial substring according to the spanCondition; 0 if the start of the string does not fit the spanCondition
Stable:
ICU 3.8
See also:
USetSpanCondition
int32_t icu::final::span ( const UnicodeString s,
int32_t  start,
USetSpanCondition  spanCondition 
) const [inline]

Returns the end of the substring of the input string according to the USetSpanCondition.

Same as start+span(s.getBuffer()+start, s.length()-start, spanCondition) after pinning start to 0<=start<=s.length().

Parameters:
sthe string
startthe start index in the string for the span operation
spanConditionspecifies the containment condition
Returns:
the exclusive end of the substring according to the spanCondition; the substring s.tempSubStringBetween(start, end) fulfills the spanCondition
Stable:
ICU 4.4
See also:
USetSpanCondition
int32_t icu::final::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 strings that are contained in this set (USET_SPAN_CONTAINED, USET_SPAN_SIMPLE), or only of characters and strings that are not contained in this set (USET_SPAN_NOT_CONTAINED).

See USetSpanCondition for details. Unpaired surrogates are treated according to contains() of their surrogate code points. This function works faster with a frozen set and with a non-negative string length argument.

Parameters:
sstart of the string
lengthof the string; can be -1 for NUL-terminated
spanConditionspecifies the containment condition
Returns:
the start of the trailing substring according to the spanCondition; the string length if the end of the string does not fit the spanCondition
Stable:
ICU 3.8
See also:
USetSpanCondition
int32_t icu::final::spanBack ( const UnicodeString s,
int32_t  limit,
USetSpanCondition  spanCondition 
) const [inline]

Returns the start of the substring of the input string according to the USetSpanCondition.

Same as spanBack(s.getBuffer(), limit, spanCondition) after pinning limit to 0<=end<=s.length().

Parameters:
sthe string
limitthe exclusive-end index in the string for the span operation (use s.length() or INT32_MAX for spanning back from the end of the string)
spanConditionspecifies the containment condition
Returns:
the start of the substring according to the spanCondition; the substring s.tempSubStringBetween(start, limit) fulfills the spanCondition
Stable:
ICU 4.4
See also:
USetSpanCondition
int32_t icu::final::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 strings that are contained in this set (USET_SPAN_CONTAINED, USET_SPAN_SIMPLE), or only of characters and strings that are not contained in this set (USET_SPAN_NOT_CONTAINED).

See USetSpanCondition for details. Malformed byte sequences are treated according to contains(0xfffd). This function works faster with a frozen set and with a non-negative string length argument.

Parameters:
sstart of the string (UTF-8)
lengthof the string; can be -1 for NUL-terminated
spanConditionspecifies the containment condition
Returns:
the start of the trailing substring according to the spanCondition; the string length if the end of the string does not fit the spanCondition
Stable:
ICU 3.8
See also:
USetSpanCondition
int32_t icu::final::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 strings that are contained in this set (USET_SPAN_CONTAINED, USET_SPAN_SIMPLE), or only of characters and strings that are not contained in this set (USET_SPAN_NOT_CONTAINED).

See USetSpanCondition for details. Similar to the strspn() C library function. Malformed byte sequences are treated according to contains(0xfffd). This function works faster with a frozen set and with a non-negative string length argument.

Parameters:
sstart of the string (UTF-8)
lengthof the string; can be -1 for NUL-terminated
spanConditionspecifies the containment condition
Returns:
the length of the initial substring according to the spanCondition; 0 if the start of the string does not fit the spanCondition
Stable:
ICU 3.8
See also:
USetSpanCondition
virtual int32_t icu::final::split ( const UnicodeString input,
UnicodeString  dest[],
int32_t  destCapacity,
UErrorCode status 
) const [virtual]

Split a string into fields.

Somewhat like split() from Perl or Java. Pattern matches identify delimiters that separate the input into fields. The input data between the delimiters becomes the fields themselves.

If the delimiter pattern includes capture groups, the captured text will also appear in the destination array of output strings, interspersed with the fields. This is similar to Perl, but differs from Java, which ignores the presence of capture groups in the pattern.

Trailing empty fields will always be returned, assuming sufficient destination capacity. This differs from the default behavior for Java and Perl where trailing empty fields are not returned.

The number of strings produced by the split operation is returned. This count includes the strings from capture groups in the delimiter pattern. This behavior differs from Java, which ignores capture groups.

For the best performance on split() operations, RegexMatcher::split is preferable to this function

Parameters:
inputThe string to be split into fields. The field delimiters match the pattern (in the "this" object)
destAn array of UnicodeStrings to receive the results of the split. This is an array of actual UnicodeString objects, not an array of pointers to strings. Local (stack based) arrays can work well here.
destCapacityThe number of elements in the destination array. If the number of fields found is less than destCapacity, the extra strings in the destination array are not altered. If the number of destination strings is less than the number of fields, the trailing part of the input string, including any field delimiters, is placed in the last destination string.
statusA reference to a UErrorCode to receive any errors.
Returns:
The number of fields into which the input string was split.
Stable:
ICU 2.4
virtual int32_t icu::final::split ( UText input,
UText dest[],
int32_t  destCapacity,
UErrorCode status 
) const [virtual]

Split a string into fields.

Somewhat like split() from Perl or Java. Pattern matches identify delimiters that separate the input into fields. The input data between the delimiters becomes the fields themselves.

If the delimiter pattern includes capture groups, the captured text will also appear in the destination array of output strings, interspersed with the fields. This is similar to Perl, but differs from Java, which ignores the presence of capture groups in the pattern.

Trailing empty fields will always be returned, assuming sufficient destination capacity. This differs from the default behavior for Java and Perl where trailing empty fields are not returned.

The number of strings produced by the split operation is returned. This count includes the strings from capture groups in the delimiter pattern. This behavior differs from Java, which ignores capture groups.

For the best performance on split() operations, `RegexMatcher::split()` is preferable to this function

Parameters:
inputThe string to be split into fields. The field delimiters match the pattern (in the "this" object)
destAn array of mutable UText structs to receive the results of the split. If a field is nullptr, a new UText is allocated to contain the results for that field. This new UText is not guaranteed to be mutable.
destCapacityThe number of elements in the destination array. If the number of fields found is less than destCapacity, the extra strings in the destination array are not altered. If the number of destination strings is less than the number of fields, the trailing part of the input string, including any field delimiters, is placed in the last destination string.
statusA reference to a UErrorCode to receive any errors.
Returns:
The number of destination strings used.
Stable:
ICU 4.6
virtual int32_t icu::final::split ( const UnicodeString input,
UnicodeString  dest[],
int32_t  destCapacity,
UErrorCode status 
) [virtual]

Split a string into fields.

Somewhat like split() from Perl. The pattern matches identify delimiters that separate the input into fields. The input data between the matches becomes the fields themselves.

Parameters:
inputThe string to be split into fields. The field delimiters match the pattern (in the "this" object). This matcher will be reset to this input string.
destAn array of UnicodeStrings to receive the results of the split. This is an array of actual UnicodeString objects, not an array of pointers to strings. Local (stack based) arrays can work well here.
destCapacityThe number of elements in the destination array. If the number of fields found is less than destCapacity, the extra strings in the destination array are not altered. If the number of destination strings is less than the number of fields, the trailing part of the input string, including any field delimiters, is placed in the last destination string.
statusA reference to a UErrorCode to receive any errors.
Returns:
The number of fields into which the input string was split.
Stable:
ICU 2.6
virtual int32_t icu::final::split ( UText input,
UText dest[],
int32_t  destCapacity,
UErrorCode status 
) [virtual]

Split a string into fields.

Somewhat like split() from Perl. The pattern matches identify delimiters that separate the input into fields. The input data between the matches becomes the fields themselves.

Parameters:
inputThe string to be split into fields. The field delimiters match the pattern (in the "this" object). This matcher will be reset to this input string.
destAn array of mutable UText structs to receive the results of the split. If a field is nullptr, a new UText is allocated to contain the results for that field. This new UText is not guaranteed to be mutable.
destCapacityThe number of elements in the destination array. If the number of fields found is less than destCapacity, the extra strings in the destination array are not altered. If the number of destination strings is less than the number of fields, the trailing part of the input string, including any field delimiters, is placed in the last destination string.
statusA reference to a UErrorCode to receive any errors.
Returns:
The number of fields into which the input string was split.
Stable:
ICU 4.6
virtual int32_t icu::final::start ( UErrorCode status) const [virtual]

Returns the index in the input string of the start of the text matched during the previous match operation.

Parameters:
statusa reference to a UErrorCode to receive any errors.
Returns:
The (native) position in the input string of the start of the last match.
Stable:
ICU 2.4
virtual int32_t icu::final::start ( int32_t  group,
UErrorCode status 
) const [virtual]

Returns the index in the input string of the start of the text matched by the specified capture group during the previous match operation.

Return -1 if the capture group exists in the pattern, but was not part of the last match.

Parameters:
groupthe capture group number
statusA reference to a UErrorCode to receive any errors. Possible errors are U_REGEX_INVALID_STATE if no match has been attempted or the last match failed, and U_INDEX_OUTOFBOUNDS_ERROR for a bad capture group number
Returns:
the (native) start position of substring matched by the specified group.
Stable:
ICU 2.4
virtual int64_t icu::final::start64 ( UErrorCode status) const [virtual]

Returns the index in the input string of the start of the text matched during the previous match operation.

Parameters:
statusa reference to a UErrorCode to receive any errors.
Returns:
The (native) position in the input string of the start of the last match.
Stable:
ICU 4.6
virtual int64_t icu::final::start64 ( int32_t  group,
UErrorCode status 
) const [virtual]

Returns the index in the input string of the start of the text matched by the specified capture group during the previous match operation.

Return -1 if the capture group exists in the pattern, but was not part of the last match.

Parameters:
groupthe capture group number.
statusA reference to a UErrorCode to receive any errors. Possible errors are U_REGEX_INVALID_STATE if no match has been attempted or the last match failed, and U_INDEX_OUTOFBOUNDS_ERROR for a bad capture group number.
Returns:
the (native) start position of substring matched by the specified group.
Stable:
ICU 4.6
int32_t icu::final::strengthOrder ( int32_t  order) const

Gets the comparison order in the desired strength.

Ignore the other differences.

Parameters:
orderThe order value
Stable:
ICU 2.0
icu::final::StringSearch ( const UnicodeString pattern,
const UnicodeString text,
const Locale locale,
BreakIterator breakiter,
UErrorCode status 
)

Creating a StringSearch instance using the argument locale language rule set.

A collator will be created in the process, which will be owned by this instance and will be deleted during destruction

Parameters:
patternThe text for which this object will search.
textThe text in which to search for the pattern.
localeA locale which defines the language-sensitive comparison rules used to determine whether text in the pattern and target matches.
breakiterA BreakIterator object used to constrain the matches that are found. Matches whose start and end indices in the target text are not boundaries as determined by the BreakIterator are ignored. If this behavior is not desired, nullptr can be passed in instead.
statusfor errors if any. If pattern or text is nullptr, or if either the length of pattern or text is 0 then an U_ILLEGAL_ARGUMENT_ERROR is returned.
Stable:
ICU 2.0
icu::final::StringSearch ( const UnicodeString pattern,
const UnicodeString text,
RuleBasedCollator *  coll,
BreakIterator breakiter,
UErrorCode status 
)

Creating a StringSearch instance using the argument collator language rule set.

Note, user retains the ownership of this collator, it does not get destroyed during this instance's destruction.

Parameters:
patternThe text for which this object will search.
textThe text in which to search for the pattern.
collA RuleBasedCollator object which defines the language-sensitive comparison rules used to determine whether text in the pattern and target matches. User is responsible for the clearing of this object.
breakiterA BreakIterator object used to constrain the matches that are found. Matches whose start and end indices in the target text are not boundaries as determined by the BreakIterator are ignored. If this behavior is not desired, nullptr can be passed in instead.
statusfor errors if any. If either the length of pattern or text is 0 then an U_ILLEGAL_ARGUMENT_ERROR is returned.
Stable:
ICU 2.0
icu::final::StringSearch ( const UnicodeString pattern,
CharacterIterator text,
const Locale locale,
BreakIterator breakiter,
UErrorCode status 
)

Creating a StringSearch instance using the argument locale language rule set.

A collator will be created in the process, which will be owned by this instance and will be deleted during destruction

Note: No parsing of the text within the CharacterIterator will be done during searching for this version. The block of text in CharacterIterator will be used as it is.

Parameters:
patternThe text for which this object will search.
textThe text iterator in which to search for the pattern.
localeA locale which defines the language-sensitive comparison rules used to determine whether text in the pattern and target matches. User is responsible for the clearing of this object.
breakiterA BreakIterator object used to constrain the matches that are found. Matches whose start and end indices in the target text are not boundaries as determined by the BreakIterator are ignored. If this behavior is not desired, nullptr can be passed in instead.
statusfor errors if any. If either the length of pattern or text is 0 then an U_ILLEGAL_ARGUMENT_ERROR is returned.
Stable:
ICU 2.0
icu::final::StringSearch ( const UnicodeString pattern,
CharacterIterator text,
RuleBasedCollator *  coll,
BreakIterator breakiter,
UErrorCode status 
)

Creating a StringSearch instance using the argument collator language rule set.

Note, user retains the ownership of this collator, it does not get destroyed during this instance's destruction.

Note: No parsing of the text within the CharacterIterator will be done during searching for this version. The block of text in CharacterIterator will be used as it is.

Parameters:
patternThe text for which this object will search.
textThe text in which to search for the pattern.
collA RuleBasedCollator object which defines the language-sensitive comparison rules used to determine whether text in the pattern and target matches. User is responsible for the clearing of this object.
breakiterA BreakIterator object used to constrain the matches that are found. Matches whose start and end indices in the target text are not boundaries as determined by the BreakIterator are ignored. If this behavior is not desired, nullptr can be passed in instead.
statusfor errors if any. If either the length of pattern or text is 0 then an U_ILLEGAL_ARGUMENT_ERROR is returned.
Stable:
ICU 2.0

Copy constructor that creates a StringSearch instance with the same behavior, and iterating over the same text.

Parameters:
thatStringSearch instance to be copied.
Stable:
ICU 2.0
static int32_t icu::final::tertiaryOrder ( int32_t  order) [inline, static]

Gets the tertiary order of a collation order.

Parameters:
orderthe collation order
Returns:
the tertiary order of a collation order.
Stable:
ICU 2.0
static int32_t icu::final::toLower ( const char *  locale,
uint32_t  options,
const char16_t *  src,
int32_t  srcLength,
char16_t *  dest,
int32_t  destCapacity,
Edits edits,
UErrorCode errorCode 
) [static]

Lowercases a UTF-16 string and optionally records edits.

Casing is locale-dependent and context-sensitive. The result may be longer or shorter than the original. The source string and the destination buffer must not overlap.

Parameters:
localeThe locale ID. ("" = root locale, nullptr = default locale.)
optionsOptions bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET.
srcThe original string.
srcLengthThe length of the original string. If -1, then src must be NUL-terminated.
destA buffer for the result string. The result will be NUL-terminated if the buffer is large enough. The contents is undefined in case of failure.
destCapacityThe size of the buffer (number of char16_ts). If it is 0, then dest may be nullptr and the function will only return the length of the result without writing any of the result string.
editsRecords edits for index mapping, working with styled text, and getting only changes (if any). The Edits contents is undefined if any error occurs. This function calls edits->reset() first unless options includes U_EDITS_NO_RESET. edits can be nullptr.
errorCodeReference to an in/out error code value which must not indicate a failure before the function call.
Returns:
The length of the result string, if successful. When the result would be longer than destCapacity, the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set.
See also:
u_strToLower
Stable:
ICU 59
virtual UnicodeString& icu::final::toPattern ( UnicodeString result,
UBool  escapeUnprintable = false 
) const [override, virtual]

Returns a string representation of this set.

If the result of calling this function is passed to a UnicodeSet constructor, it will produce another set that is equal to this one. A frozen set will not be modified.

Parameters:
resultthe string to receive the rules. Previous contents will be deleted.
escapeUnprintableif true then convert unprintable character to their hex escape representations, \uxxxx or \Uxxxxxxxx. Unprintable characters are those other than U+000A, U+0020..U+007E.
Stable:
ICU 2.0

Implements icu::UnicodeMatcher.

static int32_t icu::final::toTitle ( const char *  locale,
uint32_t  options,
BreakIterator iter,
const char16_t *  src,
int32_t  srcLength,
char16_t *  dest,
int32_t  destCapacity,
Edits edits,
UErrorCode errorCode 
) [static]

Titlecases a UTF-16 string and optionally records edits.

Casing is locale-dependent and context-sensitive. The result may be longer or shorter than the original. The source string and the destination buffer must not overlap.

Titlecasing uses a break iterator to find the first characters of words that are to be titlecased. It titlecases those characters and lowercases all others. (This can be modified with options bits.)

Parameters:
localeThe locale ID. ("" = root locale, nullptr = default locale.)
optionsOptions bit set, usually 0. See U_OMIT_UNCHANGED_TEXT, U_EDITS_NO_RESET, U_TITLECASE_NO_LOWERCASE, U_TITLECASE_NO_BREAK_ADJUSTMENT, U_TITLECASE_ADJUST_TO_CASED, U_TITLECASE_WHOLE_STRING, U_TITLECASE_SENTENCES.
iterA break iterator to find the first characters of words that are to be titlecased. It is set to the source string (setText()) and used one or more times for iteration (first() and next()). If nullptr, then a word break iterator for the locale is used (or something equivalent).
srcThe original string.
srcLengthThe length of the original string. If -1, then src must be NUL-terminated.
destA buffer for the result string. The result will be NUL-terminated if the buffer is large enough. The contents is undefined in case of failure.
destCapacityThe size of the buffer (number of char16_ts). If it is 0, then dest may be nullptr and the function will only return the length of the result without writing any of the result string.
editsRecords edits for index mapping, working with styled text, and getting only changes (if any). The Edits contents is undefined if any error occurs. This function calls edits->reset() first unless options includes U_EDITS_NO_RESET. edits can be nullptr.
errorCodeReference to an in/out error code value which must not indicate a failure before the function call.
Returns:
The length of the result string, if successful. When the result would be longer than destCapacity, the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set.
See also:
u_strToTitle
ucasemap_toTitle
Stable:
ICU 59
Internal:
Do not use.

This API is for internal use only.

Definition at line 301 of file coleitr.h.

Internal:
Do not use.

This API is for internal use only.

Definition at line 305 of file coleitr.h.

static int32_t icu::final::toUpper ( const char *  locale,
uint32_t  options,
const char16_t *  src,
int32_t  srcLength,
char16_t *  dest,
int32_t  destCapacity,
Edits edits,
UErrorCode errorCode 
) [static]

Uppercases a UTF-16 string and optionally records edits.

Casing is locale-dependent and context-sensitive. The result may be longer or shorter than the original. The source string and the destination buffer must not overlap.

Parameters:
localeThe locale ID. ("" = root locale, nullptr = default locale.)
optionsOptions bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET.
srcThe original string.
srcLengthThe length of the original string. If -1, then src must be NUL-terminated.
destA buffer for the result string. The result will be NUL-terminated if the buffer is large enough. The contents is undefined in case of failure.
destCapacityThe size of the buffer (number of char16_ts). If it is 0, then dest may be nullptr and the function will only return the length of the result without writing any of the result string.
editsRecords edits for index mapping, working with styled text, and getting only changes (if any). The Edits contents is undefined if any error occurs. This function calls edits->reset() first unless options includes U_EDITS_NO_RESET. edits can be nullptr.
errorCodeReference to an in/out error code value which must not indicate a failure before the function call.
Returns:
The length of the result string, if successful. When the result would be longer than destCapacity, the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set.
See also:
u_strToUpper
Stable:
ICU 59
USet* icu::final::toUSet ( ) [inline]

Produce a USet * pointer for this UnicodeSet.

USet is the plain C type for UnicodeSet

Returns:
a USet pointer for this UnicodeSet
Stable:
ICU 4.2
const USet* icu::final::toUSet ( ) const [inline]

Produce a const USet * pointer for this UnicodeSet.

USet is the plain C type for UnicodeSet

Returns:
a const USet pointer for this UnicodeSet
Stable:
ICU 4.2

Constructs an empty set.

Stable:
ICU 2.0
icu::final::UnicodeSet ( UChar32  start,
UChar32  end 
)

Constructs a set containing the given range.

If end < start then an empty set is created.

Parameters:
startfirst character, inclusive, of range
endlast character, inclusive, of range
Stable:
ICU 2.4
icu::final::UnicodeSet ( const uint16_t  buffer[],
int32_t  bufferLen,
ESerialization  serialization,
UErrorCode status 
)

Constructs a set from the output of serialize().

Parameters:
bufferthe 16 bit array
bufferLenthe original length returned from serialize()
serializationthe value 'kSerialized'
statuserror code
Internal:
Do not use. This API is for internal use only.
icu::final::UnicodeSet ( const UnicodeString pattern,
UErrorCode status 
)

Constructs a set from the given pattern.

See the class description for the syntax of the pattern language.

Parameters:
patterna string specifying what characters are in the set
statusreturns U_ILLEGAL_ARGUMENT_ERROR if the pattern contains a syntax error.
Stable:
ICU 2.0
icu::final::UnicodeSet ( const UnicodeString pattern,
uint32_t  options,
const SymbolTable symbols,
UErrorCode status 
)

Constructs a set from the given pattern.

See the class description for the syntax of the pattern language.

Parameters:
patterna string specifying what characters are in the set
optionsbitmask for options to apply to the pattern. Valid options are USET_IGNORE_SPACE and at most one of USET_CASE_INSENSITIVE, USET_ADD_CASE_MAPPINGS, USET_SIMPLE_CASE_INSENSITIVE. These case options are mutually exclusive.
symbolsa symbol table mapping variable names to values and stand-in characters to UnicodeSets; may be nullptr
statusreturns U_ILLEGAL_ARGUMENT_ERROR if the pattern contains a syntax error.
Internal:
Do not use. This API is for internal use only.
icu::final::UnicodeSet ( const UnicodeString pattern,
ParsePosition pos,
uint32_t  options,
const SymbolTable symbols,
UErrorCode status 
)

Constructs a set from the given pattern.

See the class description for the syntax of the pattern language.

Parameters:
patterna string specifying what characters are in the set
poson input, the position in pattern at which to start parsing. On output, the position after the last character parsed.
optionsbitmask for options to apply to the pattern. Valid options are USET_IGNORE_SPACE and at most one of USET_CASE_INSENSITIVE, USET_ADD_CASE_MAPPINGS, USET_SIMPLE_CASE_INSENSITIVE. These case options are mutually exclusive.
symbolsa symbol table mapping variable names to values and stand-in characters to UnicodeSets; may be nullptr
statusinput-output error code
Stable:
ICU 2.8

Constructs a set that is identical to the given UnicodeSet.

Stable:
ICU 2.0
icu::final::UnicodeSetIterator ( const UnicodeSet set)

Create an iterator over the given set.

The iterator is valid only so long as set is valid.

Parameters:
setset to iterate over
Stable:
ICU 2.4
icu::final::UnicodeSetIterator ( )

Create an iterator over nothing.

next() and nextRange() return false. This is a convenience constructor allowing the target to be set later.

Stable:
ICU 2.4
virtual RegexMatcher& icu::final::useAnchoringBounds ( UBool  b) [virtual]

Set whether this matcher is using Anchoring Bounds for its region.

With anchoring bounds, pattern anchors such as ^ and $ will match at the start and end of the region. Without Anchoring Bounds, anchors will only match at the positions they would in the complete text.

Anchoring Bounds are the default for regions.

Parameters:
btrue if to enable anchoring bounds; false to disable them.
Returns:
This Matcher
Stable:
ICU 4.0
virtual RegexMatcher& icu::final::useTransparentBounds ( UBool  b) [virtual]

Sets the transparency of region bounds for this matcher.

Invoking this function with an argument of true will set this matcher to use transparent bounds. If the boolean argument is false, then opaque bounds will be used.

Using transparent bounds, the boundaries of this matcher's region are transparent to lookahead, lookbehind, and boundary matching constructs. Those constructs can see text beyond the boundaries of the region while checking for a match.

With opaque bounds, no text outside of the matcher's region is visible to lookahead, lookbehind, and boundary matching constructs.

By default, a matcher uses opaque bounds.

Parameters:
btrue for transparent bounds; false for opaque bounds
Returns:
This Matcher;
Stable:
ICU 4.0
static void icu::final::utf8Fold ( uint32_t  options,
StringPiece  src,
ByteSink sink,
Edits edits,
UErrorCode errorCode 
) [static]

Case-folds a UTF-8 string and optionally records edits.

Case folding is locale-independent and not context-sensitive, but there is an option for whether to include or exclude mappings for dotted I and dotless i that are marked with 'T' in CaseFolding.txt.

The result may be longer or shorter than the original.

Parameters:
optionsOptions bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET.
srcThe original string.
sinkA ByteSink to which the result string is written. sink.Flush() is called at the end.
editsRecords edits for index mapping, working with styled text, and getting only changes (if any). The Edits contents is undefined if any error occurs. This function calls edits->reset() first unless options includes U_EDITS_NO_RESET. edits can be nullptr.
errorCodeReference to an in/out error code value which must not indicate a failure before the function call.
See also:
ucasemap_utf8FoldCase
Stable:
ICU 60
static int32_t icu::final::utf8Fold ( uint32_t  options,
const char *  src,
int32_t  srcLength,
char *  dest,
int32_t  destCapacity,
Edits edits,
UErrorCode errorCode 
) [static]

Case-folds a UTF-8 string and optionally records edits.

Case folding is locale-independent and not context-sensitive, but there is an option for whether to include or exclude mappings for dotted I and dotless i that are marked with 'T' in CaseFolding.txt.

The result may be longer or shorter than the original. The source string and the destination buffer must not overlap.

Parameters:
optionsOptions bit set, usually 0. See U_OMIT_UNCHANGED_TEXT, U_EDITS_NO_RESET, U_FOLD_CASE_DEFAULT, U_FOLD_CASE_EXCLUDE_SPECIAL_I.
srcThe original string.
srcLengthThe length of the original string. If -1, then src must be NUL-terminated.
destA buffer for the result string. The result will be NUL-terminated if the buffer is large enough. The contents is undefined in case of failure.
destCapacityThe size of the buffer (number of bytes). If it is 0, then dest may be nullptr and the function will only return the length of the result without writing any of the result string.
editsRecords edits for index mapping, working with styled text, and getting only changes (if any). The Edits contents is undefined if any error occurs. This function calls edits->reset() first unless options includes U_EDITS_NO_RESET. edits can be nullptr.
errorCodeReference to an in/out error code value which must not indicate a failure before the function call.
Returns:
The length of the result string, if successful. When the result would be longer than destCapacity, the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set.
See also:
ucasemap_utf8FoldCase
Stable:
ICU 59
static void icu::final::utf8ToLower ( const char *  locale,
uint32_t  options,
StringPiece  src,
ByteSink sink,
Edits edits,
UErrorCode errorCode 
) [static]

Lowercases a UTF-8 string and optionally records edits.

Casing is locale-dependent and context-sensitive. The result may be longer or shorter than the original.

Parameters:
localeThe locale ID. ("" = root locale, nullptr = default locale.)
optionsOptions bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET.
srcThe original string.
sinkA ByteSink to which the result string is written. sink.Flush() is called at the end.
editsRecords edits for index mapping, working with styled text, and getting only changes (if any). The Edits contents is undefined if any error occurs. This function calls edits->reset() first unless options includes U_EDITS_NO_RESET. edits can be nullptr.
errorCodeReference to an in/out error code value which must not indicate a failure before the function call.
See also:
ucasemap_utf8ToLower
Stable:
ICU 60
static int32_t icu::final::utf8ToLower ( const char *  locale,
uint32_t  options,
const char *  src,
int32_t  srcLength,
char *  dest,
int32_t  destCapacity,
Edits edits,
UErrorCode errorCode 
) [static]

Lowercases a UTF-8 string and optionally records edits.

Casing is locale-dependent and context-sensitive. The result may be longer or shorter than the original. The source string and the destination buffer must not overlap.

Parameters:
localeThe locale ID. ("" = root locale, nullptr = default locale.)
optionsOptions bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET.
srcThe original string.
srcLengthThe length of the original string. If -1, then src must be NUL-terminated.
destA buffer for the result string. The result will be NUL-terminated if the buffer is large enough. The contents is undefined in case of failure.
destCapacityThe size of the buffer (number of bytes). If it is 0, then dest may be nullptr and the function will only return the length of the result without writing any of the result string.
editsRecords edits for index mapping, working with styled text, and getting only changes (if any). The Edits contents is undefined if any error occurs. This function calls edits->reset() first unless options includes U_EDITS_NO_RESET. edits can be nullptr.
errorCodeReference to an in/out error code value which must not indicate a failure before the function call.
Returns:
The length of the result string, if successful. When the result would be longer than destCapacity, the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set.
See also:
ucasemap_utf8ToLower
Stable:
ICU 59
static void icu::final::utf8ToTitle ( const char *  locale,
uint32_t  options,
BreakIterator iter,
StringPiece  src,
ByteSink sink,
Edits edits,
UErrorCode errorCode 
) [static]

Titlecases a UTF-8 string and optionally records edits.

Casing is locale-dependent and context-sensitive. The result may be longer or shorter than the original.

Titlecasing uses a break iterator to find the first characters of words that are to be titlecased. It titlecases those characters and lowercases all others. (This can be modified with options bits.)

Parameters:
localeThe locale ID. ("" = root locale, nullptr = default locale.)
optionsOptions bit set, usually 0. See U_OMIT_UNCHANGED_TEXT, U_EDITS_NO_RESET, U_TITLECASE_NO_LOWERCASE, U_TITLECASE_NO_BREAK_ADJUSTMENT, U_TITLECASE_ADJUST_TO_CASED, U_TITLECASE_WHOLE_STRING, U_TITLECASE_SENTENCES.
iterA break iterator to find the first characters of words that are to be titlecased. It is set to the source string (setUText()) and used one or more times for iteration (first() and next()). If nullptr, then a word break iterator for the locale is used (or something equivalent).
srcThe original string.
sinkA ByteSink to which the result string is written. sink.Flush() is called at the end.
editsRecords edits for index mapping, working with styled text, and getting only changes (if any). The Edits contents is undefined if any error occurs. This function calls edits->reset() first unless options includes U_EDITS_NO_RESET. edits can be nullptr.
errorCodeReference to an in/out error code value which must not indicate a failure before the function call.
See also:
ucasemap_utf8ToTitle
Stable:
ICU 60
static int32_t icu::final::utf8ToTitle ( const char *  locale,
uint32_t  options,
BreakIterator iter,
const char *  src,
int32_t  srcLength,
char *  dest,
int32_t  destCapacity,
Edits edits,
UErrorCode errorCode 
) [static]

Titlecases a UTF-8 string and optionally records edits.

Casing is locale-dependent and context-sensitive. The result may be longer or shorter than the original. The source string and the destination buffer must not overlap.

Titlecasing uses a break iterator to find the first characters of words that are to be titlecased. It titlecases those characters and lowercases all others. (This can be modified with options bits.)

Parameters:
localeThe locale ID. ("" = root locale, nullptr = default locale.)
optionsOptions bit set, usually 0. See U_OMIT_UNCHANGED_TEXT, U_EDITS_NO_RESET, U_TITLECASE_NO_LOWERCASE, U_TITLECASE_NO_BREAK_ADJUSTMENT, U_TITLECASE_ADJUST_TO_CASED, U_TITLECASE_WHOLE_STRING, U_TITLECASE_SENTENCES.
iterA break iterator to find the first characters of words that are to be titlecased. It is set to the source string (setUText()) and used one or more times for iteration (first() and next()). If nullptr, then a word break iterator for the locale is used (or something equivalent).
srcThe original string.
srcLengthThe length of the original string. If -1, then src must be NUL-terminated.
destA buffer for the result string. The result will be NUL-terminated if the buffer is large enough. The contents is undefined in case of failure.
destCapacityThe size of the buffer (number of bytes). If it is 0, then dest may be nullptr and the function will only return the length of the result without writing any of the result string.
editsRecords edits for index mapping, working with styled text, and getting only changes (if any). The Edits contents is undefined if any error occurs. This function calls edits->reset() first unless options includes U_EDITS_NO_RESET. edits can be nullptr.
errorCodeReference to an in/out error code value which must not indicate a failure before the function call.
Returns:
The length of the result string, if successful. When the result would be longer than destCapacity, the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set.
See also:
ucasemap_utf8ToTitle
Stable:
ICU 59
static void icu::final::utf8ToUpper ( const char *  locale,
uint32_t  options,
StringPiece  src,
ByteSink sink,
Edits edits,
UErrorCode errorCode 
) [static]

Uppercases a UTF-8 string and optionally records edits.

Casing is locale-dependent and context-sensitive. The result may be longer or shorter than the original.

Parameters:
localeThe locale ID. ("" = root locale, nullptr = default locale.)
optionsOptions bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET.
srcThe original string.
sinkA ByteSink to which the result string is written. sink.Flush() is called at the end.
editsRecords edits for index mapping, working with styled text, and getting only changes (if any). The Edits contents is undefined if any error occurs. This function calls edits->reset() first unless options includes U_EDITS_NO_RESET. edits can be nullptr.
errorCodeReference to an in/out error code value which must not indicate a failure before the function call.
See also:
ucasemap_utf8ToUpper
Stable:
ICU 60
static int32_t icu::final::utf8ToUpper ( const char *  locale,
uint32_t  options,
const char *  src,
int32_t  srcLength,
char *  dest,
int32_t  destCapacity,
Edits edits,
UErrorCode errorCode 
) [static]

Uppercases a UTF-8 string and optionally records edits.

Casing is locale-dependent and context-sensitive. The result may be longer or shorter than the original. The source string and the destination buffer must not overlap.

Parameters:
localeThe locale ID. ("" = root locale, nullptr = default locale.)
optionsOptions bit set, usually 0. See U_OMIT_UNCHANGED_TEXT and U_EDITS_NO_RESET.
srcThe original string.
srcLengthThe length of the original string. If -1, then src must be NUL-terminated.
destA buffer for the result string. The result will be NUL-terminated if the buffer is large enough. The contents is undefined in case of failure.
destCapacityThe size of the buffer (number of bytes). If it is 0, then dest may be nullptr and the function will only return the length of the result without writing any of the result string.
editsRecords edits for index mapping, working with styled text, and getting only changes (if any). The Edits contents is undefined if any error occurs. This function calls edits->reset() first unless options includes U_EDITS_NO_RESET. edits can be nullptr.
errorCodeReference to an in/out error code value which must not indicate a failure before the function call.
Returns:
The length of the result string, if successful. When the result would be longer than destCapacity, the full length is returned and a U_BUFFER_OVERFLOW_ERROR is set.
See also:
ucasemap_utf8ToUpper
Stable:
ICU 59

Friends And Related Function Documentation

friend class DateIntervalFormat [friend]

DateIntervalFormat will need access to getBestSkeleton(), parseSkeleton(), enum IntervalPatternIndex, and calendarFieldToPatternIndex().

Instead of making above public, make DateIntervalFormat a friend of DateIntervalInfo.

Definition at line 341 of file dtitvinf.h.


Field Documentation

const char16_t icu::final::ALTERNATE_TIME_SEPARATOR = 0x002e [static]

This alternate time separator is always recognized when parsing.

Internal:
Do not use. This API is for internal use only.

Definition at line 436 of file dtfmtsym.h.

const char16_t icu::final::DEFAULT_TIME_SEPARATOR = 0x003a [static]

This default time separator is used for formatting when the locale doesn't specify any time separator, and always recognized when parsing.

Internal:
Do not use. This API is for internal use only.

Definition at line 430 of file dtfmtsym.h.


The documentation for this class was generated from the following files: