ICU 55.1 55.1

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

- File List
- Globals

All Data Structures Namespaces 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-2014, 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 {
54 USET_IGNORE_SPACE = 1,
55
82 USET_CASE_INSENSITIVE = 2,
83
92 USET_ADD_CASE_MAPPINGS = 4
93 };
94
150 typedef enum USetSpanCondition {
163 USET_SPAN_NOT_CONTAINED = 0,
178 USET_SPAN_CONTAINED = 1,
198 USET_SPAN_SIMPLE = 2,
203 USET_SPAN_CONDITION_COUNT
204 } USetSpanCondition;
205
206 enum {
213 USET_SERIALIZED_STATIC_ARRAY_CAPACITY=8
214 };
215
221 typedef struct USerializedSet {
226 const uint16_t *array;
231 int32_t bmpLength;
236 int32_t length;
241 uint16_t staticArray[USET_SERIALIZED_STATIC_ARRAY_CAPACITY];
242 } USerializedSet;
243
244 /*********************************************************************
245 * USet API
246 *********************************************************************/
247
255 U_STABLE USet* U_EXPORT2
256 uset_openEmpty(void);
257
268 U_STABLE USet* U_EXPORT2
269 uset_open(UChar32 start, UChar32 end);
270
280 U_STABLE USet* U_EXPORT2
281 uset_openPattern(const UChar* pattern, int32_t patternLength,
282 UErrorCode* ec);
283
295 U_STABLE USet* U_EXPORT2
296 uset_openPatternOptions(const UChar* pattern, int32_t patternLength,
297 uint32_t options,
298 UErrorCode* ec);
299
306 U_STABLE void U_EXPORT2
307 uset_close(USet* set);
308
309 #if U_SHOW_CPLUSPLUS_API
310
311 U_NAMESPACE_BEGIN
312
322 U_DEFINE_LOCAL_OPEN_POINTER(LocalUSetPointer, USet, uset_close);
323
324 U_NAMESPACE_END
325
326 #endif
327
337 U_STABLE USet * U_EXPORT2
338 uset_clone(const USet *set);
339
349 U_STABLE UBool U_EXPORT2
350 uset_isFrozen(const USet *set);
351
366 U_STABLE void U_EXPORT2
367 uset_freeze(USet *set);
368
379 U_STABLE USet * U_EXPORT2
380 uset_cloneAsThawed(const USet *set);
381
391 U_STABLE void U_EXPORT2
392 uset_set(USet* set,
393 UChar32 start, UChar32 end);
394
416 U_STABLE int32_t U_EXPORT2
417 uset_applyPattern(USet *set,
418 const UChar *pattern, int32_t patternLength,
419 uint32_t options,
420 UErrorCode *status);
421
444 U_STABLE void U_EXPORT2
445 uset_applyIntPropertyValue(USet* set,
446 UProperty prop, int32_t value, UErrorCode* ec);
447
483 U_STABLE void U_EXPORT2
484 uset_applyPropertyAlias(USet* set,
485 const UChar *prop, int32_t propLength,
486 const UChar *value, int32_t valueLength,
487 UErrorCode* ec);
488
498 U_STABLE UBool U_EXPORT2
499 uset_resemblesPattern(const UChar *pattern, int32_t patternLength,
500 int32_t pos);
501
517 U_STABLE int32_t U_EXPORT2
518 uset_toPattern(const USet* set,
519 UChar* result, int32_t resultCapacity,
520 UBool escapeUnprintable,
521 UErrorCode* ec);
522
531 U_STABLE void U_EXPORT2
532 uset_add(USet* set, UChar32 c);
533
546 U_STABLE void U_EXPORT2
547 uset_addAll(USet* set, const USet *additionalSet);
548
558 U_STABLE void U_EXPORT2
559 uset_addRange(USet* set, UChar32 start, UChar32 end);
560
570 U_STABLE void U_EXPORT2
571 uset_addString(USet* set, const UChar* str, int32_t strLen);
572
582 U_STABLE void U_EXPORT2
583 uset_addAllCodePoints(USet* set, const UChar *str, int32_t strLen);
584
593 U_STABLE void U_EXPORT2
594 uset_remove(USet* set, UChar32 c);
595
605 U_STABLE void U_EXPORT2
606 uset_removeRange(USet* set, UChar32 start, UChar32 end);
607
617 U_STABLE void U_EXPORT2
618 uset_removeString(USet* set, const UChar* str, int32_t strLen);
619
631 U_STABLE void U_EXPORT2
632 uset_removeAll(USet* set, const USet* removeSet);
633
648 U_STABLE void U_EXPORT2
649 uset_retain(USet* set, UChar32 start, UChar32 end);
650
663 U_STABLE void U_EXPORT2
664 uset_retainAll(USet* set, const USet* retain);
665
674 U_STABLE void U_EXPORT2
675 uset_compact(USet* set);
676
685 U_STABLE void U_EXPORT2
686 uset_complement(USet* set);
687
699 U_STABLE void U_EXPORT2
700 uset_complementAll(USet* set, const USet* complement);
701
709 U_STABLE void U_EXPORT2
710 uset_clear(USet* set);
711
738 U_STABLE void U_EXPORT2
739 uset_closeOver(USet* set, int32_t attributes);
740
747 U_STABLE void U_EXPORT2
748 uset_removeAllStrings(USet* set);
749
757 U_STABLE UBool U_EXPORT2
758 uset_isEmpty(const USet* set);
759
768 U_STABLE UBool U_EXPORT2
769 uset_contains(const USet* set, UChar32 c);
770
780 U_STABLE UBool U_EXPORT2
781 uset_containsRange(const USet* set, UChar32 start, UChar32 end);
782
791 U_STABLE UBool U_EXPORT2
792 uset_containsString(const USet* set, const UChar* str, int32_t strLen);
793
804 U_STABLE int32_t U_EXPORT2
805 uset_indexOf(const USet* set, UChar32 c);
806
817 U_STABLE UChar32 U_EXPORT2
818 uset_charAt(const USet* set, int32_t charIndex);
819
828 U_STABLE int32_t U_EXPORT2
829 uset_size(const USet* set);
830
839 U_STABLE int32_t U_EXPORT2
840 uset_getItemCount(const USet* set);
841
860 U_STABLE int32_t U_EXPORT2
861 uset_getItem(const USet* set, int32_t itemIndex,
862 UChar32* start, UChar32* end,
863 UChar* str, int32_t strCapacity,
864 UErrorCode* ec);
865
874 U_STABLE UBool U_EXPORT2
875 uset_containsAll(const USet* set1, const USet* set2);
876
887 U_STABLE UBool U_EXPORT2
888 uset_containsAllCodePoints(const USet* set, const UChar *str, int32_t strLen);
889
898 U_STABLE UBool U_EXPORT2
899 uset_containsNone(const USet* set1, const USet* set2);
900
909 U_STABLE UBool U_EXPORT2
910 uset_containsSome(const USet* set1, const USet* set2);
911
931 U_STABLE int32_t U_EXPORT2
932 uset_span(const USet *set, const UChar *s, int32_t length, USetSpanCondition spanCondition);
933
952 U_STABLE int32_t U_EXPORT2
953 uset_spanBack(const USet *set, const UChar *s, int32_t length, USetSpanCondition spanCondition);
954
974 U_STABLE int32_t U_EXPORT2
975 uset_spanUTF8(const USet *set, const char *s, int32_t length, USetSpanCondition spanCondition);
976
995 U_STABLE int32_t U_EXPORT2
996 uset_spanBackUTF8(const USet *set, const char *s, int32_t length, USetSpanCondition spanCondition);
997
1006 U_STABLE UBool U_EXPORT2
1007 uset_equals(const USet* set1, const USet* set2);
1008
1009 /*********************************************************************
1010 * Serialized set API
1011 *********************************************************************/
1012
1062 U_STABLE int32_t U_EXPORT2
1063 uset_serialize(const USet* set, uint16_t* dest, int32_t destCapacity, UErrorCode* pErrorCode);
1064
1073 U_STABLE UBool U_EXPORT2
1074 uset_getSerializedSet(USerializedSet* fillSet, const uint16_t* src, int32_t srcLength);
1075
1083 U_STABLE void U_EXPORT2
1084 uset_setSerializedToOne(USerializedSet* fillSet, UChar32 c);
1085
1094 U_STABLE UBool U_EXPORT2
1095 uset_serializedContains(const USerializedSet* set, UChar32 c);
1096
1106 U_STABLE int32_t U_EXPORT2
1107 uset_getSerializedRangeCount(const USerializedSet* set);
1108
1122 U_STABLE UBool U_EXPORT2
1123 uset_getSerializedRange(const USerializedSet* set, int32_t rangeIndex,
1124 UChar32* pStart, UChar32* pEnd);
1125
1126 #endif