00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00027 #ifndef __USET_H__
00028 #define __USET_H__
00029
00030 #include "unicode/utypes.h"
00031 #include "unicode/uchar.h"
00032
00033 #ifndef UCNV_H
00034 struct USet;
00040 typedef struct USet USet;
00041 #endif
00042
00048 enum {
00053 USET_IGNORE_SPACE = 1,
00054
00081 USET_CASE_INSENSITIVE = 2,
00082
00091 USET_ADD_CASE_MAPPINGS = 4,
00092
00097 USET_SERIALIZED_STATIC_ARRAY_CAPACITY=8
00098 };
00099
00105 typedef struct USerializedSet {
00110 const uint16_t *array;
00115 int32_t bmpLength;
00120 int32_t length;
00125 uint16_t staticArray[USET_SERIALIZED_STATIC_ARRAY_CAPACITY];
00126 } USerializedSet;
00127
00128
00129
00130
00131
00141 U_STABLE USet* U_EXPORT2
00142 uset_open(UChar32 start, UChar32 end);
00143
00153 U_STABLE USet* U_EXPORT2
00154 uset_openPattern(const UChar* pattern, int32_t patternLength,
00155 UErrorCode* ec);
00156
00168 U_STABLE USet* U_EXPORT2
00169 uset_openPatternOptions(const UChar* pattern, int32_t patternLength,
00170 uint32_t options,
00171 UErrorCode* ec);
00172
00179 U_STABLE void U_EXPORT2
00180 uset_close(USet* set);
00181
00190 U_STABLE void U_EXPORT2
00191 uset_set(USet* set,
00192 UChar32 start, UChar32 end);
00193
00214 U_STABLE int32_t U_EXPORT2
00215 uset_applyPattern(USet *set,
00216 const UChar *pattern, int32_t patternLength,
00217 uint32_t options,
00218 UErrorCode *status);
00219
00241 U_STABLE void U_EXPORT2
00242 uset_applyIntPropertyValue(USet* set,
00243 UProperty prop, int32_t value, UErrorCode* ec);
00244
00279 U_STABLE void U_EXPORT2
00280 uset_applyPropertyAlias(USet* set,
00281 const UChar *prop, int32_t propLength,
00282 const UChar *value, int32_t valueLength,
00283 UErrorCode* ec);
00284
00294 U_STABLE UBool U_EXPORT2
00295 uset_resemblesPattern(const UChar *pattern, int32_t patternLength,
00296 int32_t pos);
00297
00313 U_STABLE int32_t U_EXPORT2
00314 uset_toPattern(const USet* set,
00315 UChar* result, int32_t resultCapacity,
00316 UBool escapeUnprintable,
00317 UErrorCode* ec);
00318
00326 U_STABLE void U_EXPORT2
00327 uset_add(USet* set, UChar32 c);
00328
00340 U_STABLE void U_EXPORT2
00341 uset_addAll(USet* set, const USet *additionalSet);
00342
00351 U_STABLE void U_EXPORT2
00352 uset_addRange(USet* set, UChar32 start, UChar32 end);
00353
00362 U_STABLE void U_EXPORT2
00363 uset_addString(USet* set, const UChar* str, int32_t strLen);
00364
00373 U_DRAFT void U_EXPORT2
00374 uset_addAllCodePoints(USet* set, const UChar *str, int32_t strLen);
00375
00383 U_STABLE void U_EXPORT2
00384 uset_remove(USet* set, UChar32 c);
00385
00394 U_STABLE void U_EXPORT2
00395 uset_removeRange(USet* set, UChar32 start, UChar32 end);
00396
00405 U_STABLE void U_EXPORT2
00406 uset_removeString(USet* set, const UChar* str, int32_t strLen);
00407
00418 U_STABLE void U_EXPORT2
00419 uset_removeAll(USet* set, const USet* removeSet);
00420
00434 U_STABLE void U_EXPORT2
00435 uset_retain(USet* set, UChar32 start, UChar32 end);
00436
00448 U_STABLE void U_EXPORT2
00449 uset_retainAll(USet* set, const USet* retain);
00450
00458 U_STABLE void U_EXPORT2
00459 uset_compact(USet* set);
00460
00468 U_STABLE void U_EXPORT2
00469 uset_complement(USet* set);
00470
00481 U_STABLE void U_EXPORT2
00482 uset_complementAll(USet* set, const USet* complement);
00483
00490 U_STABLE void U_EXPORT2
00491 uset_clear(USet* set);
00492
00500 U_STABLE UBool U_EXPORT2
00501 uset_isEmpty(const USet* set);
00502
00510 U_STABLE UBool U_EXPORT2
00511 uset_contains(const USet* set, UChar32 c);
00512
00522 U_STABLE UBool U_EXPORT2
00523 uset_containsRange(const USet* set, UChar32 start, UChar32 end);
00524
00533 U_STABLE UBool U_EXPORT2
00534 uset_containsString(const USet* set, const UChar* str, int32_t strLen);
00535
00546 U_STABLE int32_t U_EXPORT2
00547 uset_indexOf(const USet* set, UChar32 c);
00548
00559 U_STABLE UChar32 U_EXPORT2
00560 uset_charAt(const USet* set, int32_t index);
00561
00570 U_STABLE int32_t U_EXPORT2
00571 uset_size(const USet* set);
00572
00581 U_STABLE int32_t U_EXPORT2
00582 uset_getItemCount(const USet* set);
00583
00602 U_STABLE int32_t U_EXPORT2
00603 uset_getItem(const USet* set, int32_t itemIndex,
00604 UChar32* start, UChar32* end,
00605 UChar* str, int32_t strCapacity,
00606 UErrorCode* ec);
00607
00616 U_STABLE UBool U_EXPORT2
00617 uset_containsAll(const USet* set1, const USet* set2);
00618
00629 U_DRAFT UBool U_EXPORT2
00630 uset_containsAllCodePoints(const USet* set, const UChar *str, int32_t strLen);
00631
00640 U_STABLE UBool U_EXPORT2
00641 uset_containsNone(const USet* set1, const USet* set2);
00642
00651 U_STABLE UBool U_EXPORT2
00652 uset_containsSome(const USet* set1, const USet* set2);
00653
00662 U_STABLE UBool U_EXPORT2
00663 uset_equals(const USet* set1, const USet* set2);
00664
00665
00666
00667
00668
00718 U_STABLE int32_t U_EXPORT2
00719 uset_serialize(const USet* set, uint16_t* dest, int32_t destCapacity, UErrorCode* pErrorCode);
00720
00729 U_STABLE UBool U_EXPORT2
00730 uset_getSerializedSet(USerializedSet* fillSet, const uint16_t* src, int32_t srcLength);
00731
00739 U_STABLE void U_EXPORT2
00740 uset_setSerializedToOne(USerializedSet* fillSet, UChar32 c);
00741
00750 U_STABLE UBool U_EXPORT2
00751 uset_serializedContains(const USerializedSet* set, UChar32 c);
00752
00762 U_STABLE int32_t U_EXPORT2
00763 uset_getSerializedRangeCount(const USerializedSet* set);
00764
00778 U_STABLE UBool U_EXPORT2
00779 uset_getSerializedRange(const USerializedSet* set, int32_t rangeIndex,
00780 UChar32* pStart, UChar32* pEnd);
00781
00782 #endif