uset.h

Go to the documentation of this file.
00001 /*
00002 *******************************************************************************
00003 *
00004 *   Copyright (C) 2002-2009, 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 
00155 typedef enum USetSpanCondition {
00167     USET_SPAN_NOT_CONTAINED = 0,
00182     USET_SPAN_CONTAINED = 1,
00201     USET_SPAN_SIMPLE = 2,
00206     USET_SPAN_CONDITION_COUNT
00207 } USetSpanCondition;
00208 
00214 typedef struct USerializedSet {
00219     const uint16_t *array;
00224     int32_t bmpLength;
00229     int32_t length;
00234     uint16_t staticArray[USET_SERIALIZED_STATIC_ARRAY_CAPACITY];
00235 } USerializedSet;
00236 
00237 /*********************************************************************
00238  * USet API
00239  *********************************************************************/
00240 
00248 U_DRAFT USet* U_EXPORT2
00249 uset_openEmpty();
00250 
00261 U_STABLE USet* U_EXPORT2
00262 uset_open(UChar32 start, UChar32 end);
00263 
00273 U_STABLE USet* U_EXPORT2
00274 uset_openPattern(const UChar* pattern, int32_t patternLength,
00275                  UErrorCode* ec);
00276 
00288 U_STABLE USet* U_EXPORT2
00289 uset_openPatternOptions(const UChar* pattern, int32_t patternLength,
00290                  uint32_t options,
00291                  UErrorCode* ec);
00292 
00299 U_STABLE void U_EXPORT2
00300 uset_close(USet* set);
00301 
00311 U_DRAFT USet * U_EXPORT2
00312 uset_clone(const USet *set);
00313 
00323 U_DRAFT UBool U_EXPORT2
00324 uset_isFrozen(const USet *set);
00325 
00340 U_DRAFT void U_EXPORT2
00341 uset_freeze(USet *set);
00342 
00353 U_DRAFT USet * U_EXPORT2
00354 uset_cloneAsThawed(const USet *set);
00355 
00365 U_STABLE void U_EXPORT2
00366 uset_set(USet* set,
00367          UChar32 start, UChar32 end);
00368 
00390 U_STABLE int32_t U_EXPORT2 
00391 uset_applyPattern(USet *set,
00392                   const UChar *pattern, int32_t patternLength,
00393                   uint32_t options,
00394                   UErrorCode *status);
00395 
00418 U_STABLE void U_EXPORT2
00419 uset_applyIntPropertyValue(USet* set,
00420                            UProperty prop, int32_t value, UErrorCode* ec);
00421 
00457 U_STABLE void U_EXPORT2
00458 uset_applyPropertyAlias(USet* set,
00459                         const UChar *prop, int32_t propLength,
00460                         const UChar *value, int32_t valueLength,
00461                         UErrorCode* ec);
00462 
00472 U_STABLE UBool U_EXPORT2
00473 uset_resemblesPattern(const UChar *pattern, int32_t patternLength,
00474                       int32_t pos);
00475 
00491 U_STABLE int32_t U_EXPORT2
00492 uset_toPattern(const USet* set,
00493                UChar* result, int32_t resultCapacity,
00494                UBool escapeUnprintable,
00495                UErrorCode* ec);
00496 
00505 U_STABLE void U_EXPORT2
00506 uset_add(USet* set, UChar32 c);
00507 
00520 U_STABLE void U_EXPORT2
00521 uset_addAll(USet* set, const USet *additionalSet);
00522 
00532 U_STABLE void U_EXPORT2
00533 uset_addRange(USet* set, UChar32 start, UChar32 end);
00534 
00544 U_STABLE void U_EXPORT2
00545 uset_addString(USet* set, const UChar* str, int32_t strLen);
00546 
00556 U_STABLE void U_EXPORT2
00557 uset_addAllCodePoints(USet* set, const UChar *str, int32_t strLen);
00558 
00567 U_STABLE void U_EXPORT2
00568 uset_remove(USet* set, UChar32 c);
00569 
00579 U_STABLE void U_EXPORT2
00580 uset_removeRange(USet* set, UChar32 start, UChar32 end);
00581 
00591 U_STABLE void U_EXPORT2
00592 uset_removeString(USet* set, const UChar* str, int32_t strLen);
00593 
00605 U_STABLE void U_EXPORT2
00606 uset_removeAll(USet* set, const USet* removeSet);
00607 
00622 U_STABLE void U_EXPORT2
00623 uset_retain(USet* set, UChar32 start, UChar32 end);
00624 
00637 U_STABLE void U_EXPORT2
00638 uset_retainAll(USet* set, const USet* retain);
00639 
00648 U_STABLE void U_EXPORT2
00649 uset_compact(USet* set);
00650 
00659 U_STABLE void U_EXPORT2
00660 uset_complement(USet* set);
00661 
00673 U_STABLE void U_EXPORT2
00674 uset_complementAll(USet* set, const USet* complement);
00675 
00683 U_STABLE void U_EXPORT2
00684 uset_clear(USet* set);
00685 
00712 U_DRAFT void U_EXPORT2
00713 uset_closeOver(USet* set, int32_t attributes);
00714 
00721 U_DRAFT void U_EXPORT2
00722 uset_removeAllStrings(USet* set);
00723 
00731 U_STABLE UBool U_EXPORT2
00732 uset_isEmpty(const USet* set);
00733 
00742 U_STABLE UBool U_EXPORT2
00743 uset_contains(const USet* set, UChar32 c);
00744 
00754 U_STABLE UBool U_EXPORT2
00755 uset_containsRange(const USet* set, UChar32 start, UChar32 end);
00756 
00765 U_STABLE UBool U_EXPORT2
00766 uset_containsString(const USet* set, const UChar* str, int32_t strLen);
00767 
00778 U_STABLE int32_t U_EXPORT2
00779 uset_indexOf(const USet* set, UChar32 c);
00780 
00791 U_STABLE UChar32 U_EXPORT2
00792 uset_charAt(const USet* set, int32_t charIndex);
00793 
00802 U_STABLE int32_t U_EXPORT2
00803 uset_size(const USet* set);
00804 
00813 U_STABLE int32_t U_EXPORT2
00814 uset_getItemCount(const USet* set);
00815 
00834 U_STABLE int32_t U_EXPORT2
00835 uset_getItem(const USet* set, int32_t itemIndex,
00836              UChar32* start, UChar32* end,
00837              UChar* str, int32_t strCapacity,
00838              UErrorCode* ec);
00839 
00848 U_STABLE UBool U_EXPORT2
00849 uset_containsAll(const USet* set1, const USet* set2);
00850 
00861 U_STABLE UBool U_EXPORT2
00862 uset_containsAllCodePoints(const USet* set, const UChar *str, int32_t strLen);
00863 
00872 U_STABLE UBool U_EXPORT2
00873 uset_containsNone(const USet* set1, const USet* set2);
00874 
00883 U_STABLE UBool U_EXPORT2
00884 uset_containsSome(const USet* set1, const USet* set2);
00885 
00905 U_DRAFT int32_t U_EXPORT2
00906 uset_span(const USet *set, const UChar *s, int32_t length, USetSpanCondition spanCondition);
00907 
00926 U_DRAFT int32_t U_EXPORT2
00927 uset_spanBack(const USet *set, const UChar *s, int32_t length, USetSpanCondition spanCondition);
00928 
00948 U_DRAFT int32_t U_EXPORT2
00949 uset_spanUTF8(const USet *set, const char *s, int32_t length, USetSpanCondition spanCondition);
00950 
00969 U_DRAFT int32_t U_EXPORT2
00970 uset_spanBackUTF8(const USet *set, const char *s, int32_t length, USetSpanCondition spanCondition);
00971 
00980 U_STABLE UBool U_EXPORT2
00981 uset_equals(const USet* set1, const USet* set2);
00982 
00983 /*********************************************************************
00984  * Serialized set API
00985  *********************************************************************/
00986 
01036 U_STABLE int32_t U_EXPORT2
01037 uset_serialize(const USet* set, uint16_t* dest, int32_t destCapacity, UErrorCode* pErrorCode);
01038 
01047 U_STABLE UBool U_EXPORT2
01048 uset_getSerializedSet(USerializedSet* fillSet, const uint16_t* src, int32_t srcLength);
01049 
01057 U_STABLE void U_EXPORT2
01058 uset_setSerializedToOne(USerializedSet* fillSet, UChar32 c);
01059 
01068 U_STABLE UBool U_EXPORT2
01069 uset_serializedContains(const USerializedSet* set, UChar32 c);
01070 
01080 U_STABLE int32_t U_EXPORT2
01081 uset_getSerializedRangeCount(const USerializedSet* set);
01082 
01096 U_STABLE UBool U_EXPORT2
01097 uset_getSerializedRange(const USerializedSet* set, int32_t rangeIndex,
01098                         UChar32* pStart, UChar32* pEnd);
01099 
01100 #endif

Generated on 18 Sep 2013 for ICU 4.2.1 by  doxygen 1.4.7