#include "unicode/utypes.h"
#include "unicode/uchar.h"
Go to the source code of this file.
Data Structures | |
struct | USerializedSet |
A serialized form of a Unicode set. More... | |
Typedefs | |
typedef USet | USet |
A UnicodeSet. | |
typedef USerializedSet | USerializedSet |
A serialized form of a Unicode set. | |
Enumerations | |
enum | { USET_IGNORE_SPACE = 1, USET_CASE_INSENSITIVE = 2, USET_CASE = 2, USET_ADD_CASE_MAPPINGS = 4, USET_SERIALIZED_STATIC_ARRAY_CAPACITY = 8 } |
Bitmask values to be passed to uset_openPatternOptions() or uset_applyPattern() taking an option parameter. More... | |
Functions | |
U_STABLE USet * | uset_open (UChar32 start, UChar32 end) |
Creates a USet object that contains the range of characters start. | |
U_STABLE USet * | uset_openPattern (const UChar *pattern, int32_t patternLength, UErrorCode *ec) |
Creates a set from the given pattern. | |
U_STABLE USet * | uset_openPatternOptions (const UChar *pattern, int32_t patternLength, uint32_t options, UErrorCode *ec) |
Creates a set from the given pattern. | |
U_STABLE void | uset_close (USet *set) |
Disposes of the storage used by a USet object. | |
U_DRAFT void | uset_set (USet *set, UChar32 start, UChar32 end) |
Causes the USet object to represent the range start - end . | |
U_STABLE int32_t | uset_applyPattern (USet *set, const UChar *pattern, int32_t patternLength, uint32_t options, UErrorCode *status) |
Modifies the set to represent the set specified by the given pattern. | |
U_DRAFT void | uset_applyIntPropertyValue (USet *set, UProperty prop, int32_t value, UErrorCode *ec) |
Modifies the set to contain those code points which have the given value for the given binary or enumerated property, as returned by u_getIntPropertyValue. | |
U_DRAFT void | uset_applyPropertyAlias (USet *set, const UChar *prop, int32_t propLength, const UChar *value, int32_t valueLength, UErrorCode *ec) |
Modifies the set to contain those code points which have the given value for the given property. | |
U_DRAFT UBool | uset_resemblesPattern (const UChar *pattern, int32_t patternLength, int32_t pos) |
Return true if the given position, in the given pattern, appears to be the start of a UnicodeSet pattern. | |
U_STABLE int32_t | uset_toPattern (const USet *set, UChar *result, int32_t resultCapacity, UBool escapeUnprintable, UErrorCode *ec) |
Returns a string representation of this set. | |
U_STABLE void | uset_add (USet *set, UChar32 c) |
Adds the given character to the given USet. | |
U_STABLE void | uset_addAll (USet *set, const USet *additionalSet) |
Adds all of the elements in the specified set to this set if they're not already present. | |
U_STABLE void | uset_addRange (USet *set, UChar32 start, UChar32 end) |
Adds the given range of characters to the given USet. | |
U_STABLE void | uset_addString (USet *set, const UChar *str, int32_t strLen) |
Adds the given string to the given USet. | |
U_DRAFT void | uset_addAllCodePoints (USet *set, const UChar *str, int32_t strLen) |
Adds each of the characters in this string to the set. | |
U_STABLE void | uset_remove (USet *set, UChar32 c) |
Removes the given character from the given USet. | |
U_STABLE void | uset_removeRange (USet *set, UChar32 start, UChar32 end) |
Removes the given range of characters from the given USet. | |
U_STABLE void | uset_removeString (USet *set, const UChar *str, int32_t strLen) |
Removes the given string to the given USet. | |
U_DRAFT void | uset_removeAll (USet *set, const USet *removeSet) |
Removes from this set all of its elements that are contained in the specified set. | |
U_DRAFT void | uset_retain (USet *set, UChar32 start, UChar32 end) |
Retain only the elements in this set that are contained in the specified range. | |
U_DRAFT void | uset_retainAll (USet *set, const USet *retain) |
Retains only the elements in this set that are contained in the specified set. | |
U_DRAFT void | uset_compact (USet *set) |
Reallocate this objects internal structures to take up the least possible space, without changing this object's value. | |
U_STABLE void | uset_complement (USet *set) |
Inverts this set. | |
U_DRAFT void | uset_complementAll (USet *set, const USet *complement) |
Complements in this set all elements contained in the specified set. | |
U_STABLE void | uset_clear (USet *set) |
Removes all of the elements from this set. | |
U_STABLE UBool | uset_isEmpty (const USet *set) |
Returns TRUE if the given USet contains no characters and no strings. | |
U_STABLE UBool | uset_contains (const USet *set, UChar32 c) |
Returns TRUE if the given USet contains the given character. | |
U_STABLE UBool | uset_containsRange (const USet *set, UChar32 start, UChar32 end) |
Returns TRUE if the given USet contains all characters c where start <= c && c <= end. | |
U_STABLE UBool | uset_containsString (const USet *set, const UChar *str, int32_t strLen) |
Returns TRUE if the given USet contains the given string. | |
U_DRAFT int32_t | uset_indexOf (const USet *set, UChar32 c) |
Returns the index of the given character within this set, where the set is ordered by ascending code point. | |
U_DRAFT UChar32 | uset_charAt (const USet *set, int32_t index) |
Returns the character at the given index within this set, where the set is ordered by ascending code point. | |
U_STABLE int32_t | uset_size (const USet *set) |
Returns the number of characters and strings contained in the given USet. | |
U_STABLE int32_t | uset_getItemCount (const USet *set) |
Returns the number of items in this set. | |
U_STABLE int32_t | uset_getItem (const USet *set, int32_t itemIndex, UChar32 *start, UChar32 *end, UChar *str, int32_t strCapacity, UErrorCode *ec) |
Returns an item of this set. | |
U_DRAFT UBool | uset_containsAll (const USet *set1, const USet *set2) |
Returns true if set1 contains all the characters and strings of set2. | |
U_DRAFT UBool | uset_containsAllCodePoints (const USet *set, const UChar *str, int32_t strLen) |
Returns true if this set contains all the characters of the given string. | |
U_DRAFT UBool | uset_containsNone (const USet *set1, const USet *set2) |
Returns true if set1 contains none of the characters and strings of set2. | |
U_DRAFT UBool | uset_containsSome (const USet *set1, const USet *set2) |
Returns true if set1 contains some of the characters and strings of set2. | |
U_DRAFT UBool | uset_equals (const USet *set1, const USet *set2) |
Returns true if set1 contains all of the characters and strings of set2, and vis versa. | |
U_STABLE int32_t | uset_serialize (const USet *set, uint16_t *dest, int32_t destCapacity, UErrorCode *pErrorCode) |
Serializes this set into an array of 16-bit integers. | |
U_STABLE UBool | uset_getSerializedSet (USerializedSet *fillSet, const uint16_t *src, int32_t srcLength) |
Given a serialized array, fill in the given serialized set object. | |
U_STABLE void | uset_setSerializedToOne (USerializedSet *fillSet, UChar32 c) |
Set the USerializedSet to contain the given character (and nothing else). | |
U_STABLE UBool | uset_serializedContains (const USerializedSet *set, UChar32 c) |
Returns TRUE if the given USerializedSet contains the given character. | |
U_STABLE int32_t | uset_getSerializedRangeCount (const USerializedSet *set) |
Returns the number of disjoint ranges of characters contained in the given serialized set. | |
U_STABLE UBool | uset_getSerializedRange (const USerializedSet *set, int32_t rangeIndex, UChar32 *pStart, UChar32 *pEnd) |
Returns a range of characters contained in the given serialized set. |
This is a C wrapper around the C++ UnicodeSet class.
Definition in file uset.h.
|
A serialized form of a Unicode set. Limited manipulations are possible directly on a serialized set. See below.
|
|
A UnicodeSet. Use the uset_* API to manipulate. Create with uset_open*, and destroy with uset_close.
|
|
Bitmask values to be passed to uset_openPatternOptions() or uset_applyPattern() taking an option parameter.
|
|
Adds the given character to the given USet. After this call, uset_contains(set, c) will return TRUE.
|
|
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.
|
|
Adds each of the characters in this string to the set. Thus "ch" => {"c", "h"} If this set already any particular character, it has no effect on that character.
|
|
Adds the given range of characters to the given USet. After this call, uset_contains(set, start, end) will return TRUE.
|
|
Adds the given string to the given USet. After this call, uset_containsString(set, str, strLen) will return TRUE.
|
|
Modifies the 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.
|
|
Modifies the set to represent the set specified by the given pattern. See the UnicodeSet class description for the syntax of the pattern language. See also the User Guide chapter about UnicodeSet. Empties the set passed before applying the pattern.
|
|
Modifies the set to contain those code points which have the given value for the given property. Prior contents of this set are lost.
|
|
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, return (UChar32)-1. The inverse of this method is
|
|
Removes all of the elements from this set. This set will be empty after this call returns.
|
|
Disposes of the storage used by a USet object. This function should be called exactly once for objects returned by uset_open().
|
|
Reallocate this objects internal structures to take up the least possible space, without changing this object's value.
|
|
Inverts this set. This operation modifies this set so that its value is its complement. This operation does not affect the multicharacter strings, if any.
|
|
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.
|
|
Returns TRUE if the given USet contains the given character.
|
|
Returns true if set1 contains all the characters and strings of set2. It answers the question, 'Is set1 a subset of set2?'
|
|
Returns true if this set contains all the characters of the given string. This is does not check containment of grapheme clusters, like uset_containsString.
|
|
Returns true if set1 contains none of the characters and strings of set2. It answers the question, 'Is set1 a disjoint set of set2?'
|
|
Returns TRUE if the given USet contains all characters c where start <= c && c <= end.
|
|
Returns true if set1 contains some of the characters and strings of set2. It answers the question, 'Does set1 and set2 have an intersection?'
|
|
Returns TRUE if the given USet contains the given string.
|
|
Returns true if set1 contains all of the characters and strings of set2, and vis versa. It answers the question, 'Is set1 equal to set2?'
|
|
Returns an item of this set. An item is either a range of characters or a single multicharacter string.
|
|
Returns the number of items in this set. An item is either a range of characters or a single multicharacter string.
|
|
Returns a range of characters contained in the given serialized set.
|
|
Returns the number of disjoint ranges of characters contained in the given serialized set. Ignores any strings contained in the set.
|
|
Given a serialized array, fill in the given serialized set object.
|
|
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
|
|
Returns TRUE if the given USet contains no characters and no strings.
|
|
Creates a USet object that contains the range of characters start. .end, inclusive.
|
|
Creates a set from the given pattern. See the UnicodeSet class description for the syntax of the pattern language.
|
|
Creates a set from the given pattern. See the UnicodeSet class description for the syntax of the pattern language.
|
|
Removes the given character from the given USet. After this call, uset_contains(set, c) will return FALSE.
|
|
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.
|
|
Removes the given range of characters from the given USet. After this call, uset_contains(set, start, end) will return FALSE.
|
|
Removes the given string to the given USet. After this call, uset_containsString(set, str, strLen) will return FALSE.
|
|
Return true if the given position, in the given pattern, appears to be the start of a UnicodeSet pattern.
|
|
Retain only the elements in this set that are contained in the specified range.
If
|
|
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.
|
|
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.
|
|
Returns TRUE if the given USerializedSet contains the given character.
|
|
Causes the USet object to represent the range
If
|
|
Set the USerializedSet to contain the given character (and nothing else).
|
|
Returns the number of characters and strings contained in the given USet.
|
|
Returns a string representation of this set. If the result of calling this function is passed to a uset_openPattern(), it will produce another set that is equal to this one.
|