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 USET_DEFINED
00037
00038 #ifndef U_IN_DOXYGEN
00039 #define USET_DEFINED
00040 #endif
00041
00047 typedef struct USet USet;
00048 #endif
00049
00055 enum {
00060 USET_IGNORE_SPACE = 1,
00061
00088 USET_CASE_INSENSITIVE = 2,
00089
00098 USET_ADD_CASE_MAPPINGS = 4
00099 };
00100
00156 typedef enum USetSpanCondition {
00169 USET_SPAN_NOT_CONTAINED = 0,
00184 USET_SPAN_CONTAINED = 1,
00204 USET_SPAN_SIMPLE = 2,
00205 #ifndef U_HIDE_DEPRECATED_API
00206
00210 USET_SPAN_CONDITION_COUNT
00211 #endif // U_HIDE_DEPRECATED_API
00212 } USetSpanCondition;
00213
00214 enum {
00221 USET_SERIALIZED_STATIC_ARRAY_CAPACITY=8
00222 };
00223
00229 typedef struct USerializedSet {
00234 const uint16_t *array;
00239 int32_t bmpLength;
00244 int32_t length;
00249 uint16_t staticArray[USET_SERIALIZED_STATIC_ARRAY_CAPACITY];
00250 } USerializedSet;
00251
00252
00253
00254
00255
00263 U_STABLE USet* U_EXPORT2
00264 uset_openEmpty(void);
00265
00276 U_STABLE USet* U_EXPORT2
00277 uset_open(UChar32 start, UChar32 end);
00278
00288 U_STABLE USet* U_EXPORT2
00289 uset_openPattern(const UChar* pattern, int32_t patternLength,
00290 UErrorCode* ec);
00291
00303 U_STABLE USet* U_EXPORT2
00304 uset_openPatternOptions(const UChar* pattern, int32_t patternLength,
00305 uint32_t options,
00306 UErrorCode* ec);
00307
00314 U_STABLE void U_EXPORT2
00315 uset_close(USet* set);
00316
00317 #if U_SHOW_CPLUSPLUS_API
00318
00319 U_NAMESPACE_BEGIN
00320
00330 U_DEFINE_LOCAL_OPEN_POINTER(LocalUSetPointer, USet, uset_close);
00331
00332 U_NAMESPACE_END
00333
00334 #endif
00335
00345 U_STABLE USet * U_EXPORT2
00346 uset_clone(const USet *set);
00347
00357 U_STABLE UBool U_EXPORT2
00358 uset_isFrozen(const USet *set);
00359
00374 U_STABLE void U_EXPORT2
00375 uset_freeze(USet *set);
00376
00387 U_STABLE USet * U_EXPORT2
00388 uset_cloneAsThawed(const USet *set);
00389
00399 U_STABLE void U_EXPORT2
00400 uset_set(USet* set,
00401 UChar32 start, UChar32 end);
00402
00424 U_STABLE int32_t U_EXPORT2
00425 uset_applyPattern(USet *set,
00426 const UChar *pattern, int32_t patternLength,
00427 uint32_t options,
00428 UErrorCode *status);
00429
00452 U_STABLE void U_EXPORT2
00453 uset_applyIntPropertyValue(USet* set,
00454 UProperty prop, int32_t value, UErrorCode* ec);
00455
00491 U_STABLE void U_EXPORT2
00492 uset_applyPropertyAlias(USet* set,
00493 const UChar *prop, int32_t propLength,
00494 const UChar *value, int32_t valueLength,
00495 UErrorCode* ec);
00496
00506 U_STABLE UBool U_EXPORT2
00507 uset_resemblesPattern(const UChar *pattern, int32_t patternLength,
00508 int32_t pos);
00509
00525 U_STABLE int32_t U_EXPORT2
00526 uset_toPattern(const USet* set,
00527 UChar* result, int32_t resultCapacity,
00528 UBool escapeUnprintable,
00529 UErrorCode* ec);
00530
00539 U_STABLE void U_EXPORT2
00540 uset_add(USet* set, UChar32 c);
00541
00554 U_STABLE void U_EXPORT2
00555 uset_addAll(USet* set, const USet *additionalSet);
00556
00566 U_STABLE void U_EXPORT2
00567 uset_addRange(USet* set, UChar32 start, UChar32 end);
00568
00578 U_STABLE void U_EXPORT2
00579 uset_addString(USet* set, const UChar* str, int32_t strLen);
00580
00590 U_STABLE void U_EXPORT2
00591 uset_addAllCodePoints(USet* set, const UChar *str, int32_t strLen);
00592
00601 U_STABLE void U_EXPORT2
00602 uset_remove(USet* set, UChar32 c);
00603
00613 U_STABLE void U_EXPORT2
00614 uset_removeRange(USet* set, UChar32 start, UChar32 end);
00615
00625 U_STABLE void U_EXPORT2
00626 uset_removeString(USet* set, const UChar* str, int32_t strLen);
00627
00639 U_STABLE void U_EXPORT2
00640 uset_removeAll(USet* set, const USet* removeSet);
00641
00656 U_STABLE void U_EXPORT2
00657 uset_retain(USet* set, UChar32 start, UChar32 end);
00658
00671 U_STABLE void U_EXPORT2
00672 uset_retainAll(USet* set, const USet* retain);
00673
00682 U_STABLE void U_EXPORT2
00683 uset_compact(USet* set);
00684
00693 U_STABLE void U_EXPORT2
00694 uset_complement(USet* set);
00695
00707 U_STABLE void U_EXPORT2
00708 uset_complementAll(USet* set, const USet* complement);
00709
00717 U_STABLE void U_EXPORT2
00718 uset_clear(USet* set);
00719
00746 U_STABLE void U_EXPORT2
00747 uset_closeOver(USet* set, int32_t attributes);
00748
00755 U_STABLE void U_EXPORT2
00756 uset_removeAllStrings(USet* set);
00757
00765 U_STABLE UBool U_EXPORT2
00766 uset_isEmpty(const USet* set);
00767
00776 U_STABLE UBool U_EXPORT2
00777 uset_contains(const USet* set, UChar32 c);
00778
00788 U_STABLE UBool U_EXPORT2
00789 uset_containsRange(const USet* set, UChar32 start, UChar32 end);
00790
00799 U_STABLE UBool U_EXPORT2
00800 uset_containsString(const USet* set, const UChar* str, int32_t strLen);
00801
00812 U_STABLE int32_t U_EXPORT2
00813 uset_indexOf(const USet* set, UChar32 c);
00814
00825 U_STABLE UChar32 U_EXPORT2
00826 uset_charAt(const USet* set, int32_t charIndex);
00827
00836 U_STABLE int32_t U_EXPORT2
00837 uset_size(const USet* set);
00838
00847 U_STABLE int32_t U_EXPORT2
00848 uset_getItemCount(const USet* set);
00849
00868 U_STABLE int32_t U_EXPORT2
00869 uset_getItem(const USet* set, int32_t itemIndex,
00870 UChar32* start, UChar32* end,
00871 UChar* str, int32_t strCapacity,
00872 UErrorCode* ec);
00873
00882 U_STABLE UBool U_EXPORT2
00883 uset_containsAll(const USet* set1, const USet* set2);
00884
00895 U_STABLE UBool U_EXPORT2
00896 uset_containsAllCodePoints(const USet* set, const UChar *str, int32_t strLen);
00897
00906 U_STABLE UBool U_EXPORT2
00907 uset_containsNone(const USet* set1, const USet* set2);
00908
00917 U_STABLE UBool U_EXPORT2
00918 uset_containsSome(const USet* set1, const USet* set2);
00919
00939 U_STABLE int32_t U_EXPORT2
00940 uset_span(const USet *set, const UChar *s, int32_t length, USetSpanCondition spanCondition);
00941
00960 U_STABLE int32_t U_EXPORT2
00961 uset_spanBack(const USet *set, const UChar *s, int32_t length, USetSpanCondition spanCondition);
00962
00982 U_STABLE int32_t U_EXPORT2
00983 uset_spanUTF8(const USet *set, const char *s, int32_t length, USetSpanCondition spanCondition);
00984
01003 U_STABLE int32_t U_EXPORT2
01004 uset_spanBackUTF8(const USet *set, const char *s, int32_t length, USetSpanCondition spanCondition);
01005
01014 U_STABLE UBool U_EXPORT2
01015 uset_equals(const USet* set1, const USet* set2);
01016
01017
01018
01019
01020
01070 U_STABLE int32_t U_EXPORT2
01071 uset_serialize(const USet* set, uint16_t* dest, int32_t destCapacity, UErrorCode* pErrorCode);
01072
01081 U_STABLE UBool U_EXPORT2
01082 uset_getSerializedSet(USerializedSet* fillSet, const uint16_t* src, int32_t srcLength);
01083
01091 U_STABLE void U_EXPORT2
01092 uset_setSerializedToOne(USerializedSet* fillSet, UChar32 c);
01093
01102 U_STABLE UBool U_EXPORT2
01103 uset_serializedContains(const USerializedSet* set, UChar32 c);
01104
01114 U_STABLE int32_t U_EXPORT2
01115 uset_getSerializedRangeCount(const USerializedSet* set);
01116
01130 U_STABLE UBool U_EXPORT2
01131 uset_getSerializedRange(const USerializedSet* set, int32_t rangeIndex,
01132 UChar32* pStart, UChar32* pEnd);
01133
01134 #endif