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 #include "unicode/localpointer.h"
00033
00034 #ifndef UCNV_H
00035 struct USet;
00041 typedef struct USet USet;
00042 #endif
00043
00049 enum {
00054 USET_IGNORE_SPACE = 1,
00055
00082 USET_CASE_INSENSITIVE = 2,
00083
00092 USET_ADD_CASE_MAPPINGS = 4
00093 };
00094
00150 typedef enum USetSpanCondition {
00163 USET_SPAN_NOT_CONTAINED = 0,
00178 USET_SPAN_CONTAINED = 1,
00198 USET_SPAN_SIMPLE = 2,
00203 USET_SPAN_CONDITION_COUNT
00204 } USetSpanCondition;
00205
00206 enum {
00213 USET_SERIALIZED_STATIC_ARRAY_CAPACITY=8
00214 };
00215
00221 typedef struct USerializedSet {
00226 const uint16_t *array;
00231 int32_t bmpLength;
00236 int32_t length;
00241 uint16_t staticArray[USET_SERIALIZED_STATIC_ARRAY_CAPACITY];
00242 } USerializedSet;
00243
00244
00245
00246
00247
00255 U_STABLE USet* U_EXPORT2
00256 uset_openEmpty(void);
00257
00268 U_STABLE USet* U_EXPORT2
00269 uset_open(UChar32 start, UChar32 end);
00270
00280 U_STABLE USet* U_EXPORT2
00281 uset_openPattern(const UChar* pattern, int32_t patternLength,
00282 UErrorCode* ec);
00283
00295 U_STABLE USet* U_EXPORT2
00296 uset_openPatternOptions(const UChar* pattern, int32_t patternLength,
00297 uint32_t options,
00298 UErrorCode* ec);
00299
00306 U_STABLE void U_EXPORT2
00307 uset_close(USet* set);
00308
00309 #if U_SHOW_CPLUSPLUS_API
00310
00311 U_NAMESPACE_BEGIN
00312
00322 U_DEFINE_LOCAL_OPEN_POINTER(LocalUSetPointer, USet, uset_close);
00323
00324 U_NAMESPACE_END
00325
00326 #endif
00327
00337 U_STABLE USet * U_EXPORT2
00338 uset_clone(const USet *set);
00339
00349 U_STABLE UBool U_EXPORT2
00350 uset_isFrozen(const USet *set);
00351
00366 U_STABLE void U_EXPORT2
00367 uset_freeze(USet *set);
00368
00379 U_STABLE USet * U_EXPORT2
00380 uset_cloneAsThawed(const USet *set);
00381
00391 U_STABLE void U_EXPORT2
00392 uset_set(USet* set,
00393 UChar32 start, UChar32 end);
00394
00416 U_STABLE int32_t U_EXPORT2
00417 uset_applyPattern(USet *set,
00418 const UChar *pattern, int32_t patternLength,
00419 uint32_t options,
00420 UErrorCode *status);
00421
00444 U_STABLE void U_EXPORT2
00445 uset_applyIntPropertyValue(USet* set,
00446 UProperty prop, int32_t value, UErrorCode* ec);
00447
00483 U_STABLE void U_EXPORT2
00484 uset_applyPropertyAlias(USet* set,
00485 const UChar *prop, int32_t propLength,
00486 const UChar *value, int32_t valueLength,
00487 UErrorCode* ec);
00488
00498 U_STABLE UBool U_EXPORT2
00499 uset_resemblesPattern(const UChar *pattern, int32_t patternLength,
00500 int32_t pos);
00501
00517 U_STABLE int32_t U_EXPORT2
00518 uset_toPattern(const USet* set,
00519 UChar* result, int32_t resultCapacity,
00520 UBool escapeUnprintable,
00521 UErrorCode* ec);
00522
00531 U_STABLE void U_EXPORT2
00532 uset_add(USet* set, UChar32 c);
00533
00546 U_STABLE void U_EXPORT2
00547 uset_addAll(USet* set, const USet *additionalSet);
00548
00558 U_STABLE void U_EXPORT2
00559 uset_addRange(USet* set, UChar32 start, UChar32 end);
00560
00570 U_STABLE void U_EXPORT2
00571 uset_addString(USet* set, const UChar* str, int32_t strLen);
00572
00582 U_STABLE void U_EXPORT2
00583 uset_addAllCodePoints(USet* set, const UChar *str, int32_t strLen);
00584
00593 U_STABLE void U_EXPORT2
00594 uset_remove(USet* set, UChar32 c);
00595
00605 U_STABLE void U_EXPORT2
00606 uset_removeRange(USet* set, UChar32 start, UChar32 end);
00607
00617 U_STABLE void U_EXPORT2
00618 uset_removeString(USet* set, const UChar* str, int32_t strLen);
00619
00631 U_STABLE void U_EXPORT2
00632 uset_removeAll(USet* set, const USet* removeSet);
00633
00648 U_STABLE void U_EXPORT2
00649 uset_retain(USet* set, UChar32 start, UChar32 end);
00650
00663 U_STABLE void U_EXPORT2
00664 uset_retainAll(USet* set, const USet* retain);
00665
00674 U_STABLE void U_EXPORT2
00675 uset_compact(USet* set);
00676
00685 U_STABLE void U_EXPORT2
00686 uset_complement(USet* set);
00687
00699 U_STABLE void U_EXPORT2
00700 uset_complementAll(USet* set, const USet* complement);
00701
00709 U_STABLE void U_EXPORT2
00710 uset_clear(USet* set);
00711
00738 U_STABLE void U_EXPORT2
00739 uset_closeOver(USet* set, int32_t attributes);
00740
00747 U_STABLE void U_EXPORT2
00748 uset_removeAllStrings(USet* set);
00749
00757 U_STABLE UBool U_EXPORT2
00758 uset_isEmpty(const USet* set);
00759
00768 U_STABLE UBool U_EXPORT2
00769 uset_contains(const USet* set, UChar32 c);
00770
00780 U_STABLE UBool U_EXPORT2
00781 uset_containsRange(const USet* set, UChar32 start, UChar32 end);
00782
00791 U_STABLE UBool U_EXPORT2
00792 uset_containsString(const USet* set, const UChar* str, int32_t strLen);
00793
00804 U_STABLE int32_t U_EXPORT2
00805 uset_indexOf(const USet* set, UChar32 c);
00806
00817 U_STABLE UChar32 U_EXPORT2
00818 uset_charAt(const USet* set, int32_t charIndex);
00819
00828 U_STABLE int32_t U_EXPORT2
00829 uset_size(const USet* set);
00830
00839 U_STABLE int32_t U_EXPORT2
00840 uset_getItemCount(const USet* set);
00841
00860 U_STABLE int32_t U_EXPORT2
00861 uset_getItem(const USet* set, int32_t itemIndex,
00862 UChar32* start, UChar32* end,
00863 UChar* str, int32_t strCapacity,
00864 UErrorCode* ec);
00865
00874 U_STABLE UBool U_EXPORT2
00875 uset_containsAll(const USet* set1, const USet* set2);
00876
00887 U_STABLE UBool U_EXPORT2
00888 uset_containsAllCodePoints(const USet* set, const UChar *str, int32_t strLen);
00889
00898 U_STABLE UBool U_EXPORT2
00899 uset_containsNone(const USet* set1, const USet* set2);
00900
00909 U_STABLE UBool U_EXPORT2
00910 uset_containsSome(const USet* set1, const USet* set2);
00911
00931 U_STABLE int32_t U_EXPORT2
00932 uset_span(const USet *set, const UChar *s, int32_t length, USetSpanCondition spanCondition);
00933
00952 U_STABLE int32_t U_EXPORT2
00953 uset_spanBack(const USet *set, const UChar *s, int32_t length, USetSpanCondition spanCondition);
00954
00974 U_STABLE int32_t U_EXPORT2
00975 uset_spanUTF8(const USet *set, const char *s, int32_t length, USetSpanCondition spanCondition);
00976
00995 U_STABLE int32_t U_EXPORT2
00996 uset_spanBackUTF8(const USet *set, const char *s, int32_t length, USetSpanCondition spanCondition);
00997
01006 U_STABLE UBool U_EXPORT2
01007 uset_equals(const USet* set1, const USet* set2);
01008
01009
01010
01011
01012
01062 U_STABLE int32_t U_EXPORT2
01063 uset_serialize(const USet* set, uint16_t* dest, int32_t destCapacity, UErrorCode* pErrorCode);
01064
01073 U_STABLE UBool U_EXPORT2
01074 uset_getSerializedSet(USerializedSet* fillSet, const uint16_t* src, int32_t srcLength);
01075
01083 U_STABLE void U_EXPORT2
01084 uset_setSerializedToOne(USerializedSet* fillSet, UChar32 c);
01085
01094 U_STABLE UBool U_EXPORT2
01095 uset_serializedContains(const USerializedSet* set, UChar32 c);
01096
01106 U_STABLE int32_t U_EXPORT2
01107 uset_getSerializedRangeCount(const USerializedSet* set);
01108
01122 U_STABLE UBool U_EXPORT2
01123 uset_getSerializedRange(const USerializedSet* set, int32_t rangeIndex,
01124 UChar32* pStart, UChar32* pEnd);
01125
01126 #endif