core_foundation_sys/
characterset.rs1use crate::base::{Boolean, CFAllocatorRef, CFIndex, CFRange, CFTypeID, UTF32Char};
11use crate::data::CFDataRef;
12use crate::string::{CFStringRef, UniChar};
13use std::os::raw::c_void;
14
15pub type CFCharacterSetPredefinedSet = CFIndex;
16
17pub static kCFCharacterSetControl: CFCharacterSetPredefinedSet = 1;
19pub static kCFCharacterSetWhitespace: CFCharacterSetPredefinedSet = 2;
20pub static kCFCharacterSetWhitespaceAndNewline: CFCharacterSetPredefinedSet = 3;
21pub static kCFCharacterSetDecimalDigit: CFCharacterSetPredefinedSet = 4;
22pub static kCFCharacterSetLetter: CFCharacterSetPredefinedSet = 5;
23pub static kCFCharacterSetLowercaseLetter: CFCharacterSetPredefinedSet = 6;
24pub static kCFCharacterSetUppercaseLetter: CFCharacterSetPredefinedSet = 7;
25pub static kCFCharacterSetNonBase: CFCharacterSetPredefinedSet = 8;
26pub static kCFCharacterSetDecomposable: CFCharacterSetPredefinedSet = 9;
27pub static kCFCharacterSetAlphaNumeric: CFCharacterSetPredefinedSet = 10;
28pub static kCFCharacterSetPunctuation: CFCharacterSetPredefinedSet = 11;
29pub static kCFCharacterSetIllegal: CFCharacterSetPredefinedSet = 12;
30pub static kCFCharacterSetCapitalizedLetter: CFCharacterSetPredefinedSet = 13;
31pub static kCFCharacterSetSymbol: CFCharacterSetPredefinedSet = 14;
32pub static kCFCharacterSetNewline: CFCharacterSetPredefinedSet = 15;
33
34#[repr(C)]
35pub struct __CFCharacterSet(c_void);
36
37pub type CFCharacterSetRef = *const __CFCharacterSet;
38pub type CFMutableCharacterSetRef = *mut __CFCharacterSet;
39
40extern "C" {
41 pub fn CFCharacterSetCreateCopy(
48 alloc: CFAllocatorRef,
49 theSet: CFCharacterSetRef,
50 ) -> CFCharacterSetRef;
51 pub fn CFCharacterSetCreateInvertedSet(
52 alloc: CFAllocatorRef,
53 theSet: CFCharacterSetRef,
54 ) -> CFCharacterSetRef;
55 pub fn CFCharacterSetCreateWithCharactersInRange(
56 alloc: CFAllocatorRef,
57 theRange: CFRange,
58 ) -> CFCharacterSetRef;
59 pub fn CFCharacterSetCreateWithCharactersInString(
60 alloc: CFAllocatorRef,
61 theString: CFStringRef,
62 ) -> CFCharacterSetRef;
63 pub fn CFCharacterSetCreateWithBitmapRepresentation(
64 alloc: CFAllocatorRef,
65 theData: CFDataRef,
66 ) -> CFCharacterSetRef;
67
68 pub fn CFCharacterSetGetPredefined(
70 theSetIdentifier: CFCharacterSetPredefinedSet,
71 ) -> CFCharacterSetRef;
72
73 pub fn CFCharacterSetCreateBitmapRepresentation(
75 alloc: CFAllocatorRef,
76 theSet: CFCharacterSetRef,
77 ) -> CFDataRef;
78 pub fn CFCharacterSetHasMemberInPlane(theSet: CFCharacterSetRef, thePlane: CFIndex) -> Boolean;
79 pub fn CFCharacterSetIsCharacterMember(theSet: CFCharacterSetRef, theChar: UniChar) -> Boolean;
80 pub fn CFCharacterSetIsLongCharacterMember(
81 theSet: CFCharacterSetRef,
82 theChar: UTF32Char,
83 ) -> Boolean;
84 pub fn CFCharacterSetIsSupersetOfSet(
85 theSet: CFCharacterSetRef,
86 theOtherset: CFCharacterSetRef,
87 ) -> Boolean;
88
89 pub fn CFCharacterSetGetTypeID() -> CFTypeID;
91
92 pub fn CFCharacterSetCreateMutable(alloc: CFAllocatorRef) -> CFMutableCharacterSetRef;
95 pub fn CFCharacterSetCreateMutableCopy(
96 alloc: CFAllocatorRef,
97 theSet: CFCharacterSetRef,
98 ) -> CFMutableCharacterSetRef;
99
100 pub fn CFCharacterSetAddCharactersInRange(theSet: CFMutableCharacterSetRef, theRange: CFRange);
102 pub fn CFCharacterSetAddCharactersInString(
103 theSet: CFMutableCharacterSetRef,
104 theString: CFStringRef,
105 );
106
107 pub fn CFCharacterSetRemoveCharactersInRange(
109 theSet: CFMutableCharacterSetRef,
110 theRange: CFRange,
111 );
112 pub fn CFCharacterSetRemoveCharactersInString(
113 theSet: CFMutableCharacterSetRef,
114 theString: CFStringRef,
115 );
116
117 pub fn CFCharacterSetIntersect(
119 theSet: CFMutableCharacterSetRef,
120 theOtherSet: CFCharacterSetRef,
121 );
122 pub fn CFCharacterSetInvert(theSet: CFMutableCharacterSetRef);
123 pub fn CFCharacterSetUnion(theSet: CFMutableCharacterSetRef, theOtherSet: CFCharacterSetRef);
124}