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 unsafe fn string(&self) -> Retained<NSString>;
36
37 #[unsafe(method(scanLocation))]
38 #[unsafe(method_family = none)]
39 pub unsafe fn scanLocation(&self) -> NSUInteger;
40
41 #[unsafe(method(setScanLocation:))]
43 #[unsafe(method_family = none)]
44 pub unsafe fn setScanLocation(&self, scan_location: NSUInteger);
45
46 #[cfg(feature = "NSCharacterSet")]
47 #[unsafe(method(charactersToBeSkipped))]
48 #[unsafe(method_family = none)]
49 pub unsafe fn charactersToBeSkipped(&self) -> Option<Retained<NSCharacterSet>>;
50
51 #[cfg(feature = "NSCharacterSet")]
52 #[unsafe(method(setCharactersToBeSkipped:))]
54 #[unsafe(method_family = none)]
55 pub unsafe fn setCharactersToBeSkipped(
56 &self,
57 characters_to_be_skipped: Option<&NSCharacterSet>,
58 );
59
60 #[unsafe(method(caseSensitive))]
61 #[unsafe(method_family = none)]
62 pub unsafe fn caseSensitive(&self) -> bool;
63
64 #[unsafe(method(setCaseSensitive:))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn setCaseSensitive(&self, case_sensitive: bool);
68
69 #[unsafe(method(locale))]
70 #[unsafe(method_family = none)]
71 pub unsafe fn locale(&self) -> Option<Retained<AnyObject>>;
72
73 #[unsafe(method(setLocale:))]
75 #[unsafe(method_family = none)]
76 pub unsafe fn setLocale(&self, locale: Option<&AnyObject>);
77
78 #[cfg(feature = "NSString")]
79 #[unsafe(method(initWithString:))]
80 #[unsafe(method_family = init)]
81 pub unsafe fn initWithString(this: Allocated<Self>, string: &NSString) -> Retained<Self>;
82 );
83}
84
85impl NSScanner {
87 extern_methods!(
88 #[unsafe(method(init))]
89 #[unsafe(method_family = init)]
90 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
91
92 #[unsafe(method(new))]
93 #[unsafe(method_family = new)]
94 pub unsafe fn new() -> Retained<Self>;
95 );
96}
97
98impl NSScanner {
100 extern_methods!(
101 #[unsafe(method(scanInt:))]
102 #[unsafe(method_family = none)]
103 pub unsafe fn scanInt(&self, result: *mut c_int) -> bool;
104
105 #[unsafe(method(scanInteger:))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn scanInteger(&self, result: *mut NSInteger) -> bool;
108
109 #[unsafe(method(scanLongLong:))]
110 #[unsafe(method_family = none)]
111 pub unsafe fn scanLongLong(&self, result: *mut c_longlong) -> bool;
112
113 #[unsafe(method(scanUnsignedLongLong:))]
114 #[unsafe(method_family = none)]
115 pub unsafe fn scanUnsignedLongLong(&self, result: *mut c_ulonglong) -> bool;
116
117 #[unsafe(method(scanFloat:))]
118 #[unsafe(method_family = none)]
119 pub unsafe fn scanFloat(&self, result: *mut c_float) -> bool;
120
121 #[unsafe(method(scanDouble:))]
122 #[unsafe(method_family = none)]
123 pub unsafe fn scanDouble(&self, result: *mut c_double) -> bool;
124
125 #[unsafe(method(scanHexInt:))]
126 #[unsafe(method_family = none)]
127 pub unsafe fn scanHexInt(&self, result: *mut c_uint) -> bool;
128
129 #[unsafe(method(scanHexLongLong:))]
130 #[unsafe(method_family = none)]
131 pub unsafe fn scanHexLongLong(&self, result: *mut c_ulonglong) -> bool;
132
133 #[unsafe(method(scanHexFloat:))]
134 #[unsafe(method_family = none)]
135 pub unsafe fn scanHexFloat(&self, result: *mut c_float) -> bool;
136
137 #[unsafe(method(scanHexDouble:))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn scanHexDouble(&self, result: *mut c_double) -> bool;
140
141 #[cfg(feature = "NSString")]
142 #[unsafe(method(scanString:intoString:))]
143 #[unsafe(method_family = none)]
144 pub unsafe fn scanString_intoString(
145 &self,
146 string: &NSString,
147 result: Option<&mut Option<Retained<NSString>>>,
148 ) -> bool;
149
150 #[cfg(all(feature = "NSCharacterSet", feature = "NSString"))]
151 #[unsafe(method(scanCharactersFromSet:intoString:))]
152 #[unsafe(method_family = none)]
153 pub unsafe fn scanCharactersFromSet_intoString(
154 &self,
155 set: &NSCharacterSet,
156 result: Option<&mut Option<Retained<NSString>>>,
157 ) -> bool;
158
159 #[cfg(feature = "NSString")]
160 #[unsafe(method(scanUpToString:intoString:))]
161 #[unsafe(method_family = none)]
162 pub unsafe fn scanUpToString_intoString(
163 &self,
164 string: &NSString,
165 result: Option<&mut Option<Retained<NSString>>>,
166 ) -> bool;
167
168 #[cfg(all(feature = "NSCharacterSet", feature = "NSString"))]
169 #[unsafe(method(scanUpToCharactersFromSet:intoString:))]
170 #[unsafe(method_family = none)]
171 pub unsafe fn scanUpToCharactersFromSet_intoString(
172 &self,
173 set: &NSCharacterSet,
174 result: Option<&mut Option<Retained<NSString>>>,
175 ) -> bool;
176
177 #[unsafe(method(isAtEnd))]
178 #[unsafe(method_family = none)]
179 pub unsafe fn isAtEnd(&self) -> bool;
180
181 #[cfg(feature = "NSString")]
182 #[unsafe(method(scannerWithString:))]
183 #[unsafe(method_family = none)]
184 pub unsafe fn scannerWithString(string: &NSString) -> Retained<Self>;
185
186 #[cfg(feature = "NSString")]
187 #[unsafe(method(localizedScannerWithString:))]
188 #[unsafe(method_family = none)]
189 pub unsafe fn localizedScannerWithString(string: &NSString) -> Retained<AnyObject>;
190 );
191}