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
00035 #if U_SHOW_CPLUSPLUS_API
00036 #include "unicode/localpointer.h"
00037 #endif // U_SHOW_CPLUSPLUS_API
00038
00039 #ifndef USET_DEFINED
00040
00041 #ifndef U_IN_DOXYGEN
00042 #define USET_DEFINED
00043 #endif
00044
00050 typedef struct USet USet;
00051 #endif
00052
00058 enum {
00063 USET_IGNORE_SPACE = 1,
00064
00091 USET_CASE_INSENSITIVE = 2,
00092
00101 USET_ADD_CASE_MAPPINGS = 4
00102 };
00103
00159 typedef enum USetSpanCondition {
00172 USET_SPAN_NOT_CONTAINED = 0,
00187 USET_SPAN_CONTAINED = 1,
00207 USET_SPAN_SIMPLE = 2,
00208 #ifndef U_HIDE_DEPRECATED_API
00209
00213 USET_SPAN_CONDITION_COUNT
00214 #endif // U_HIDE_DEPRECATED_API
00215 } USetSpanCondition;
00216
00217 enum {
00224 USET_SERIALIZED_STATIC_ARRAY_CAPACITY=8
00225 };
00226
00232 typedef struct USerializedSet {
00237 const uint16_t *array;
00242 int32_t bmpLength;
00247 int32_t length;
00252 uint16_t staticArray[USET_SERIALIZED_STATIC_ARRAY_CAPACITY];
00253 } USerializedSet;
00254
00255
00256
00257
00258
00266 U_CAPI USet* U_EXPORT2
00267 uset_openEmpty(void);
00268
00279 U_CAPI USet* U_EXPORT2
00280 uset_open(UChar32 start, UChar32 end);
00281
00291 U_CAPI USet* U_EXPORT2
00292 uset_openPattern(const UChar* pattern, int32_t patternLength,
00293 UErrorCode* ec);
00294
00306 U_CAPI USet* U_EXPORT2
00307 uset_openPatternOptions(const UChar* pattern, int32_t patternLength,
00308 uint32_t options,
00309 UErrorCode* ec);
00310
00317 U_CAPI void U_EXPORT2
00318 uset_close(USet* set);
00319
00320 #if U_SHOW_CPLUSPLUS_API
00321
00322 U_NAMESPACE_BEGIN
00323
00333 U_DEFINE_LOCAL_OPEN_POINTER(LocalUSetPointer, USet, uset_close);
00334
00335 U_NAMESPACE_END
00336
00337 #endif
00338
00348 U_CAPI USet * U_EXPORT2
00349 uset_clone(const USet *set);
00350
00360 U_CAPI UBool U_EXPORT2
00361 uset_isFrozen(const USet *set);
00362
00377 U_CAPI void U_EXPORT2
00378 uset_freeze(USet *set);
00379
00390 U_CAPI USet * U_EXPORT2
00391 uset_cloneAsThawed(const USet *set);
00392
00402 U_CAPI void U_EXPORT2
00403 uset_set(USet* set,
00404 UChar32 start, UChar32 end);
00405
00427 U_CAPI int32_t U_EXPORT2
00428 uset_applyPattern(USet *set,
00429 const UChar *pattern, int32_t patternLength,
00430 uint32_t options,
00431 UErrorCode *status);
00432
00455 U_CAPI void U_EXPORT2
00456 uset_applyIntPropertyValue(USet* set,
00457 UProperty prop, int32_t value, UErrorCode* ec);
00458
00494 U_CAPI void U_EXPORT2
00495 uset_applyPropertyAlias(USet* set,
00496 const UChar *prop, int32_t propLength,
00497 const UChar *value, int32_t valueLength,
00498 UErrorCode* ec);
00499
00509 U_CAPI UBool U_EXPORT2
00510 uset_resemblesPattern(const UChar *pattern, int32_t patternLength,
00511 int32_t pos);
00512
00528 U_CAPI int32_t U_EXPORT2
00529 uset_toPattern(const USet* set,
00530 UChar* result, int32_t resultCapacity,
00531 UBool escapeUnprintable,
00532 UErrorCode* ec);
00533
00542 U_CAPI void U_EXPORT2
00543 uset_add(USet* set, UChar32 c);
00544
00557 U_CAPI void U_EXPORT2
00558 uset_addAll(USet* set, const USet *additionalSet);
00559
00569 U_CAPI void U_EXPORT2
00570 uset_addRange(USet* set, UChar32 start, UChar32 end);
00571
00581 U_CAPI void U_EXPORT2
00582 uset_addString(USet* set, const UChar* str, int32_t strLen);
00583
00593 U_CAPI void U_EXPORT2
00594 uset_addAllCodePoints(USet* set, const UChar *str, int32_t strLen);
00595
00604 U_CAPI void U_EXPORT2
00605 uset_remove(USet* set, UChar32 c);
00606
00616 U_CAPI void U_EXPORT2
00617 uset_removeRange(USet* set, UChar32 start, UChar32 end);
00618
00628 U_CAPI void U_EXPORT2
00629 uset_removeString(USet* set, const UChar* str, int32_t strLen);
00630
00640 U_CAPI void U_EXPORT2
00641 uset_removeAllCodePoints(USet *set, const UChar *str, int32_t length);
00642
00654 U_CAPI void U_EXPORT2
00655 uset_removeAll(USet* set, const USet* removeSet);
00656
00669 U_CAPI void U_EXPORT2
00670 uset_retain(USet* set, UChar32 start, UChar32 end);
00671
00683 U_CAPI void U_EXPORT2
00684 uset_retainString(USet *set, const UChar *str, int32_t length);
00685
00695 U_CAPI void U_EXPORT2
00696 uset_retainAllCodePoints(USet *set, const UChar *str, int32_t length);
00697
00710 U_CAPI void U_EXPORT2
00711 uset_retainAll(USet* set, const USet* retain);
00712
00721 U_CAPI void U_EXPORT2
00722 uset_compact(USet* set);
00723
00737 U_CAPI void U_EXPORT2
00738 uset_complement(USet* set);
00739
00753 U_CAPI void U_EXPORT2
00754 uset_complementRange(USet *set, UChar32 start, UChar32 end);
00755
00766 U_CAPI void U_EXPORT2
00767 uset_complementString(USet *set, const UChar *str, int32_t length);
00768
00778 U_CAPI void U_EXPORT2
00779 uset_complementAllCodePoints(USet *set, const UChar *str, int32_t length);
00780
00792 U_CAPI void U_EXPORT2
00793 uset_complementAll(USet* set, const USet* complement);
00794
00802 U_CAPI void U_EXPORT2
00803 uset_clear(USet* set);
00804
00831 U_CAPI void U_EXPORT2
00832 uset_closeOver(USet* set, int32_t attributes);
00833
00840 U_CAPI void U_EXPORT2
00841 uset_removeAllStrings(USet* set);
00842
00850 U_CAPI UBool U_EXPORT2
00851 uset_isEmpty(const USet* set);
00852
00853 #ifndef U_HIDE_DRAFT_API
00854
00859 U_CAPI UBool U_EXPORT2
00860 uset_hasStrings(const USet *set);
00861 #endif // U_HIDE_DRAFT_API
00862
00871 U_CAPI UBool U_EXPORT2
00872 uset_contains(const USet* set, UChar32 c);
00873
00883 U_CAPI UBool U_EXPORT2
00884 uset_containsRange(const USet* set, UChar32 start, UChar32 end);
00885
00894 U_CAPI UBool U_EXPORT2
00895 uset_containsString(const USet* set, const UChar* str, int32_t strLen);
00896
00907 U_CAPI int32_t U_EXPORT2
00908 uset_indexOf(const USet* set, UChar32 c);
00909
00925 U_CAPI UChar32 U_EXPORT2
00926 uset_charAt(const USet* set, int32_t charIndex);
00927
00941 U_CAPI int32_t U_EXPORT2
00942 uset_size(const USet* set);
00943
00944 #ifndef U_HIDE_DRAFT_API
00945
00953 U_CAPI int32_t U_EXPORT2
00954 uset_getRangeCount(const USet *set);
00955 #endif // U_HIDE_DRAFT_API
00956
00965 U_CAPI int32_t U_EXPORT2
00966 uset_getItemCount(const USet* set);
00967
00996 U_CAPI int32_t U_EXPORT2
00997 uset_getItem(const USet* set, int32_t itemIndex,
00998 UChar32* start, UChar32* end,
00999 UChar* str, int32_t strCapacity,
01000 UErrorCode* ec);
01001
01010 U_CAPI UBool U_EXPORT2
01011 uset_containsAll(const USet* set1, const USet* set2);
01012
01023 U_CAPI UBool U_EXPORT2
01024 uset_containsAllCodePoints(const USet* set, const UChar *str, int32_t strLen);
01025
01034 U_CAPI UBool U_EXPORT2
01035 uset_containsNone(const USet* set1, const USet* set2);
01036
01045 U_CAPI UBool U_EXPORT2
01046 uset_containsSome(const USet* set1, const USet* set2);
01047
01067 U_CAPI int32_t U_EXPORT2
01068 uset_span(const USet *set, const UChar *s, int32_t length, USetSpanCondition spanCondition);
01069
01088 U_CAPI int32_t U_EXPORT2
01089 uset_spanBack(const USet *set, const UChar *s, int32_t length, USetSpanCondition spanCondition);
01090
01110 U_CAPI int32_t U_EXPORT2
01111 uset_spanUTF8(const USet *set, const char *s, int32_t length, USetSpanCondition spanCondition);
01112
01131 U_CAPI int32_t U_EXPORT2
01132 uset_spanBackUTF8(const USet *set, const char *s, int32_t length, USetSpanCondition spanCondition);
01133
01142 U_CAPI UBool U_EXPORT2
01143 uset_equals(const USet* set1, const USet* set2);
01144
01145
01146
01147
01148
01198 U_CAPI int32_t U_EXPORT2
01199 uset_serialize(const USet* set, uint16_t* dest, int32_t destCapacity, UErrorCode* pErrorCode);
01200
01209 U_CAPI UBool U_EXPORT2
01210 uset_getSerializedSet(USerializedSet* fillSet, const uint16_t* src, int32_t srcLength);
01211
01219 U_CAPI void U_EXPORT2
01220 uset_setSerializedToOne(USerializedSet* fillSet, UChar32 c);
01221
01230 U_CAPI UBool U_EXPORT2
01231 uset_serializedContains(const USerializedSet* set, UChar32 c);
01232
01242 U_CAPI int32_t U_EXPORT2
01243 uset_getSerializedRangeCount(const USerializedSet* set);
01244
01258 U_CAPI UBool U_EXPORT2
01259 uset_getSerializedRange(const USerializedSet* set, int32_t rangeIndex,
01260 UChar32* pStart, UChar32* pEnd);
01261
01262 #endif