uset.h

Go to the documentation of this file.
00001 /*
00002 *******************************************************************************
00003 *
00004 *   Copyright (C) 2002-2005, 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/uchar.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 
00081     USET_CASE_INSENSITIVE = 2,  
00082 
00088     USET_CASE = 2,
00089 
00098     USET_ADD_CASE_MAPPINGS = 4,
00099 
00104     USET_SERIALIZED_STATIC_ARRAY_CAPACITY=8
00105 };
00106 
00112 typedef struct USerializedSet {
00117     const uint16_t *array;
00122     int32_t bmpLength;
00127     int32_t length;
00132     uint16_t staticArray[USET_SERIALIZED_STATIC_ARRAY_CAPACITY];
00133 } USerializedSet;
00134 
00135 /*********************************************************************
00136  * USet API
00137  *********************************************************************/
00138 
00148 U_STABLE USet* U_EXPORT2
00149 uset_open(UChar32 start, UChar32 end);
00150 
00160 U_STABLE USet* U_EXPORT2
00161 uset_openPattern(const UChar* pattern, int32_t patternLength,
00162                  UErrorCode* ec);
00163 
00175 U_STABLE USet* U_EXPORT2
00176 uset_openPatternOptions(const UChar* pattern, int32_t patternLength,
00177                  uint32_t options,
00178                  UErrorCode* ec);
00179 
00186 U_STABLE void U_EXPORT2
00187 uset_close(USet* set);
00188 
00197 U_DRAFT void U_EXPORT2
00198 uset_set(USet* set,
00199          UChar32 start, UChar32 end);
00200 
00221 U_STABLE int32_t U_EXPORT2 
00222 uset_applyPattern(USet *set,
00223                   const UChar *pattern, int32_t patternLength,
00224                   uint32_t options,
00225                   UErrorCode *status);
00226 
00248 U_DRAFT void U_EXPORT2
00249 uset_applyIntPropertyValue(USet* set,
00250                            UProperty prop, int32_t value, UErrorCode* ec);
00251 
00286 U_DRAFT void U_EXPORT2
00287 uset_applyPropertyAlias(USet* set,
00288                         const UChar *prop, int32_t propLength,
00289                         const UChar *value, int32_t valueLength,
00290                         UErrorCode* ec);
00291 
00301 U_DRAFT UBool U_EXPORT2
00302 uset_resemblesPattern(const UChar *pattern, int32_t patternLength,
00303                       int32_t pos);
00304 
00320 U_STABLE int32_t U_EXPORT2
00321 uset_toPattern(const USet* set,
00322                UChar* result, int32_t resultCapacity,
00323                UBool escapeUnprintable,
00324                UErrorCode* ec);
00325 
00333 U_STABLE void U_EXPORT2
00334 uset_add(USet* set, UChar32 c);
00335 
00347 U_STABLE void U_EXPORT2
00348 uset_addAll(USet* set, const USet *additionalSet);
00349 
00358 U_STABLE void U_EXPORT2
00359 uset_addRange(USet* set, UChar32 start, UChar32 end);
00360 
00369 U_STABLE void U_EXPORT2
00370 uset_addString(USet* set, const UChar* str, int32_t strLen);
00371 
00380 U_DRAFT void U_EXPORT2
00381 uset_addAllCodePoints(USet* set, const UChar *str, int32_t strLen);
00382 
00390 U_STABLE void U_EXPORT2
00391 uset_remove(USet* set, UChar32 c);
00392 
00401 U_STABLE void U_EXPORT2
00402 uset_removeRange(USet* set, UChar32 start, UChar32 end);
00403 
00412 U_STABLE void U_EXPORT2
00413 uset_removeString(USet* set, const UChar* str, int32_t strLen);
00414 
00425 U_DRAFT void U_EXPORT2
00426 uset_removeAll(USet* set, const USet* removeSet);
00427 
00441 U_DRAFT void U_EXPORT2
00442 uset_retain(USet* set, UChar32 start, UChar32 end);
00443 
00455 U_DRAFT void U_EXPORT2
00456 uset_retainAll(USet* set, const USet* retain);
00457 
00465 U_DRAFT void U_EXPORT2
00466 uset_compact(USet* set);
00467 
00475 U_STABLE void U_EXPORT2
00476 uset_complement(USet* set);
00477 
00488 U_DRAFT void U_EXPORT2
00489 uset_complementAll(USet* set, const USet* complement);
00490 
00497 U_STABLE void U_EXPORT2
00498 uset_clear(USet* set);
00499 
00507 U_STABLE UBool U_EXPORT2
00508 uset_isEmpty(const USet* set);
00509 
00517 U_STABLE UBool U_EXPORT2
00518 uset_contains(const USet* set, UChar32 c);
00519 
00529 U_STABLE UBool U_EXPORT2
00530 uset_containsRange(const USet* set, UChar32 start, UChar32 end);
00531 
00540 U_STABLE UBool U_EXPORT2
00541 uset_containsString(const USet* set, const UChar* str, int32_t strLen);
00542 
00553 U_DRAFT int32_t U_EXPORT2
00554 uset_indexOf(const USet* set, UChar32 c);
00555 
00566 U_DRAFT UChar32 U_EXPORT2
00567 uset_charAt(const USet* set, int32_t index);
00568 
00577 U_STABLE int32_t U_EXPORT2
00578 uset_size(const USet* set);
00579 
00588 U_STABLE int32_t U_EXPORT2
00589 uset_getItemCount(const USet* set);
00590 
00609 U_STABLE int32_t U_EXPORT2
00610 uset_getItem(const USet* set, int32_t itemIndex,
00611              UChar32* start, UChar32* end,
00612              UChar* str, int32_t strCapacity,
00613              UErrorCode* ec);
00614 
00623 U_DRAFT UBool U_EXPORT2
00624 uset_containsAll(const USet* set1, const USet* set2);
00625 
00636 U_DRAFT UBool U_EXPORT2
00637 uset_containsAllCodePoints(const USet* set, const UChar *str, int32_t strLen);
00638 
00647 U_DRAFT UBool U_EXPORT2
00648 uset_containsNone(const USet* set1, const USet* set2);
00649 
00658 U_DRAFT UBool U_EXPORT2
00659 uset_containsSome(const USet* set1, const USet* set2);
00660 
00669 U_DRAFT UBool U_EXPORT2
00670 uset_equals(const USet* set1, const USet* set2);
00671 
00672 /*********************************************************************
00673  * Serialized set API
00674  *********************************************************************/
00675 
00725 U_STABLE int32_t U_EXPORT2
00726 uset_serialize(const USet* set, uint16_t* dest, int32_t destCapacity, UErrorCode* pErrorCode);
00727 
00736 U_STABLE UBool U_EXPORT2
00737 uset_getSerializedSet(USerializedSet* fillSet, const uint16_t* src, int32_t srcLength);
00738 
00746 U_STABLE void U_EXPORT2
00747 uset_setSerializedToOne(USerializedSet* fillSet, UChar32 c);
00748 
00757 U_STABLE UBool U_EXPORT2
00758 uset_serializedContains(const USerializedSet* set, UChar32 c);
00759 
00769 U_STABLE int32_t U_EXPORT2
00770 uset_getSerializedRangeCount(const USerializedSet* set);
00771 
00785 U_STABLE UBool U_EXPORT2
00786 uset_getSerializedRange(const USerializedSet* set, int32_t rangeIndex,
00787                         UChar32* pStart, UChar32* pEnd);
00788 
00789 #endif

Generated on Tue Sep 13 11:03:25 2005 for ICU 3.4 by  doxygen 1.4.4