objc2_foundation/generated/
NSScanner.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern_class!(
10 #[unsafe(super(NSObject))]
12 #[derive(Debug, PartialEq, Eq, Hash)]
13 pub struct NSScanner;
14);
15
16#[cfg(feature = "NSObject")]
17extern_conformance!(
18 unsafe impl NSCopying for NSScanner {}
19);
20
21#[cfg(feature = "NSObject")]
22unsafe impl CopyingHelper for NSScanner {
23 type Result = Self;
24}
25
26extern_conformance!(
27 unsafe impl NSObjectProtocol for NSScanner {}
28);
29
30impl NSScanner {
31 extern_methods!(
32 #[cfg(feature = "NSString")]
33 #[unsafe(method(string))]
34 #[unsafe(method_family = none)]
35 pub fn string(&self) -> Retained<NSString>;
36
37 #[unsafe(method(scanLocation))]
38 #[unsafe(method_family = none)]
39 pub fn scanLocation(&self) -> NSUInteger;
40
41 #[unsafe(method(setScanLocation:))]
43 #[unsafe(method_family = none)]
44 pub fn setScanLocation(&self, scan_location: NSUInteger);
45
46 #[cfg(feature = "NSCharacterSet")]
47 #[unsafe(method(charactersToBeSkipped))]
48 #[unsafe(method_family = none)]
49 pub fn charactersToBeSkipped(&self) -> Option<Retained<NSCharacterSet>>;
50
51 #[cfg(feature = "NSCharacterSet")]
52 #[unsafe(method(setCharactersToBeSkipped:))]
56 #[unsafe(method_family = none)]
57 pub fn setCharactersToBeSkipped(&self, characters_to_be_skipped: Option<&NSCharacterSet>);
58
59 #[unsafe(method(caseSensitive))]
60 #[unsafe(method_family = none)]
61 pub fn caseSensitive(&self) -> bool;
62
63 #[unsafe(method(setCaseSensitive:))]
65 #[unsafe(method_family = none)]
66 pub fn setCaseSensitive(&self, case_sensitive: bool);
67
68 #[unsafe(method(locale))]
69 #[unsafe(method_family = none)]
70 pub fn locale(&self) -> Option<Retained<AnyObject>>;
71
72 #[unsafe(method(setLocale:))]
78 #[unsafe(method_family = none)]
79 pub unsafe fn setLocale(&self, locale: Option<&AnyObject>);
80
81 #[cfg(feature = "NSString")]
82 #[unsafe(method(initWithString:))]
83 #[unsafe(method_family = init)]
84 pub fn initWithString(this: Allocated<Self>, string: &NSString) -> Retained<Self>;
85 );
86}
87
88impl NSScanner {
90 extern_methods!(
91 #[unsafe(method(init))]
92 #[unsafe(method_family = init)]
93 pub fn init(this: Allocated<Self>) -> Retained<Self>;
94
95 #[unsafe(method(new))]
96 #[unsafe(method_family = new)]
97 pub fn new() -> Retained<Self>;
98 );
99}
100
101impl DefaultRetained for NSScanner {
102 #[inline]
103 fn default_retained() -> Retained<Self> {
104 Self::new()
105 }
106}
107
108impl NSScanner {
110 extern_methods!(
111 #[unsafe(method(scanInt:))]
115 #[unsafe(method_family = none)]
116 pub unsafe fn scanInt(&self, result: *mut c_int) -> bool;
117
118 #[unsafe(method(scanInteger:))]
122 #[unsafe(method_family = none)]
123 pub unsafe fn scanInteger(&self, result: *mut NSInteger) -> bool;
124
125 #[unsafe(method(scanLongLong:))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn scanLongLong(&self, result: *mut c_longlong) -> bool;
131
132 #[unsafe(method(scanUnsignedLongLong:))]
136 #[unsafe(method_family = none)]
137 pub unsafe fn scanUnsignedLongLong(&self, result: *mut c_ulonglong) -> bool;
138
139 #[unsafe(method(scanFloat:))]
143 #[unsafe(method_family = none)]
144 pub unsafe fn scanFloat(&self, result: *mut c_float) -> bool;
145
146 #[unsafe(method(scanDouble:))]
150 #[unsafe(method_family = none)]
151 pub unsafe fn scanDouble(&self, result: *mut c_double) -> bool;
152
153 #[unsafe(method(scanHexInt:))]
157 #[unsafe(method_family = none)]
158 pub unsafe fn scanHexInt(&self, result: *mut c_uint) -> bool;
159
160 #[unsafe(method(scanHexLongLong:))]
164 #[unsafe(method_family = none)]
165 pub unsafe fn scanHexLongLong(&self, result: *mut c_ulonglong) -> bool;
166
167 #[unsafe(method(scanHexFloat:))]
171 #[unsafe(method_family = none)]
172 pub unsafe fn scanHexFloat(&self, result: *mut c_float) -> bool;
173
174 #[unsafe(method(scanHexDouble:))]
178 #[unsafe(method_family = none)]
179 pub unsafe fn scanHexDouble(&self, result: *mut c_double) -> bool;
180
181 #[cfg(feature = "NSString")]
182 #[unsafe(method(scanString:intoString:))]
183 #[unsafe(method_family = none)]
184 pub fn scanString_intoString(
185 &self,
186 string: &NSString,
187 result: Option<&mut Option<Retained<NSString>>>,
188 ) -> bool;
189
190 #[cfg(all(feature = "NSCharacterSet", feature = "NSString"))]
191 #[unsafe(method(scanCharactersFromSet:intoString:))]
192 #[unsafe(method_family = none)]
193 pub fn scanCharactersFromSet_intoString(
194 &self,
195 set: &NSCharacterSet,
196 result: Option<&mut Option<Retained<NSString>>>,
197 ) -> bool;
198
199 #[cfg(feature = "NSString")]
200 #[unsafe(method(scanUpToString:intoString:))]
201 #[unsafe(method_family = none)]
202 pub fn scanUpToString_intoString(
203 &self,
204 string: &NSString,
205 result: Option<&mut Option<Retained<NSString>>>,
206 ) -> bool;
207
208 #[cfg(all(feature = "NSCharacterSet", feature = "NSString"))]
209 #[unsafe(method(scanUpToCharactersFromSet:intoString:))]
210 #[unsafe(method_family = none)]
211 pub fn scanUpToCharactersFromSet_intoString(
212 &self,
213 set: &NSCharacterSet,
214 result: Option<&mut Option<Retained<NSString>>>,
215 ) -> bool;
216
217 #[unsafe(method(isAtEnd))]
218 #[unsafe(method_family = none)]
219 pub fn isAtEnd(&self) -> bool;
220
221 #[cfg(feature = "NSString")]
222 #[unsafe(method(scannerWithString:))]
223 #[unsafe(method_family = none)]
224 pub fn scannerWithString(string: &NSString) -> Retained<Self>;
225
226 #[cfg(feature = "NSString")]
227 #[unsafe(method(localizedScannerWithString:))]
228 #[unsafe(method_family = none)]
229 pub fn localizedScannerWithString(string: &NSString) -> Retained<AnyObject>;
230 );
231}