Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

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 #include "unicode/umisc.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 
00061     USET_CASE_INSENSITIVE = 2,  
00062 
00068     USET_CASE = 2,
00073     USET_SERIALIZED_STATIC_ARRAY_CAPACITY=8
00074 };
00075 
00081 typedef struct USerializedSet {
00086     const uint16_t *array;
00091     int32_t bmpLength;
00096     int32_t length;
00101     uint16_t staticArray[USET_SERIALIZED_STATIC_ARRAY_CAPACITY];
00102 } USerializedSet;
00103 
00104 /*********************************************************************
00105  * USet API
00106  *********************************************************************/
00107 
00117 U_CAPI USet* U_EXPORT2
00118 uset_open(UChar32 start, UChar32 end);
00119 
00129 U_CAPI USet* U_EXPORT2
00130 uset_openPattern(const UChar* pattern, int32_t patternLength,
00131                  UErrorCode* ec);
00132 
00144 U_CAPI USet* U_EXPORT2
00145 uset_openPatternOptions(const UChar* pattern, int32_t patternLength,
00146                  uint32_t options,
00147                  UErrorCode* ec);
00148 
00155 U_CAPI void U_EXPORT2
00156 uset_close(USet* set);
00157 
00178 U_CAPI int32_t U_EXPORT2 
00179 uset_applyPattern(USet *set,
00180                   const UChar *pattern, int32_t patternLength,
00181                   uint32_t options,
00182                   UErrorCode *status);
00183 
00199 U_CAPI int32_t U_EXPORT2
00200 uset_toPattern(const USet* set,
00201                UChar* result, int32_t resultCapacity,
00202                UBool escapeUnprintable,
00203                UErrorCode* ec);
00204 
00212 U_CAPI void U_EXPORT2
00213 uset_add(USet* set, UChar32 c);
00214 
00226 U_CAPI void U_EXPORT2
00227 uset_addAll(USet* set, const USet *additionalSet);
00228 
00237 U_CAPI void U_EXPORT2
00238 uset_addRange(USet* set, UChar32 start, UChar32 end);
00239 
00248 U_CAPI void U_EXPORT2
00249 uset_addString(USet* set, const UChar* str, int32_t strLen);
00250 
00258 U_CAPI void U_EXPORT2
00259 uset_remove(USet* set, UChar32 c);
00260 
00269 U_CAPI void U_EXPORT2
00270 uset_removeRange(USet* set, UChar32 start, UChar32 end);
00271 
00280 U_CAPI void U_EXPORT2
00281 uset_removeString(USet* set, const UChar* str, int32_t strLen);
00282 
00290 U_CAPI void U_EXPORT2
00291 uset_complement(USet* set);
00292 
00299 U_CAPI void U_EXPORT2
00300 uset_clear(USet* set);
00301 
00309 U_CAPI UBool U_EXPORT2
00310 uset_isEmpty(const USet* set);
00311 
00319 U_CAPI UBool U_EXPORT2
00320 uset_contains(const USet* set, UChar32 c);
00321 
00331 U_CAPI UBool U_EXPORT2
00332 uset_containsRange(const USet* set, UChar32 start, UChar32 end);
00333 
00342 U_CAPI UBool U_EXPORT2
00343 uset_containsString(const USet* set, const UChar* str, int32_t strLen);
00344 
00353 U_CAPI int32_t U_EXPORT2
00354 uset_size(const USet* set);
00355 
00364 U_CAPI int32_t U_EXPORT2
00365 uset_getItemCount(const USet* set);
00366 
00385 U_CAPI int32_t U_EXPORT2
00386 uset_getItem(const USet* set, int32_t itemIndex,
00387              UChar32* start, UChar32* end,
00388              UChar* str, int32_t strCapacity,
00389              UErrorCode* ec);
00390 
00391 /*********************************************************************
00392  * Serialized set API
00393  *********************************************************************/
00394 
00444 U_CAPI int32_t U_EXPORT2
00445 uset_serialize(const USet* set, uint16_t* dest, int32_t destCapacity, UErrorCode* pErrorCode);
00446 
00455 U_CAPI UBool U_EXPORT2
00456 uset_getSerializedSet(USerializedSet* fillSet, const uint16_t* src, int32_t srcLength);
00457 
00465 U_CAPI void U_EXPORT2
00466 uset_setSerializedToOne(USerializedSet* fillSet, UChar32 c);
00467 
00476 U_CAPI UBool U_EXPORT2
00477 uset_serializedContains(const USerializedSet* set, UChar32 c);
00478 
00488 U_CAPI int32_t U_EXPORT2
00489 uset_getSerializedRangeCount(const USerializedSet* set);
00490 
00504 U_CAPI UBool U_EXPORT2
00505 uset_getSerializedRange(const USerializedSet* set, int32_t rangeIndex,
00506                         UChar32* pStart, UChar32* pEnd);
00507 
00508 #endif

Generated on Mon Nov 24 14:35:44 2003 for ICU 2.8 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001