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