ICU 52.1  52.1
uset.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************
3 *
4 * Copyright (C) 2002-2012, 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 };
94 
150 typedef enum USetSpanCondition {
203 
204 enum {
212 };
213 
219 typedef struct USerializedSet {
224  const uint16_t *array;
229  int32_t bmpLength;
234  int32_t length;
241 
242 /*********************************************************************
243  * USet API
244  *********************************************************************/
245 
253 U_STABLE USet* U_EXPORT2
254 uset_openEmpty(void);
255 
266 U_STABLE USet* U_EXPORT2
267 uset_open(UChar32 start, UChar32 end);
268 
278 U_STABLE USet* U_EXPORT2
279 uset_openPattern(const UChar* pattern, int32_t patternLength,
280  UErrorCode* ec);
281 
293 U_STABLE USet* U_EXPORT2
294 uset_openPatternOptions(const UChar* pattern, int32_t patternLength,
295  uint32_t options,
296  UErrorCode* ec);
297 
304 U_STABLE void U_EXPORT2
305 uset_close(USet* set);
306 
307 #if U_SHOW_CPLUSPLUS_API
308 
310 
321 
323 
324 #endif
325 
335 U_STABLE USet * U_EXPORT2
336 uset_clone(const USet *set);
337 
347 U_STABLE UBool U_EXPORT2
348 uset_isFrozen(const USet *set);
349 
364 U_STABLE void U_EXPORT2
365 uset_freeze(USet *set);
366 
377 U_STABLE USet * U_EXPORT2
378 uset_cloneAsThawed(const USet *set);
379 
389 U_STABLE void U_EXPORT2
390 uset_set(USet* set,
391  UChar32 start, UChar32 end);
392 
414 U_STABLE int32_t U_EXPORT2
416  const UChar *pattern, int32_t patternLength,
417  uint32_t options,
418  UErrorCode *status);
419 
442 U_STABLE void U_EXPORT2
444  UProperty prop, int32_t value, UErrorCode* ec);
445 
481 U_STABLE void U_EXPORT2
483  const UChar *prop, int32_t propLength,
484  const UChar *value, int32_t valueLength,
485  UErrorCode* ec);
486 
496 U_STABLE UBool U_EXPORT2
497 uset_resemblesPattern(const UChar *pattern, int32_t patternLength,
498  int32_t pos);
499 
515 U_STABLE int32_t U_EXPORT2
516 uset_toPattern(const USet* set,
517  UChar* result, int32_t resultCapacity,
518  UBool escapeUnprintable,
519  UErrorCode* ec);
520 
529 U_STABLE void U_EXPORT2
530 uset_add(USet* set, UChar32 c);
531 
544 U_STABLE void U_EXPORT2
545 uset_addAll(USet* set, const USet *additionalSet);
546 
556 U_STABLE void U_EXPORT2
557 uset_addRange(USet* set, UChar32 start, UChar32 end);
558 
568 U_STABLE void U_EXPORT2
569 uset_addString(USet* set, const UChar* str, int32_t strLen);
570 
580 U_STABLE void U_EXPORT2
581 uset_addAllCodePoints(USet* set, const UChar *str, int32_t strLen);
582 
591 U_STABLE void U_EXPORT2
592 uset_remove(USet* set, UChar32 c);
593 
603 U_STABLE void U_EXPORT2
604 uset_removeRange(USet* set, UChar32 start, UChar32 end);
605 
615 U_STABLE void U_EXPORT2
616 uset_removeString(USet* set, const UChar* str, int32_t strLen);
617 
629 U_STABLE void U_EXPORT2
630 uset_removeAll(USet* set, const USet* removeSet);
631 
646 U_STABLE void U_EXPORT2
647 uset_retain(USet* set, UChar32 start, UChar32 end);
648 
661 U_STABLE void U_EXPORT2
662 uset_retainAll(USet* set, const USet* retain);
663 
672 U_STABLE void U_EXPORT2
673 uset_compact(USet* set);
674 
683 U_STABLE void U_EXPORT2
684 uset_complement(USet* set);
685 
697 U_STABLE void U_EXPORT2
698 uset_complementAll(USet* set, const USet* complement);
699 
707 U_STABLE void U_EXPORT2
708 uset_clear(USet* set);
709 
736 U_STABLE void U_EXPORT2
737 uset_closeOver(USet* set, int32_t attributes);
738 
745 U_STABLE void U_EXPORT2
747 
755 U_STABLE UBool U_EXPORT2
756 uset_isEmpty(const USet* set);
757 
766 U_STABLE UBool U_EXPORT2
767 uset_contains(const USet* set, UChar32 c);
768 
778 U_STABLE UBool U_EXPORT2
779 uset_containsRange(const USet* set, UChar32 start, UChar32 end);
780 
789 U_STABLE UBool U_EXPORT2
790 uset_containsString(const USet* set, const UChar* str, int32_t strLen);
791 
802 U_STABLE int32_t U_EXPORT2
803 uset_indexOf(const USet* set, UChar32 c);
804 
815 U_STABLE UChar32 U_EXPORT2
816 uset_charAt(const USet* set, int32_t charIndex);
817 
826 U_STABLE int32_t U_EXPORT2
827 uset_size(const USet* set);
828 
837 U_STABLE int32_t U_EXPORT2
838 uset_getItemCount(const USet* set);
839 
858 U_STABLE int32_t U_EXPORT2
859 uset_getItem(const USet* set, int32_t itemIndex,
860  UChar32* start, UChar32* end,
861  UChar* str, int32_t strCapacity,
862  UErrorCode* ec);
863 
872 U_STABLE UBool U_EXPORT2
873 uset_containsAll(const USet* set1, const USet* set2);
874 
885 U_STABLE UBool U_EXPORT2
886 uset_containsAllCodePoints(const USet* set, const UChar *str, int32_t strLen);
887 
896 U_STABLE UBool U_EXPORT2
897 uset_containsNone(const USet* set1, const USet* set2);
898 
907 U_STABLE UBool U_EXPORT2
908 uset_containsSome(const USet* set1, const USet* set2);
909 
929 U_STABLE int32_t U_EXPORT2
930 uset_span(const USet *set, const UChar *s, int32_t length, USetSpanCondition spanCondition);
931 
950 U_STABLE int32_t U_EXPORT2
951 uset_spanBack(const USet *set, const UChar *s, int32_t length, USetSpanCondition spanCondition);
952 
972 U_STABLE int32_t U_EXPORT2
973 uset_spanUTF8(const USet *set, const char *s, int32_t length, USetSpanCondition spanCondition);
974 
993 U_STABLE int32_t U_EXPORT2
994 uset_spanBackUTF8(const USet *set, const char *s, int32_t length, USetSpanCondition spanCondition);
995 
1004 U_STABLE UBool U_EXPORT2
1005 uset_equals(const USet* set1, const USet* set2);
1006 
1007 /*********************************************************************
1008  * Serialized set API
1009  *********************************************************************/
1010 
1060 U_STABLE int32_t U_EXPORT2
1061 uset_serialize(const USet* set, uint16_t* dest, int32_t destCapacity, UErrorCode* pErrorCode);
1062 
1071 U_STABLE UBool U_EXPORT2
1072 uset_getSerializedSet(USerializedSet* fillSet, const uint16_t* src, int32_t srcLength);
1073 
1081 U_STABLE void U_EXPORT2
1083 
1092 U_STABLE UBool U_EXPORT2
1094 
1104 U_STABLE int32_t U_EXPORT2
1106 
1120 U_STABLE UBool U_EXPORT2
1121 uset_getSerializedRange(const USerializedSet* set, int32_t rangeIndex,
1122  UChar32* pStart, UChar32* pEnd);
1123 
1124 #endif