1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSScanner;

    unsafe impl ClassType for NSScanner {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "NSObject")]
unsafe impl NSCopying for NSScanner {}

unsafe impl NSObjectProtocol for NSScanner {}

extern_methods!(
    unsafe impl NSScanner {
        #[cfg(feature = "NSString")]
        #[method_id(@__retain_semantics Other string)]
        pub unsafe fn string(&self) -> Retained<NSString>;

        #[method(scanLocation)]
        pub unsafe fn scanLocation(&self) -> NSUInteger;

        #[method(setScanLocation:)]
        pub unsafe fn setScanLocation(&self, scan_location: NSUInteger);

        #[cfg(feature = "NSCharacterSet")]
        #[method_id(@__retain_semantics Other charactersToBeSkipped)]
        pub unsafe fn charactersToBeSkipped(&self) -> Option<Retained<NSCharacterSet>>;

        #[cfg(feature = "NSCharacterSet")]
        #[method(setCharactersToBeSkipped:)]
        pub unsafe fn setCharactersToBeSkipped(
            &self,
            characters_to_be_skipped: Option<&NSCharacterSet>,
        );

        #[method(caseSensitive)]
        pub unsafe fn caseSensitive(&self) -> bool;

        #[method(setCaseSensitive:)]
        pub unsafe fn setCaseSensitive(&self, case_sensitive: bool);

        #[method_id(@__retain_semantics Other locale)]
        pub unsafe fn locale(&self) -> Option<Retained<AnyObject>>;

        #[method(setLocale:)]
        pub unsafe fn setLocale(&self, locale: Option<&AnyObject>);

        #[cfg(feature = "NSString")]
        #[method_id(@__retain_semantics Init initWithString:)]
        pub unsafe fn initWithString(this: Allocated<Self>, string: &NSString) -> Retained<Self>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl NSScanner {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

extern_methods!(
    /// NSExtendedScanner
    unsafe impl NSScanner {
        #[method(scanInt:)]
        pub unsafe fn scanInt(&self, result: *mut c_int) -> bool;

        #[method(scanInteger:)]
        pub unsafe fn scanInteger(&self, result: *mut NSInteger) -> bool;

        #[method(scanLongLong:)]
        pub unsafe fn scanLongLong(&self, result: *mut c_longlong) -> bool;

        #[method(scanUnsignedLongLong:)]
        pub unsafe fn scanUnsignedLongLong(&self, result: *mut c_ulonglong) -> bool;

        #[method(scanFloat:)]
        pub unsafe fn scanFloat(&self, result: *mut c_float) -> bool;

        #[method(scanDouble:)]
        pub unsafe fn scanDouble(&self, result: *mut c_double) -> bool;

        #[method(scanHexInt:)]
        pub unsafe fn scanHexInt(&self, result: *mut c_uint) -> bool;

        #[method(scanHexLongLong:)]
        pub unsafe fn scanHexLongLong(&self, result: *mut c_ulonglong) -> bool;

        #[method(scanHexFloat:)]
        pub unsafe fn scanHexFloat(&self, result: *mut c_float) -> bool;

        #[method(scanHexDouble:)]
        pub unsafe fn scanHexDouble(&self, result: *mut c_double) -> bool;

        #[cfg(feature = "NSString")]
        #[method(scanString:intoString:)]
        pub unsafe fn scanString_intoString(
            &self,
            string: &NSString,
            result: Option<&mut Option<Retained<NSString>>>,
        ) -> bool;

        #[cfg(all(feature = "NSCharacterSet", feature = "NSString"))]
        #[method(scanCharactersFromSet:intoString:)]
        pub unsafe fn scanCharactersFromSet_intoString(
            &self,
            set: &NSCharacterSet,
            result: Option<&mut Option<Retained<NSString>>>,
        ) -> bool;

        #[cfg(feature = "NSString")]
        #[method(scanUpToString:intoString:)]
        pub unsafe fn scanUpToString_intoString(
            &self,
            string: &NSString,
            result: Option<&mut Option<Retained<NSString>>>,
        ) -> bool;

        #[cfg(all(feature = "NSCharacterSet", feature = "NSString"))]
        #[method(scanUpToCharactersFromSet:intoString:)]
        pub unsafe fn scanUpToCharactersFromSet_intoString(
            &self,
            set: &NSCharacterSet,
            result: Option<&mut Option<Retained<NSString>>>,
        ) -> bool;

        #[method(isAtEnd)]
        pub unsafe fn isAtEnd(&self) -> bool;

        #[cfg(feature = "NSString")]
        #[method_id(@__retain_semantics Other scannerWithString:)]
        pub unsafe fn scannerWithString(string: &NSString) -> Retained<Self>;

        #[cfg(feature = "NSString")]
        #[method_id(@__retain_semantics Other localizedScannerWithString:)]
        pub unsafe fn localizedScannerWithString(string: &NSString) -> Retained<AnyObject>;
    }
);