2
*******************************************************************************
4
* Copyright (C) 2002, International Business Machines
5
* Corporation and others. All Rights Reserved.
7
*******************************************************************************
10
* tab size: 8 (not used)
13
* created on: 2002mar07
14
* created by: Markus W. Scherer
16
* Poor man's C version of UnicodeSet, with only basic functions.
17
* See uset.c for more details.
23
#include "unicode/utypes.h"
26
typedef struct USet USet;
29
USET_SERIALIZED_STATIC_ARRAY_CAPACITY=8 /**< enough for any single-code point set */
32
struct USerializedSet {
33
const uint16_t *array;
34
int32_t bmpLength, length;
35
uint16_t staticArray[USET_SERIALIZED_STATIC_ARRAY_CAPACITY];
37
typedef struct USerializedSet USerializedSet;
39
U_CAPI USet * U_EXPORT2
40
uset_open(UChar32 start, UChar32 limit);
43
uset_close(USet *set);
45
U_CAPI UBool U_EXPORT2
46
uset_add(USet *set, UChar32 c);
49
uset_remove(USet *set, UChar32 c);
51
U_CAPI UBool U_EXPORT2
52
uset_isEmpty(const USet *set);
54
U_CAPI UBool U_EXPORT2
55
uset_contains(const USet *set, UChar32 c);
58
* Check if the set contains exactly one code point.
60
* @return The code point if the set contains exactly one, otherwise -1.
62
U_CAPI int32_t U_EXPORT2
63
uset_containsOne(const USet *set);
65
U_CAPI int32_t U_EXPORT2
66
uset_countRanges(const USet *set);
68
U_CAPI UBool U_EXPORT2
69
uset_getRange(const USet *set, int32_t rangeIndex,
70
UChar32 *pStart, UChar32 *pLimit);
72
U_CAPI int32_t U_EXPORT2
73
uset_serialize(const USet *set, uint16_t *dest, int32_t destCapacity, UErrorCode *pErrorCode);
75
U_CAPI UBool U_EXPORT2
76
uset_getSerializedSet(USerializedSet *fillSet, const uint16_t *src, int32_t srcCapacity);
79
* Set the USerializedSet to contain exactly c.
82
uset_setSerializedToOne(USerializedSet *fillSet, UChar32 c);
84
U_CAPI UBool U_EXPORT2
85
uset_serializedContains(const USerializedSet *set, UChar32 c);
87
U_CAPI int32_t U_EXPORT2
88
uset_countSerializedRanges(const USerializedSet *set);
90
U_CAPI UBool U_EXPORT2
91
uset_getSerializedRange(const USerializedSet *set, int32_t rangeIndex,
92
UChar32 *pStart, UChar32 *pLimit);