~ubuntu-branches/ubuntu/gutsy/icu/gutsy

« back to all changes in this revision

Viewing changes to source/common/uset.h

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2005-05-21 22:44:31 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: package-import@ubuntu.com-20050521224431-r7rktfhnu1n4tf1g
Tags: 2.1-2.1
Rename icu-doc to icu21-doc. icu-doc is built by the icu28 package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
*******************************************************************************
 
3
*
 
4
*   Copyright (C) 2002, International Business Machines
 
5
*   Corporation and others.  All Rights Reserved.
 
6
*
 
7
*******************************************************************************
 
8
*   file name:  uset.h
 
9
*   encoding:   US-ASCII
 
10
*   tab size:   8 (not used)
 
11
*   indentation:4
 
12
*
 
13
*   created on: 2002mar07
 
14
*   created by: Markus W. Scherer
 
15
*
 
16
*   Poor man's C version of UnicodeSet, with only basic functions.
 
17
*   See uset.c for more details.
 
18
*/
 
19
 
 
20
#ifndef __USET_H__
 
21
#define __USET_H__
 
22
 
 
23
#include "unicode/utypes.h"
 
24
 
 
25
struct USet;
 
26
typedef struct USet USet;
 
27
 
 
28
enum {
 
29
    USET_SERIALIZED_STATIC_ARRAY_CAPACITY=8     /**< enough for any single-code point set */
 
30
};
 
31
 
 
32
struct USerializedSet {
 
33
    const uint16_t *array;
 
34
    int32_t bmpLength, length;
 
35
    uint16_t staticArray[USET_SERIALIZED_STATIC_ARRAY_CAPACITY];
 
36
};
 
37
typedef struct USerializedSet USerializedSet;
 
38
 
 
39
U_CAPI USet * U_EXPORT2
 
40
uset_open(UChar32 start, UChar32 limit);
 
41
 
 
42
U_CAPI void U_EXPORT2
 
43
uset_close(USet *set);
 
44
 
 
45
U_CAPI UBool U_EXPORT2
 
46
uset_add(USet *set, UChar32 c);
 
47
 
 
48
U_CAPI void U_EXPORT2
 
49
uset_remove(USet *set, UChar32 c);
 
50
 
 
51
U_CAPI UBool U_EXPORT2
 
52
uset_isEmpty(const USet *set);
 
53
 
 
54
U_CAPI UBool U_EXPORT2
 
55
uset_contains(const USet *set, UChar32 c);
 
56
 
 
57
/**
 
58
 * Check if the set contains exactly one code point.
 
59
 *
 
60
 * @return The code point if the set contains exactly one, otherwise -1.
 
61
 */
 
62
U_CAPI int32_t U_EXPORT2
 
63
uset_containsOne(const USet *set);
 
64
 
 
65
U_CAPI int32_t U_EXPORT2
 
66
uset_countRanges(const USet *set);
 
67
 
 
68
U_CAPI UBool U_EXPORT2
 
69
uset_getRange(const USet *set, int32_t rangeIndex,
 
70
              UChar32 *pStart, UChar32 *pLimit);
 
71
 
 
72
U_CAPI int32_t U_EXPORT2
 
73
uset_serialize(const USet *set, uint16_t *dest, int32_t destCapacity, UErrorCode *pErrorCode);
 
74
 
 
75
U_CAPI UBool U_EXPORT2
 
76
uset_getSerializedSet(USerializedSet *fillSet, const uint16_t *src, int32_t srcCapacity);
 
77
 
 
78
/**
 
79
 * Set the USerializedSet to contain exactly c.
 
80
 */
 
81
U_CAPI void U_EXPORT2
 
82
uset_setSerializedToOne(USerializedSet *fillSet, UChar32 c);
 
83
 
 
84
U_CAPI UBool U_EXPORT2
 
85
uset_serializedContains(const USerializedSet *set, UChar32 c);
 
86
 
 
87
U_CAPI int32_t U_EXPORT2
 
88
uset_countSerializedRanges(const USerializedSet *set);
 
89
 
 
90
U_CAPI UBool U_EXPORT2
 
91
uset_getSerializedRange(const USerializedSet *set, int32_t rangeIndex,
 
92
                        UChar32 *pStart, UChar32 *pLimit);
 
93
 
 
94
#endif