ICU 4.8.1.1  4.8.1.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
uset.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************
3 *
4 * Copyright (C) 2002-2010, International Business Machines
5 * Corporation and others. All Rights Reserved.
6 *
7 *******************************************************************************
8 * file name: uset.h
9 * encoding: US-ASCII
10 * tab size: 8 (not used)
11 * indentation:4
12 *
13 * created on: 2002mar07
14 * created by: Markus W. Scherer
15 *
16 * C version of UnicodeSet.
17 */
18 
19 
27 #ifndef __USET_H__
28 #define __USET_H__
29 
30 #include "unicode/utypes.h"
31 #include "unicode/uchar.h"
32 #include "unicode/localpointer.h"
33 
34 #ifndef UCNV_H
35 struct USet;
41 typedef struct USet USet;
42 #endif
43 
49 enum {
55 
83 
93 
99 };
100 
156 typedef enum USetSpanCondition {
209 
215 typedef struct USerializedSet {
220  const uint16_t *array;
225  int32_t bmpLength;
230  int32_t length;
237 
238 /*********************************************************************
239  * USet API
240  *********************************************************************/
241 
251 
263 uset_open(UChar32 start, UChar32 end);
264 
275 uset_openPattern(const UChar* pattern, int32_t patternLength,
276  UErrorCode* ec);
277 
290 uset_openPatternOptions(const UChar* pattern, int32_t patternLength,
291  uint32_t options,
292  UErrorCode* ec);
293 
300 U_STABLE void U_EXPORT2
301 uset_close(USet* set);
302 
303 #if U_SHOW_CPLUSPLUS_API
304 
306 
316 U_DEFINE_LOCAL_OPEN_POINTER(LocalUSetPointer, USet, uset_close);
317 
319 
320 #endif
321 
332 uset_clone(const USet *set);
333 
344 uset_isFrozen(const USet *set);
345 
360 U_STABLE void U_EXPORT2
361 uset_freeze(USet *set);
362 
374 uset_cloneAsThawed(const USet *set);
375 
385 U_STABLE void U_EXPORT2
386 uset_set(USet* set,
387  UChar32 start, UChar32 end);
388 
410 U_STABLE int32_t U_EXPORT2
412  const UChar *pattern, int32_t patternLength,
413  uint32_t options,
414  UErrorCode *status);
415 
438 U_STABLE void U_EXPORT2
440  UProperty prop, int32_t value, UErrorCode* ec);
441 
477 U_STABLE void U_EXPORT2
479  const UChar *prop, int32_t propLength,
480  const UChar *value, int32_t valueLength,
481  UErrorCode* ec);
482 
493 uset_resemblesPattern(const UChar *pattern, int32_t patternLength,
494  int32_t pos);
495 
511 U_STABLE int32_t U_EXPORT2
512 uset_toPattern(const USet* set,
513  UChar* result, int32_t resultCapacity,
514  UBool escapeUnprintable,
515  UErrorCode* ec);
516 
525 U_STABLE void U_EXPORT2
526 uset_add(USet* set, UChar32 c);
527 
540 U_STABLE void U_EXPORT2
541 uset_addAll(USet* set, const USet *additionalSet);
542 
552 U_STABLE void U_EXPORT2
553 uset_addRange(USet* set, UChar32 start, UChar32 end);
554 
564 U_STABLE void U_EXPORT2
565 uset_addString(USet* set, const UChar* str, int32_t strLen);
566 
576 U_STABLE void U_EXPORT2
577 uset_addAllCodePoints(USet* set, const UChar *str, int32_t strLen);
578 
587 U_STABLE void U_EXPORT2
588 uset_remove(USet* set, UChar32 c);
589 
599 U_STABLE void U_EXPORT2
600 uset_removeRange(USet* set, UChar32 start, UChar32 end);
601 
611 U_STABLE void U_EXPORT2
612 uset_removeString(USet* set, const UChar* str, int32_t strLen);
613 
625 U_STABLE void U_EXPORT2
626 uset_removeAll(USet* set, const USet* removeSet);
627 
642 U_STABLE void U_EXPORT2
643 uset_retain(USet* set, UChar32 start, UChar32 end);
644 
657 U_STABLE void U_EXPORT2
658 uset_retainAll(USet* set, const USet* retain);
659 
668 U_STABLE void U_EXPORT2
669 uset_compact(USet* set);
670 
679 U_STABLE void U_EXPORT2
680 uset_complement(USet* set);
681 
693 U_STABLE void U_EXPORT2
694 uset_complementAll(USet* set, const USet* complement);
695 
703 U_STABLE void U_EXPORT2
704 uset_clear(USet* set);
705 
732 U_STABLE void U_EXPORT2
733 uset_closeOver(USet* set, int32_t attributes);
734 
741 U_STABLE void U_EXPORT2
743 
752 uset_isEmpty(const USet* set);
753 
763 uset_contains(const USet* set, UChar32 c);
764 
775 uset_containsRange(const USet* set, UChar32 start, UChar32 end);
776 
786 uset_containsString(const USet* set, const UChar* str, int32_t strLen);
787 
798 U_STABLE int32_t U_EXPORT2
799 uset_indexOf(const USet* set, UChar32 c);
800 
812 uset_charAt(const USet* set, int32_t charIndex);
813 
822 U_STABLE int32_t U_EXPORT2
823 uset_size(const USet* set);
824 
833 U_STABLE int32_t U_EXPORT2
834 uset_getItemCount(const USet* set);
835 
854 U_STABLE int32_t U_EXPORT2
855 uset_getItem(const USet* set, int32_t itemIndex,
856  UChar32* start, UChar32* end,
857  UChar* str, int32_t strCapacity,
858  UErrorCode* ec);
859 
869 uset_containsAll(const USet* set1, const USet* set2);
870 
882 uset_containsAllCodePoints(const USet* set, const UChar *str, int32_t strLen);
883 
893 uset_containsNone(const USet* set1, const USet* set2);
894 
904 uset_containsSome(const USet* set1, const USet* set2);
905 
925 U_STABLE int32_t U_EXPORT2
926 uset_span(const USet *set, const UChar *s, int32_t length, USetSpanCondition spanCondition);
927 
946 U_STABLE int32_t U_EXPORT2
947 uset_spanBack(const USet *set, const UChar *s, int32_t length, USetSpanCondition spanCondition);
948 
968 U_STABLE int32_t U_EXPORT2
969 uset_spanUTF8(const USet *set, const char *s, int32_t length, USetSpanCondition spanCondition);
970 
989 U_STABLE int32_t U_EXPORT2
990 uset_spanBackUTF8(const USet *set, const char *s, int32_t length, USetSpanCondition spanCondition);
991 
1001 uset_equals(const USet* set1, const USet* set2);
1002 
1003 /*********************************************************************
1004  * Serialized set API
1005  *********************************************************************/
1006 
1056 U_STABLE int32_t U_EXPORT2
1057 uset_serialize(const USet* set, uint16_t* dest, int32_t destCapacity, UErrorCode* pErrorCode);
1058 
1068 uset_getSerializedSet(USerializedSet* fillSet, const uint16_t* src, int32_t srcLength);
1069 
1077 U_STABLE void U_EXPORT2
1079 
1090 
1100 U_STABLE int32_t U_EXPORT2
1102 
1117 uset_getSerializedRange(const USerializedSet* set, int32_t rangeIndex,
1118  UChar32* pStart, UChar32* pEnd);
1119 
1120 #endif