Main Page | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

uset.h

Go to the documentation of this file.
00001 /*
00002 *******************************************************************************
00003 *
00004 *   Copyright (C) 2002-2003, International Business Machines
00005 *   Corporation and others.  All Rights Reserved.
00006 *
00007 *******************************************************************************
00008 *   file name:  uset.h
00009 *   encoding:   US-ASCII
00010 *   tab size:   8 (not used)
00011 *   indentation:4
00012 *
00013 *   created on: 2002mar07
00014 *   created by: Markus W. Scherer
00015 *
00016 *   C version of UnicodeSet.
00017 */
00018 
00019 
00027 #ifndef __USET_H__
00028 #define __USET_H__
00029 
00030 #include "unicode/utypes.h"
00031 
00032 #ifndef UCNV_H
00033 struct USet;
00039 typedef struct USet USet;
00040 #endif
00041 
00047 enum {
00052     USET_IGNORE_SPACE = 1,  
00053 
00060     USET_CASE_INSENSITIVE = 2,  
00061 
00067     USET_CASE = 2,
00072     USET_SERIALIZED_STATIC_ARRAY_CAPACITY=8
00073 };
00074 
00080 typedef struct USerializedSet {
00085     const uint16_t *array;
00090     int32_t bmpLength;
00095     int32_t length;
00100     uint16_t staticArray[USET_SERIALIZED_STATIC_ARRAY_CAPACITY];
00101 } USerializedSet;
00102 
00103 /*********************************************************************
00104  * USet API
00105  *********************************************************************/
00106 
00116 U_CAPI USet* U_EXPORT2
00117 uset_open(UChar32 start, UChar32 end);
00118 
00128 U_CAPI USet* U_EXPORT2
00129 uset_openPattern(const UChar* pattern, int32_t patternLength,
00130                  UErrorCode* ec);
00131 
00143 U_CAPI USet* U_EXPORT2
00144 uset_openPatternOptions(const UChar* pattern, int32_t patternLength,
00145                  uint32_t options,
00146                  UErrorCode* ec);
00147 
00154 U_CAPI void U_EXPORT2
00155 uset_close(USet* set);
00156 
00172 U_CAPI int32_t U_EXPORT2
00173 uset_toPattern(const USet* set,
00174                UChar* result, int32_t resultCapacity,
00175                UBool escapeUnprintable,
00176                UErrorCode* ec);
00177 
00185 U_CAPI void U_EXPORT2
00186 uset_add(USet* set, UChar32 c);
00187 
00199 U_CAPI void U_EXPORT2
00200 uset_addAll(USet* set, const USet *additionalSet);
00201 
00210 U_CAPI void U_EXPORT2
00211 uset_addRange(USet* set, UChar32 start, UChar32 end);
00212 
00221 U_CAPI void U_EXPORT2
00222 uset_addString(USet* set, const UChar* str, int32_t strLen);
00223 
00231 U_CAPI void U_EXPORT2
00232 uset_remove(USet* set, UChar32 c);
00233 
00242 U_CAPI void U_EXPORT2
00243 uset_removeRange(USet* set, UChar32 start, UChar32 end);
00244 
00253 U_CAPI void U_EXPORT2
00254 uset_removeString(USet* set, const UChar* str, int32_t strLen);
00255 
00263 U_CAPI void U_EXPORT2
00264 uset_complement(USet* set);
00265 
00272 U_CAPI void U_EXPORT2
00273 uset_clear(USet* set);
00274 
00282 U_CAPI UBool U_EXPORT2
00283 uset_isEmpty(const USet* set);
00284 
00292 U_CAPI UBool U_EXPORT2
00293 uset_contains(const USet* set, UChar32 c);
00294 
00304 U_CAPI UBool U_EXPORT2
00305 uset_containsRange(const USet* set, UChar32 start, UChar32 end);
00306 
00315 U_CAPI UBool U_EXPORT2
00316 uset_containsString(const USet* set, const UChar* str, int32_t strLen);
00317 
00326 U_CAPI int32_t U_EXPORT2
00327 uset_size(const USet* set);
00328 
00337 U_CAPI int32_t U_EXPORT2
00338 uset_getItemCount(const USet* set);
00339 
00358 U_CAPI int32_t U_EXPORT2
00359 uset_getItem(const USet* set, int32_t itemIndex,
00360              UChar32* start, UChar32* end,
00361              UChar* str, int32_t strCapacity,
00362              UErrorCode* ec);
00363 
00364 /*********************************************************************
00365  * Serialized set API
00366  *********************************************************************/
00367 
00417 U_CAPI int32_t U_EXPORT2
00418 uset_serialize(const USet* set, uint16_t* dest, int32_t destCapacity, UErrorCode* pErrorCode);
00419 
00428 U_CAPI UBool U_EXPORT2
00429 uset_getSerializedSet(USerializedSet* fillSet, const uint16_t* src, int32_t srcLength);
00430 
00438 U_CAPI void U_EXPORT2
00439 uset_setSerializedToOne(USerializedSet* fillSet, UChar32 c);
00440 
00449 U_CAPI UBool U_EXPORT2
00450 uset_serializedContains(const USerializedSet* set, UChar32 c);
00451 
00461 U_CAPI int32_t U_EXPORT2
00462 uset_getSerializedRangeCount(const USerializedSet* set);
00463 
00477 U_CAPI UBool U_EXPORT2
00478 uset_getSerializedRange(const USerializedSet* set, int32_t rangeIndex,
00479                         UChar32* pStart, UChar32* pEnd);
00480 
00481 #endif

Generated on Wed Sep 3 17:47:10 2003 for ICU 2.6 by doxygen 1.3.2