uset.h

Go to the documentation of this file.
00001 /*
00002 *******************************************************************************
00003 *
00004 *   Copyright (C) 2002-2008, 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 
00091     USET_ADD_CASE_MAPPINGS = 4,
00092     
00097     USET_SERIALIZED_STATIC_ARRAY_CAPACITY=8
00098 };
00099 
00100 #ifndef U_HIDE_DRAFT_API
00101 
00157 typedef enum USetSpanCondition {
00169     USET_SPAN_NOT_CONTAINED = 0,
00184     USET_SPAN_CONTAINED = 1,
00203     USET_SPAN_SIMPLE = 2,
00208     USET_SPAN_CONDITION_COUNT
00209 } USetSpanCondition;
00210 
00211 #endif /* U_HIDE_DRAFT_API */
00212 
00218 typedef struct USerializedSet {
00223     const uint16_t *array;
00228     int32_t bmpLength;
00233     int32_t length;
00238     uint16_t staticArray[USET_SERIALIZED_STATIC_ARRAY_CAPACITY];
00239 } USerializedSet;
00240 
00241 /*********************************************************************
00242  * USet API
00243  *********************************************************************/
00244 
00255 U_STABLE USet* U_EXPORT2
00256 uset_open(UChar32 start, UChar32 end);
00257 
00267 U_STABLE USet* U_EXPORT2
00268 uset_openPattern(const UChar* pattern, int32_t patternLength,
00269                  UErrorCode* ec);
00270 
00282 U_STABLE USet* U_EXPORT2
00283 uset_openPatternOptions(const UChar* pattern, int32_t patternLength,
00284                  uint32_t options,
00285                  UErrorCode* ec);
00286 
00293 U_STABLE void U_EXPORT2
00294 uset_close(USet* set);
00295 
00305 U_DRAFT USet * U_EXPORT2
00306 uset_clone(const USet *set);
00307 
00317 U_DRAFT UBool U_EXPORT2
00318 uset_isFrozen(const USet *set);
00319 
00334 U_DRAFT void U_EXPORT2
00335 uset_freeze(USet *set);
00336 
00347 U_DRAFT USet * U_EXPORT2
00348 uset_cloneAsThawed(const USet *set);
00349 
00359 U_STABLE void U_EXPORT2
00360 uset_set(USet* set,
00361          UChar32 start, UChar32 end);
00362 
00384 U_STABLE int32_t U_EXPORT2 
00385 uset_applyPattern(USet *set,
00386                   const UChar *pattern, int32_t patternLength,
00387                   uint32_t options,
00388                   UErrorCode *status);
00389 
00412 U_STABLE void U_EXPORT2
00413 uset_applyIntPropertyValue(USet* set,
00414                            UProperty prop, int32_t value, UErrorCode* ec);
00415 
00451 U_STABLE void U_EXPORT2
00452 uset_applyPropertyAlias(USet* set,
00453                         const UChar *prop, int32_t propLength,
00454                         const UChar *value, int32_t valueLength,
00455                         UErrorCode* ec);
00456 
00466 U_STABLE UBool U_EXPORT2
00467 uset_resemblesPattern(const UChar *pattern, int32_t patternLength,
00468                       int32_t pos);
00469 
00485 U_STABLE int32_t U_EXPORT2
00486 uset_toPattern(const USet* set,
00487                UChar* result, int32_t resultCapacity,
00488                UBool escapeUnprintable,
00489                UErrorCode* ec);
00490 
00499 U_STABLE void U_EXPORT2
00500 uset_add(USet* set, UChar32 c);
00501 
00514 U_STABLE void U_EXPORT2
00515 uset_addAll(USet* set, const USet *additionalSet);
00516 
00526 U_STABLE void U_EXPORT2
00527 uset_addRange(USet* set, UChar32 start, UChar32 end);
00528 
00538 U_STABLE void U_EXPORT2
00539 uset_addString(USet* set, const UChar* str, int32_t strLen);
00540 
00550 U_STABLE void U_EXPORT2
00551 uset_addAllCodePoints(USet* set, const UChar *str, int32_t strLen);
00552 
00561 U_STABLE void U_EXPORT2
00562 uset_remove(USet* set, UChar32 c);
00563 
00573 U_STABLE void U_EXPORT2
00574 uset_removeRange(USet* set, UChar32 start, UChar32 end);
00575 
00585 U_STABLE void U_EXPORT2
00586 uset_removeString(USet* set, const UChar* str, int32_t strLen);
00587 
00599 U_STABLE void U_EXPORT2
00600 uset_removeAll(USet* set, const USet* removeSet);
00601 
00616 U_STABLE void U_EXPORT2
00617 uset_retain(USet* set, UChar32 start, UChar32 end);
00618 
00631 U_STABLE void U_EXPORT2
00632 uset_retainAll(USet* set, const USet* retain);
00633 
00642 U_STABLE void U_EXPORT2
00643 uset_compact(USet* set);
00644 
00653 U_STABLE void U_EXPORT2
00654 uset_complement(USet* set);
00655 
00667 U_STABLE void U_EXPORT2
00668 uset_complementAll(USet* set, const USet* complement);
00669 
00677 U_STABLE void U_EXPORT2
00678 uset_clear(USet* set);
00679 
00687 U_STABLE UBool U_EXPORT2
00688 uset_isEmpty(const USet* set);
00689 
00698 U_STABLE UBool U_EXPORT2
00699 uset_contains(const USet* set, UChar32 c);
00700 
00710 U_STABLE UBool U_EXPORT2
00711 uset_containsRange(const USet* set, UChar32 start, UChar32 end);
00712 
00721 U_STABLE UBool U_EXPORT2
00722 uset_containsString(const USet* set, const UChar* str, int32_t strLen);
00723 
00734 U_STABLE int32_t U_EXPORT2
00735 uset_indexOf(const USet* set, UChar32 c);
00736 
00747 U_STABLE UChar32 U_EXPORT2
00748 uset_charAt(const USet* set, int32_t index);
00749 
00758 U_STABLE int32_t U_EXPORT2
00759 uset_size(const USet* set);
00760 
00769 U_STABLE int32_t U_EXPORT2
00770 uset_getItemCount(const USet* set);
00771 
00790 U_STABLE int32_t U_EXPORT2
00791 uset_getItem(const USet* set, int32_t itemIndex,
00792              UChar32* start, UChar32* end,
00793              UChar* str, int32_t strCapacity,
00794              UErrorCode* ec);
00795 
00804 U_STABLE UBool U_EXPORT2
00805 uset_containsAll(const USet* set1, const USet* set2);
00806 
00817 U_STABLE UBool U_EXPORT2
00818 uset_containsAllCodePoints(const USet* set, const UChar *str, int32_t strLen);
00819 
00828 U_STABLE UBool U_EXPORT2
00829 uset_containsNone(const USet* set1, const USet* set2);
00830 
00839 U_STABLE UBool U_EXPORT2
00840 uset_containsSome(const USet* set1, const USet* set2);
00841 
00861 U_DRAFT int32_t U_EXPORT2
00862 uset_span(const USet *set, const UChar *s, int32_t length, USetSpanCondition spanCondition);
00863 
00882 U_DRAFT int32_t U_EXPORT2
00883 uset_spanBack(const USet *set, const UChar *s, int32_t length, USetSpanCondition spanCondition);
00884 
00904 U_DRAFT int32_t U_EXPORT2
00905 uset_spanUTF8(const USet *set, const char *s, int32_t length, USetSpanCondition spanCondition);
00906 
00925 U_DRAFT int32_t U_EXPORT2
00926 uset_spanBackUTF8(const USet *set, const char *s, int32_t length, USetSpanCondition spanCondition);
00927 
00936 U_STABLE UBool U_EXPORT2
00937 uset_equals(const USet* set1, const USet* set2);
00938 
00939 /*********************************************************************
00940  * Serialized set API
00941  *********************************************************************/
00942 
00992 U_STABLE int32_t U_EXPORT2
00993 uset_serialize(const USet* set, uint16_t* dest, int32_t destCapacity, UErrorCode* pErrorCode);
00994 
01003 U_STABLE UBool U_EXPORT2
01004 uset_getSerializedSet(USerializedSet* fillSet, const uint16_t* src, int32_t srcLength);
01005 
01013 U_STABLE void U_EXPORT2
01014 uset_setSerializedToOne(USerializedSet* fillSet, UChar32 c);
01015 
01024 U_STABLE UBool U_EXPORT2
01025 uset_serializedContains(const USerializedSet* set, UChar32 c);
01026 
01036 U_STABLE int32_t U_EXPORT2
01037 uset_getSerializedRangeCount(const USerializedSet* set);
01038 
01052 U_STABLE UBool U_EXPORT2
01053 uset_getSerializedRange(const USerializedSet* set, int32_t rangeIndex,
01054                         UChar32* pStart, UChar32* pEnd);
01055 
01056 #endif

Generated on 17 Sep 2013 for ICU 4.0.1 by  doxygen 1.4.7