00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00029 #ifndef __USET_H__
00030 #define __USET_H__
00031
00032 #include "unicode/utypes.h"
00033 #include "unicode/uchar.h"
00034 #include "unicode/localpointer.h"
00035
00036 #ifndef UCNV_H
00037 struct USet;
00043 typedef struct USet USet;
00044 #endif
00045
00051 enum {
00056 USET_IGNORE_SPACE = 1,
00057
00084 USET_CASE_INSENSITIVE = 2,
00085
00094 USET_ADD_CASE_MAPPINGS = 4
00095 };
00096
00152 typedef enum USetSpanCondition {
00165 USET_SPAN_NOT_CONTAINED = 0,
00180 USET_SPAN_CONTAINED = 1,
00200 USET_SPAN_SIMPLE = 2,
00201 #ifndef U_HIDE_DEPRECATED_API
00202
00206 USET_SPAN_CONDITION_COUNT
00207 #endif // U_HIDE_DEPRECATED_API
00208 } USetSpanCondition;
00209
00210 enum {
00217 USET_SERIALIZED_STATIC_ARRAY_CAPACITY=8
00218 };
00219
00225 typedef struct USerializedSet {
00230 const uint16_t *array;
00235 int32_t bmpLength;
00240 int32_t length;
00245 uint16_t staticArray[USET_SERIALIZED_STATIC_ARRAY_CAPACITY];
00246 } USerializedSet;
00247
00248
00249
00250
00251
00259 U_STABLE USet* U_EXPORT2
00260 uset_openEmpty(void);
00261
00272 U_STABLE USet* U_EXPORT2
00273 uset_open(UChar32 start, UChar32 end);
00274
00284 U_STABLE USet* U_EXPORT2
00285 uset_openPattern(const UChar* pattern, int32_t patternLength,
00286 UErrorCode* ec);
00287
00299 U_STABLE USet* U_EXPORT2
00300 uset_openPatternOptions(const UChar* pattern, int32_t patternLength,
00301 uint32_t options,
00302 UErrorCode* ec);
00303
00310 U_STABLE void U_EXPORT2
00311 uset_close(USet* set);
00312
00313 #if U_SHOW_CPLUSPLUS_API
00314
00315 U_NAMESPACE_BEGIN
00316
00326 U_DEFINE_LOCAL_OPEN_POINTER(LocalUSetPointer, USet, uset_close);
00327
00328 U_NAMESPACE_END
00329
00330 #endif
00331
00341 U_STABLE USet * U_EXPORT2
00342 uset_clone(const USet *set);
00343
00353 U_STABLE UBool U_EXPORT2
00354 uset_isFrozen(const USet *set);
00355
00370 U_STABLE void U_EXPORT2
00371 uset_freeze(USet *set);
00372
00383 U_STABLE USet * U_EXPORT2
00384 uset_cloneAsThawed(const USet *set);
00385
00395 U_STABLE void U_EXPORT2
00396 uset_set(USet* set,
00397 UChar32 start, UChar32 end);
00398
00420 U_STABLE int32_t U_EXPORT2
00421 uset_applyPattern(USet *set,
00422 const UChar *pattern, int32_t patternLength,
00423 uint32_t options,
00424 UErrorCode *status);
00425
00448 U_STABLE void U_EXPORT2
00449 uset_applyIntPropertyValue(USet* set,
00450 UProperty prop, int32_t value, UErrorCode* ec);
00451
00487 U_STABLE void U_EXPORT2
00488 uset_applyPropertyAlias(USet* set,
00489 const UChar *prop, int32_t propLength,
00490 const UChar *value, int32_t valueLength,
00491 UErrorCode* ec);
00492
00502 U_STABLE UBool U_EXPORT2
00503 uset_resemblesPattern(const UChar *pattern, int32_t patternLength,
00504 int32_t pos);
00505
00521 U_STABLE int32_t U_EXPORT2
00522 uset_toPattern(const USet* set,
00523 UChar* result, int32_t resultCapacity,
00524 UBool escapeUnprintable,
00525 UErrorCode* ec);
00526
00535 U_STABLE void U_EXPORT2
00536 uset_add(USet* set, UChar32 c);
00537
00550 U_STABLE void U_EXPORT2
00551 uset_addAll(USet* set, const USet *additionalSet);
00552
00562 U_STABLE void U_EXPORT2
00563 uset_addRange(USet* set, UChar32 start, UChar32 end);
00564
00574 U_STABLE void U_EXPORT2
00575 uset_addString(USet* set, const UChar* str, int32_t strLen);
00576
00586 U_STABLE void U_EXPORT2
00587 uset_addAllCodePoints(USet* set, const UChar *str, int32_t strLen);
00588
00597 U_STABLE void U_EXPORT2
00598 uset_remove(USet* set, UChar32 c);
00599
00609 U_STABLE void U_EXPORT2
00610 uset_removeRange(USet* set, UChar32 start, UChar32 end);
00611
00621 U_STABLE void U_EXPORT2
00622 uset_removeString(USet* set, const UChar* str, int32_t strLen);
00623
00635 U_STABLE void U_EXPORT2
00636 uset_removeAll(USet* set, const USet* removeSet);
00637
00652 U_STABLE void U_EXPORT2
00653 uset_retain(USet* set, UChar32 start, UChar32 end);
00654
00667 U_STABLE void U_EXPORT2
00668 uset_retainAll(USet* set, const USet* retain);
00669
00678 U_STABLE void U_EXPORT2
00679 uset_compact(USet* set);
00680
00689 U_STABLE void U_EXPORT2
00690 uset_complement(USet* set);
00691
00703 U_STABLE void U_EXPORT2
00704 uset_complementAll(USet* set, const USet* complement);
00705
00713 U_STABLE void U_EXPORT2
00714 uset_clear(USet* set);
00715
00742 U_STABLE void U_EXPORT2
00743 uset_closeOver(USet* set, int32_t attributes);
00744
00751 U_STABLE void U_EXPORT2
00752 uset_removeAllStrings(USet* set);
00753
00761 U_STABLE UBool U_EXPORT2
00762 uset_isEmpty(const USet* set);
00763
00772 U_STABLE UBool U_EXPORT2
00773 uset_contains(const USet* set, UChar32 c);
00774
00784 U_STABLE UBool U_EXPORT2
00785 uset_containsRange(const USet* set, UChar32 start, UChar32 end);
00786
00795 U_STABLE UBool U_EXPORT2
00796 uset_containsString(const USet* set, const UChar* str, int32_t strLen);
00797
00808 U_STABLE int32_t U_EXPORT2
00809 uset_indexOf(const USet* set, UChar32 c);
00810
00821 U_STABLE UChar32 U_EXPORT2
00822 uset_charAt(const USet* set, int32_t charIndex);
00823
00832 U_STABLE int32_t U_EXPORT2
00833 uset_size(const USet* set);
00834
00843 U_STABLE int32_t U_EXPORT2
00844 uset_getItemCount(const USet* set);
00845
00864 U_STABLE int32_t U_EXPORT2
00865 uset_getItem(const USet* set, int32_t itemIndex,
00866 UChar32* start, UChar32* end,
00867 UChar* str, int32_t strCapacity,
00868 UErrorCode* ec);
00869
00878 U_STABLE UBool U_EXPORT2
00879 uset_containsAll(const USet* set1, const USet* set2);
00880
00891 U_STABLE UBool U_EXPORT2
00892 uset_containsAllCodePoints(const USet* set, const UChar *str, int32_t strLen);
00893
00902 U_STABLE UBool U_EXPORT2
00903 uset_containsNone(const USet* set1, const USet* set2);
00904
00913 U_STABLE UBool U_EXPORT2
00914 uset_containsSome(const USet* set1, const USet* set2);
00915
00935 U_STABLE int32_t U_EXPORT2
00936 uset_span(const USet *set, const UChar *s, int32_t length, USetSpanCondition spanCondition);
00937
00956 U_STABLE int32_t U_EXPORT2
00957 uset_spanBack(const USet *set, const UChar *s, int32_t length, USetSpanCondition spanCondition);
00958
00978 U_STABLE int32_t U_EXPORT2
00979 uset_spanUTF8(const USet *set, const char *s, int32_t length, USetSpanCondition spanCondition);
00980
00999 U_STABLE int32_t U_EXPORT2
01000 uset_spanBackUTF8(const USet *set, const char *s, int32_t length, USetSpanCondition spanCondition);
01001
01010 U_STABLE UBool U_EXPORT2
01011 uset_equals(const USet* set1, const USet* set2);
01012
01013
01014
01015
01016
01066 U_STABLE int32_t U_EXPORT2
01067 uset_serialize(const USet* set, uint16_t* dest, int32_t destCapacity, UErrorCode* pErrorCode);
01068
01077 U_STABLE UBool U_EXPORT2
01078 uset_getSerializedSet(USerializedSet* fillSet, const uint16_t* src, int32_t srcLength);
01079
01087 U_STABLE void U_EXPORT2
01088 uset_setSerializedToOne(USerializedSet* fillSet, UChar32 c);
01089
01098 U_STABLE UBool U_EXPORT2
01099 uset_serializedContains(const USerializedSet* set, UChar32 c);
01100
01110 U_STABLE int32_t U_EXPORT2
01111 uset_getSerializedRangeCount(const USerializedSet* set);
01112
01126 U_STABLE UBool U_EXPORT2
01127 uset_getSerializedRange(const USerializedSet* set, int32_t rangeIndex,
01128 UChar32* pStart, UChar32* pEnd);
01129
01130 #endif