- Main Page
- Modules
- Data Structures
- Files
- Related Pages

- Search for |

- File List
- Globals

# uset.h

Go to the documentation of this file.

    00001 /*
    00002 *******************************************************************************
    00003 *
    00004 *   Copyright (C) 2002-2007, 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
    00254 U_STABLE USet* U_EXPORT2
    00255 uset_open(UChar32 start, UChar32 end);
    00256
    00266 U_STABLE USet* U_EXPORT2
    00267 uset_openPattern(const UChar* pattern, int32_t patternLength,
    00268                  UErrorCode* ec);
    00269
    00281 U_STABLE USet* U_EXPORT2
    00282 uset_openPatternOptions(const UChar* pattern, int32_t patternLength,
    00283                  uint32_t options,
    00284                  UErrorCode* ec);
    00285
    00292 U_STABLE void U_EXPORT2
    00293 uset_close(USet* set);
    00294
    00304 U_DRAFT USet * U_EXPORT2
    00305 uset_clone(const USet *set);
    00306
    00316 U_DRAFT UBool U_EXPORT2
    00317 uset_isFrozen(const USet *set);
    00318
    00333 U_DRAFT void U_EXPORT2
    00334 uset_freeze(USet *set);
    00335
    00346 U_DRAFT USet * U_EXPORT2
    00347 uset_cloneAsThawed(const USet *set);
    00348
    00358 U_STABLE void U_EXPORT2
    00359 uset_set(USet* set,
    00360          UChar32 start, UChar32 end);
    00361
    00383 U_STABLE int32_t U_EXPORT2
    00384 uset_applyPattern(USet *set,
    00385                   const UChar *pattern, int32_t patternLength,
    00386                   uint32_t options,
    00387                   UErrorCode *status);
    00388
    00411 U_STABLE void U_EXPORT2
    00412 uset_applyIntPropertyValue(USet* set,
    00413                            UProperty prop, int32_t value, UErrorCode* ec);
    00414
    00450 U_STABLE void U_EXPORT2
    00451 uset_applyPropertyAlias(USet* set,
    00452                         const UChar *prop, int32_t propLength,
    00453                         const UChar *value, int32_t valueLength,
    00454                         UErrorCode* ec);
    00455
    00465 U_STABLE UBool U_EXPORT2
    00466 uset_resemblesPattern(const UChar *pattern, int32_t patternLength,
    00467                       int32_t pos);
    00468
    00484 U_STABLE int32_t U_EXPORT2
    00485 uset_toPattern(const USet* set,
    00486                UChar* result, int32_t resultCapacity,
    00487                UBool escapeUnprintable,
    00488                UErrorCode* ec);
    00489
    00498 U_STABLE void U_EXPORT2
    00499 uset_add(USet* set, UChar32 c);
    00500
    00513 U_STABLE void U_EXPORT2
    00514 uset_addAll(USet* set, const USet *additionalSet);
    00515
    00525 U_STABLE void U_EXPORT2
    00526 uset_addRange(USet* set, UChar32 start, UChar32 end);
    00527
    00537 U_STABLE void U_EXPORT2
    00538 uset_addString(USet* set, const UChar* str, int32_t strLen);
    00539
    00549 U_STABLE void U_EXPORT2
    00550 uset_addAllCodePoints(USet* set, const UChar *str, int32_t strLen);
    00551
    00560 U_STABLE void U_EXPORT2
    00561 uset_remove(USet* set, UChar32 c);
    00562
    00572 U_STABLE void U_EXPORT2
    00573 uset_removeRange(USet* set, UChar32 start, UChar32 end);
    00574
    00584 U_STABLE void U_EXPORT2
    00585 uset_removeString(USet* set, const UChar* str, int32_t strLen);
    00586
    00598 U_STABLE void U_EXPORT2
    00599 uset_removeAll(USet* set, const USet* removeSet);
    00600
    00615 U_STABLE void U_EXPORT2
    00616 uset_retain(USet* set, UChar32 start, UChar32 end);
    00617
    00630 U_STABLE void U_EXPORT2
    00631 uset_retainAll(USet* set, const USet* retain);
    00632
    00641 U_STABLE void U_EXPORT2
    00642 uset_compact(USet* set);
    00643
    00652 U_STABLE void U_EXPORT2
    00653 uset_complement(USet* set);
    00654
    00666 U_STABLE void U_EXPORT2
    00667 uset_complementAll(USet* set, const USet* complement);
    00668
    00676 U_STABLE void U_EXPORT2
    00677 uset_clear(USet* set);
    00678
    00686 U_STABLE UBool U_EXPORT2
    00687 uset_isEmpty(const USet* set);
    00688
    00697 U_STABLE UBool U_EXPORT2
    00698 uset_contains(const USet* set, UChar32 c);
    00699
    00709 U_STABLE UBool U_EXPORT2
    00710 uset_containsRange(const USet* set, UChar32 start, UChar32 end);
    00711
    00720 U_STABLE UBool U_EXPORT2
    00721 uset_containsString(const USet* set, const UChar* str, int32_t strLen);
    00722
    00733 U_STABLE int32_t U_EXPORT2
    00734 uset_indexOf(const USet* set, UChar32 c);
    00735
    00746 U_STABLE UChar32 U_EXPORT2
    00747 uset_charAt(const USet* set, int32_t index);
    00748
    00757 U_STABLE int32_t U_EXPORT2
    00758 uset_size(const USet* set);
    00759
    00768 U_STABLE int32_t U_EXPORT2
    00769 uset_getItemCount(const USet* set);
    00770
    00789 U_STABLE int32_t U_EXPORT2
    00790 uset_getItem(const USet* set, int32_t itemIndex,
    00791              UChar32* start, UChar32* end,
    00792              UChar* str, int32_t strCapacity,
    00793              UErrorCode* ec);
    00794
    00803 U_STABLE UBool U_EXPORT2
    00804 uset_containsAll(const USet* set1, const USet* set2);
    00805
    00816 U_STABLE UBool U_EXPORT2
    00817 uset_containsAllCodePoints(const USet* set, const UChar *str, int32_t strLen);
    00818
    00827 U_STABLE UBool U_EXPORT2
    00828 uset_containsNone(const USet* set1, const USet* set2);
    00829
    00838 U_STABLE UBool U_EXPORT2
    00839 uset_containsSome(const USet* set1, const USet* set2);
    00840
    00860 U_DRAFT int32_t U_EXPORT2
    00861 uset_span(const USet *set, const UChar *s, int32_t length, USetSpanCondition spanCondition);
    00862
    00881 U_DRAFT int32_t U_EXPORT2
    00882 uset_spanBack(const USet *set, const UChar *s, int32_t length, USetSpanCondition spanCondition);
    00883
    00903 U_DRAFT int32_t U_EXPORT2
    00904 uset_spanUTF8(const USet *set, const char *s, int32_t length, USetSpanCondition spanCondition);
    00905
    00924 U_DRAFT int32_t U_EXPORT2
    00925 uset_spanBackUTF8(const USet *set, const char *s, int32_t length, USetSpanCondition spanCondition);
    00926
    00935 U_STABLE UBool U_EXPORT2
    00936 uset_equals(const USet* set1, const USet* set2);
    00937
    00938 /*********************************************************************
    00939  * Serialized set API
    00940  *********************************************************************/
    00941
    00991 U_STABLE int32_t U_EXPORT2
    00992 uset_serialize(const USet* set, uint16_t* dest, int32_t destCapacity, UErrorCode* pErrorCode);
    00993
    01002 U_STABLE UBool U_EXPORT2
    01003 uset_getSerializedSet(USerializedSet* fillSet, const uint16_t* src, int32_t srcLength);
    01004
    01012 U_STABLE void U_EXPORT2
    01013 uset_setSerializedToOne(USerializedSet* fillSet, UChar32 c);
    01014
    01023 U_STABLE UBool U_EXPORT2
    01024 uset_serializedContains(const USerializedSet* set, UChar32 c);
    01025
    01035 U_STABLE int32_t U_EXPORT2
    01036 uset_getSerializedRangeCount(const USerializedSet* set);
    01037
    01051 U_STABLE UBool U_EXPORT2
    01052 uset_getSerializedRange(const USerializedSet* set, int32_t rangeIndex,
    01053                         UChar32* pStart, UChar32* pEnd);
    01054
    01055 #endif