objc2-foundation 0.3.2

Bindings to the Foundation framework
Documentation
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsxmlparserexternalentityresolvingpolicy?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSXMLParserExternalEntityResolvingPolicy(pub NSUInteger);
impl NSXMLParserExternalEntityResolvingPolicy {
    #[doc(alias = "NSXMLParserResolveExternalEntitiesNever")]
    pub const ResolveExternalEntitiesNever: Self = Self(0);
    #[doc(alias = "NSXMLParserResolveExternalEntitiesNoNetwork")]
    pub const ResolveExternalEntitiesNoNetwork: Self = Self(1);
    #[doc(alias = "NSXMLParserResolveExternalEntitiesSameOriginOnly")]
    pub const ResolveExternalEntitiesSameOriginOnly: Self = Self(2);
    #[doc(alias = "NSXMLParserResolveExternalEntitiesAlways")]
    pub const ResolveExternalEntitiesAlways: Self = Self(3);
}

unsafe impl Encode for NSXMLParserExternalEntityResolvingPolicy {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSXMLParserExternalEntityResolvingPolicy {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsxmlparser?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSXMLParser;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for NSXMLParser {}
);

impl NSXMLParser {
    extern_methods!(
        #[cfg(feature = "NSURL")]
        #[unsafe(method(initWithContentsOfURL:))]
        #[unsafe(method_family = init)]
        pub fn initWithContentsOfURL(this: Allocated<Self>, url: &NSURL) -> Option<Retained<Self>>;

        #[cfg(feature = "NSData")]
        #[unsafe(method(initWithData:))]
        #[unsafe(method_family = init)]
        pub fn initWithData(this: Allocated<Self>, data: &NSData) -> Retained<Self>;

        #[cfg(feature = "NSStream")]
        #[unsafe(method(initWithStream:))]
        #[unsafe(method_family = init)]
        pub fn initWithStream(this: Allocated<Self>, stream: &NSInputStream) -> Retained<Self>;

        /// # Safety
        ///
        /// This is not retained internally, you must ensure the object is still alive.
        #[unsafe(method(delegate))]
        #[unsafe(method_family = none)]
        pub unsafe fn delegate(&self) -> Option<Retained<ProtocolObject<dyn NSXMLParserDelegate>>>;

        /// Setter for [`delegate`][Self::delegate].
        ///
        /// # Safety
        ///
        /// This is unretained, you must ensure the object is kept alive while in use.
        #[unsafe(method(setDelegate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDelegate(
            &self,
            delegate: Option<&ProtocolObject<dyn NSXMLParserDelegate>>,
        );

        #[unsafe(method(shouldProcessNamespaces))]
        #[unsafe(method_family = none)]
        pub fn shouldProcessNamespaces(&self) -> bool;

        /// Setter for [`shouldProcessNamespaces`][Self::shouldProcessNamespaces].
        #[unsafe(method(setShouldProcessNamespaces:))]
        #[unsafe(method_family = none)]
        pub fn setShouldProcessNamespaces(&self, should_process_namespaces: bool);

        #[unsafe(method(shouldReportNamespacePrefixes))]
        #[unsafe(method_family = none)]
        pub fn shouldReportNamespacePrefixes(&self) -> bool;

        /// Setter for [`shouldReportNamespacePrefixes`][Self::shouldReportNamespacePrefixes].
        #[unsafe(method(setShouldReportNamespacePrefixes:))]
        #[unsafe(method_family = none)]
        pub fn setShouldReportNamespacePrefixes(&self, should_report_namespace_prefixes: bool);

        #[unsafe(method(externalEntityResolvingPolicy))]
        #[unsafe(method_family = none)]
        pub fn externalEntityResolvingPolicy(&self) -> NSXMLParserExternalEntityResolvingPolicy;

        /// Setter for [`externalEntityResolvingPolicy`][Self::externalEntityResolvingPolicy].
        #[unsafe(method(setExternalEntityResolvingPolicy:))]
        #[unsafe(method_family = none)]
        pub fn setExternalEntityResolvingPolicy(
            &self,
            external_entity_resolving_policy: NSXMLParserExternalEntityResolvingPolicy,
        );

        #[cfg(all(feature = "NSSet", feature = "NSURL"))]
        #[unsafe(method(allowedExternalEntityURLs))]
        #[unsafe(method_family = none)]
        pub fn allowedExternalEntityURLs(&self) -> Option<Retained<NSSet<NSURL>>>;

        #[cfg(all(feature = "NSSet", feature = "NSURL"))]
        /// Setter for [`allowedExternalEntityURLs`][Self::allowedExternalEntityURLs].
        ///
        /// This is [copied][crate::NSCopying::copy] when set.
        #[unsafe(method(setAllowedExternalEntityURLs:))]
        #[unsafe(method_family = none)]
        pub fn setAllowedExternalEntityURLs(
            &self,
            allowed_external_entity_ur_ls: Option<&NSSet<NSURL>>,
        );

        #[unsafe(method(parse))]
        #[unsafe(method_family = none)]
        pub fn parse(&self) -> bool;

        #[unsafe(method(abortParsing))]
        #[unsafe(method_family = none)]
        pub fn abortParsing(&self);

        #[cfg(feature = "NSError")]
        #[unsafe(method(parserError))]
        #[unsafe(method_family = none)]
        pub fn parserError(&self) -> Option<Retained<NSError>>;

        #[unsafe(method(shouldResolveExternalEntities))]
        #[unsafe(method_family = none)]
        pub fn shouldResolveExternalEntities(&self) -> bool;

        /// Setter for [`shouldResolveExternalEntities`][Self::shouldResolveExternalEntities].
        #[unsafe(method(setShouldResolveExternalEntities:))]
        #[unsafe(method_family = none)]
        pub fn setShouldResolveExternalEntities(&self, should_resolve_external_entities: bool);
    );
}

/// Methods declared on superclass `NSObject`.
impl NSXMLParser {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for NSXMLParser {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}

/// NSXMLParserLocatorAdditions.
impl NSXMLParser {
    extern_methods!(
        #[cfg(feature = "NSString")]
        #[unsafe(method(publicID))]
        #[unsafe(method_family = none)]
        pub fn publicID(&self) -> Option<Retained<NSString>>;

        #[cfg(feature = "NSString")]
        #[unsafe(method(systemID))]
        #[unsafe(method_family = none)]
        pub fn systemID(&self) -> Option<Retained<NSString>>;

        #[unsafe(method(lineNumber))]
        #[unsafe(method_family = none)]
        pub fn lineNumber(&self) -> NSInteger;

        #[unsafe(method(columnNumber))]
        #[unsafe(method_family = none)]
        pub fn columnNumber(&self) -> NSInteger;
    );
}

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsxmlparserdelegate?language=objc)
    pub unsafe trait NSXMLParserDelegate: NSObjectProtocol {
        #[optional]
        #[unsafe(method(parserDidStartDocument:))]
        #[unsafe(method_family = none)]
        fn parserDidStartDocument(&self, parser: &NSXMLParser);

        #[optional]
        #[unsafe(method(parserDidEndDocument:))]
        #[unsafe(method_family = none)]
        fn parserDidEndDocument(&self, parser: &NSXMLParser);

        #[cfg(feature = "NSString")]
        #[optional]
        #[unsafe(method(parser:foundNotationDeclarationWithName:publicID:systemID:))]
        #[unsafe(method_family = none)]
        fn parser_foundNotationDeclarationWithName_publicID_systemID(
            &self,
            parser: &NSXMLParser,
            name: &NSString,
            public_id: Option<&NSString>,
            system_id: Option<&NSString>,
        );

        #[cfg(feature = "NSString")]
        #[optional]
        #[unsafe(method(parser:foundUnparsedEntityDeclarationWithName:publicID:systemID:notationName:))]
        #[unsafe(method_family = none)]
        fn parser_foundUnparsedEntityDeclarationWithName_publicID_systemID_notationName(
            &self,
            parser: &NSXMLParser,
            name: &NSString,
            public_id: Option<&NSString>,
            system_id: Option<&NSString>,
            notation_name: Option<&NSString>,
        );

        #[cfg(feature = "NSString")]
        #[optional]
        #[unsafe(method(parser:foundAttributeDeclarationWithName:forElement:type:defaultValue:))]
        #[unsafe(method_family = none)]
        fn parser_foundAttributeDeclarationWithName_forElement_type_defaultValue(
            &self,
            parser: &NSXMLParser,
            attribute_name: &NSString,
            element_name: &NSString,
            r#type: Option<&NSString>,
            default_value: Option<&NSString>,
        );

        #[cfg(feature = "NSString")]
        #[optional]
        #[unsafe(method(parser:foundElementDeclarationWithName:model:))]
        #[unsafe(method_family = none)]
        fn parser_foundElementDeclarationWithName_model(
            &self,
            parser: &NSXMLParser,
            element_name: &NSString,
            model: &NSString,
        );

        #[cfg(feature = "NSString")]
        #[optional]
        #[unsafe(method(parser:foundInternalEntityDeclarationWithName:value:))]
        #[unsafe(method_family = none)]
        fn parser_foundInternalEntityDeclarationWithName_value(
            &self,
            parser: &NSXMLParser,
            name: &NSString,
            value: Option<&NSString>,
        );

        #[cfg(feature = "NSString")]
        #[optional]
        #[unsafe(method(parser:foundExternalEntityDeclarationWithName:publicID:systemID:))]
        #[unsafe(method_family = none)]
        fn parser_foundExternalEntityDeclarationWithName_publicID_systemID(
            &self,
            parser: &NSXMLParser,
            name: &NSString,
            public_id: Option<&NSString>,
            system_id: Option<&NSString>,
        );

        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
        #[optional]
        #[unsafe(method(parser:didStartElement:namespaceURI:qualifiedName:attributes:))]
        #[unsafe(method_family = none)]
        fn parser_didStartElement_namespaceURI_qualifiedName_attributes(
            &self,
            parser: &NSXMLParser,
            element_name: &NSString,
            namespace_uri: Option<&NSString>,
            q_name: Option<&NSString>,
            attribute_dict: &NSDictionary<NSString, NSString>,
        );

        #[cfg(feature = "NSString")]
        #[optional]
        #[unsafe(method(parser:didEndElement:namespaceURI:qualifiedName:))]
        #[unsafe(method_family = none)]
        fn parser_didEndElement_namespaceURI_qualifiedName(
            &self,
            parser: &NSXMLParser,
            element_name: &NSString,
            namespace_uri: Option<&NSString>,
            q_name: Option<&NSString>,
        );

        #[cfg(feature = "NSString")]
        #[optional]
        #[unsafe(method(parser:didStartMappingPrefix:toURI:))]
        #[unsafe(method_family = none)]
        fn parser_didStartMappingPrefix_toURI(
            &self,
            parser: &NSXMLParser,
            prefix: &NSString,
            namespace_uri: &NSString,
        );

        #[cfg(feature = "NSString")]
        #[optional]
        #[unsafe(method(parser:didEndMappingPrefix:))]
        #[unsafe(method_family = none)]
        fn parser_didEndMappingPrefix(&self, parser: &NSXMLParser, prefix: &NSString);

        #[cfg(feature = "NSString")]
        #[optional]
        #[unsafe(method(parser:foundCharacters:))]
        #[unsafe(method_family = none)]
        fn parser_foundCharacters(&self, parser: &NSXMLParser, string: &NSString);

        #[cfg(feature = "NSString")]
        #[optional]
        #[unsafe(method(parser:foundIgnorableWhitespace:))]
        #[unsafe(method_family = none)]
        fn parser_foundIgnorableWhitespace(
            &self,
            parser: &NSXMLParser,
            whitespace_string: &NSString,
        );

        #[cfg(feature = "NSString")]
        #[optional]
        #[unsafe(method(parser:foundProcessingInstructionWithTarget:data:))]
        #[unsafe(method_family = none)]
        fn parser_foundProcessingInstructionWithTarget_data(
            &self,
            parser: &NSXMLParser,
            target: &NSString,
            data: Option<&NSString>,
        );

        #[cfg(feature = "NSString")]
        #[optional]
        #[unsafe(method(parser:foundComment:))]
        #[unsafe(method_family = none)]
        fn parser_foundComment(&self, parser: &NSXMLParser, comment: &NSString);

        #[cfg(feature = "NSData")]
        #[optional]
        #[unsafe(method(parser:foundCDATA:))]
        #[unsafe(method_family = none)]
        fn parser_foundCDATA(&self, parser: &NSXMLParser, cdata_block: &NSData);

        #[cfg(all(feature = "NSData", feature = "NSString"))]
        #[optional]
        #[unsafe(method(parser:resolveExternalEntityName:systemID:))]
        #[unsafe(method_family = none)]
        fn parser_resolveExternalEntityName_systemID(
            &self,
            parser: &NSXMLParser,
            name: &NSString,
            system_id: Option<&NSString>,
        ) -> Option<Retained<NSData>>;

        #[cfg(feature = "NSError")]
        #[optional]
        #[unsafe(method(parser:parseErrorOccurred:))]
        #[unsafe(method_family = none)]
        fn parser_parseErrorOccurred(&self, parser: &NSXMLParser, parse_error: &NSError);

        #[cfg(feature = "NSError")]
        #[optional]
        #[unsafe(method(parser:validationErrorOccurred:))]
        #[unsafe(method_family = none)]
        fn parser_validationErrorOccurred(&self, parser: &NSXMLParser, validation_error: &NSError);
    }
);

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsxmlparsererrordomain?language=objc)
    #[cfg(all(feature = "NSError", feature = "NSString"))]
    pub static NSXMLParserErrorDomain: &'static NSErrorDomain;
}

/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsxmlparsererror?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSXMLParserError(pub NSInteger);
impl NSXMLParserError {
    #[doc(alias = "NSXMLParserInternalError")]
    pub const InternalError: Self = Self(1);
    #[doc(alias = "NSXMLParserOutOfMemoryError")]
    pub const OutOfMemoryError: Self = Self(2);
    #[doc(alias = "NSXMLParserDocumentStartError")]
    pub const DocumentStartError: Self = Self(3);
    #[doc(alias = "NSXMLParserEmptyDocumentError")]
    pub const EmptyDocumentError: Self = Self(4);
    #[doc(alias = "NSXMLParserPrematureDocumentEndError")]
    pub const PrematureDocumentEndError: Self = Self(5);
    #[doc(alias = "NSXMLParserInvalidHexCharacterRefError")]
    pub const InvalidHexCharacterRefError: Self = Self(6);
    #[doc(alias = "NSXMLParserInvalidDecimalCharacterRefError")]
    pub const InvalidDecimalCharacterRefError: Self = Self(7);
    #[doc(alias = "NSXMLParserInvalidCharacterRefError")]
    pub const InvalidCharacterRefError: Self = Self(8);
    #[doc(alias = "NSXMLParserInvalidCharacterError")]
    pub const InvalidCharacterError: Self = Self(9);
    #[doc(alias = "NSXMLParserCharacterRefAtEOFError")]
    pub const CharacterRefAtEOFError: Self = Self(10);
    #[doc(alias = "NSXMLParserCharacterRefInPrologError")]
    pub const CharacterRefInPrologError: Self = Self(11);
    #[doc(alias = "NSXMLParserCharacterRefInEpilogError")]
    pub const CharacterRefInEpilogError: Self = Self(12);
    #[doc(alias = "NSXMLParserCharacterRefInDTDError")]
    pub const CharacterRefInDTDError: Self = Self(13);
    #[doc(alias = "NSXMLParserEntityRefAtEOFError")]
    pub const EntityRefAtEOFError: Self = Self(14);
    #[doc(alias = "NSXMLParserEntityRefInPrologError")]
    pub const EntityRefInPrologError: Self = Self(15);
    #[doc(alias = "NSXMLParserEntityRefInEpilogError")]
    pub const EntityRefInEpilogError: Self = Self(16);
    #[doc(alias = "NSXMLParserEntityRefInDTDError")]
    pub const EntityRefInDTDError: Self = Self(17);
    #[doc(alias = "NSXMLParserParsedEntityRefAtEOFError")]
    pub const ParsedEntityRefAtEOFError: Self = Self(18);
    #[doc(alias = "NSXMLParserParsedEntityRefInPrologError")]
    pub const ParsedEntityRefInPrologError: Self = Self(19);
    #[doc(alias = "NSXMLParserParsedEntityRefInEpilogError")]
    pub const ParsedEntityRefInEpilogError: Self = Self(20);
    #[doc(alias = "NSXMLParserParsedEntityRefInInternalSubsetError")]
    pub const ParsedEntityRefInInternalSubsetError: Self = Self(21);
    #[doc(alias = "NSXMLParserEntityReferenceWithoutNameError")]
    pub const EntityReferenceWithoutNameError: Self = Self(22);
    #[doc(alias = "NSXMLParserEntityReferenceMissingSemiError")]
    pub const EntityReferenceMissingSemiError: Self = Self(23);
    #[doc(alias = "NSXMLParserParsedEntityRefNoNameError")]
    pub const ParsedEntityRefNoNameError: Self = Self(24);
    #[doc(alias = "NSXMLParserParsedEntityRefMissingSemiError")]
    pub const ParsedEntityRefMissingSemiError: Self = Self(25);
    #[doc(alias = "NSXMLParserUndeclaredEntityError")]
    pub const UndeclaredEntityError: Self = Self(26);
    #[doc(alias = "NSXMLParserUnparsedEntityError")]
    pub const UnparsedEntityError: Self = Self(28);
    #[doc(alias = "NSXMLParserEntityIsExternalError")]
    pub const EntityIsExternalError: Self = Self(29);
    #[doc(alias = "NSXMLParserEntityIsParameterError")]
    pub const EntityIsParameterError: Self = Self(30);
    #[doc(alias = "NSXMLParserUnknownEncodingError")]
    pub const UnknownEncodingError: Self = Self(31);
    #[doc(alias = "NSXMLParserEncodingNotSupportedError")]
    pub const EncodingNotSupportedError: Self = Self(32);
    #[doc(alias = "NSXMLParserStringNotStartedError")]
    pub const StringNotStartedError: Self = Self(33);
    #[doc(alias = "NSXMLParserStringNotClosedError")]
    pub const StringNotClosedError: Self = Self(34);
    #[doc(alias = "NSXMLParserNamespaceDeclarationError")]
    pub const NamespaceDeclarationError: Self = Self(35);
    #[doc(alias = "NSXMLParserEntityNotStartedError")]
    pub const EntityNotStartedError: Self = Self(36);
    #[doc(alias = "NSXMLParserEntityNotFinishedError")]
    pub const EntityNotFinishedError: Self = Self(37);
    #[doc(alias = "NSXMLParserLessThanSymbolInAttributeError")]
    pub const LessThanSymbolInAttributeError: Self = Self(38);
    #[doc(alias = "NSXMLParserAttributeNotStartedError")]
    pub const AttributeNotStartedError: Self = Self(39);
    #[doc(alias = "NSXMLParserAttributeNotFinishedError")]
    pub const AttributeNotFinishedError: Self = Self(40);
    #[doc(alias = "NSXMLParserAttributeHasNoValueError")]
    pub const AttributeHasNoValueError: Self = Self(41);
    #[doc(alias = "NSXMLParserAttributeRedefinedError")]
    pub const AttributeRedefinedError: Self = Self(42);
    #[doc(alias = "NSXMLParserLiteralNotStartedError")]
    pub const LiteralNotStartedError: Self = Self(43);
    #[doc(alias = "NSXMLParserLiteralNotFinishedError")]
    pub const LiteralNotFinishedError: Self = Self(44);
    #[doc(alias = "NSXMLParserCommentNotFinishedError")]
    pub const CommentNotFinishedError: Self = Self(45);
    #[doc(alias = "NSXMLParserProcessingInstructionNotStartedError")]
    pub const ProcessingInstructionNotStartedError: Self = Self(46);
    #[doc(alias = "NSXMLParserProcessingInstructionNotFinishedError")]
    pub const ProcessingInstructionNotFinishedError: Self = Self(47);
    #[doc(alias = "NSXMLParserNotationNotStartedError")]
    pub const NotationNotStartedError: Self = Self(48);
    #[doc(alias = "NSXMLParserNotationNotFinishedError")]
    pub const NotationNotFinishedError: Self = Self(49);
    #[doc(alias = "NSXMLParserAttributeListNotStartedError")]
    pub const AttributeListNotStartedError: Self = Self(50);
    #[doc(alias = "NSXMLParserAttributeListNotFinishedError")]
    pub const AttributeListNotFinishedError: Self = Self(51);
    #[doc(alias = "NSXMLParserMixedContentDeclNotStartedError")]
    pub const MixedContentDeclNotStartedError: Self = Self(52);
    #[doc(alias = "NSXMLParserMixedContentDeclNotFinishedError")]
    pub const MixedContentDeclNotFinishedError: Self = Self(53);
    #[doc(alias = "NSXMLParserElementContentDeclNotStartedError")]
    pub const ElementContentDeclNotStartedError: Self = Self(54);
    #[doc(alias = "NSXMLParserElementContentDeclNotFinishedError")]
    pub const ElementContentDeclNotFinishedError: Self = Self(55);
    #[doc(alias = "NSXMLParserXMLDeclNotStartedError")]
    pub const XMLDeclNotStartedError: Self = Self(56);
    #[doc(alias = "NSXMLParserXMLDeclNotFinishedError")]
    pub const XMLDeclNotFinishedError: Self = Self(57);
    #[doc(alias = "NSXMLParserConditionalSectionNotStartedError")]
    pub const ConditionalSectionNotStartedError: Self = Self(58);
    #[doc(alias = "NSXMLParserConditionalSectionNotFinishedError")]
    pub const ConditionalSectionNotFinishedError: Self = Self(59);
    #[doc(alias = "NSXMLParserExternalSubsetNotFinishedError")]
    pub const ExternalSubsetNotFinishedError: Self = Self(60);
    #[doc(alias = "NSXMLParserDOCTYPEDeclNotFinishedError")]
    pub const DOCTYPEDeclNotFinishedError: Self = Self(61);
    #[doc(alias = "NSXMLParserMisplacedCDATAEndStringError")]
    pub const MisplacedCDATAEndStringError: Self = Self(62);
    #[doc(alias = "NSXMLParserCDATANotFinishedError")]
    pub const CDATANotFinishedError: Self = Self(63);
    #[doc(alias = "NSXMLParserMisplacedXMLDeclarationError")]
    pub const MisplacedXMLDeclarationError: Self = Self(64);
    #[doc(alias = "NSXMLParserSpaceRequiredError")]
    pub const SpaceRequiredError: Self = Self(65);
    #[doc(alias = "NSXMLParserSeparatorRequiredError")]
    pub const SeparatorRequiredError: Self = Self(66);
    #[doc(alias = "NSXMLParserNMTOKENRequiredError")]
    pub const NMTOKENRequiredError: Self = Self(67);
    #[doc(alias = "NSXMLParserNAMERequiredError")]
    pub const NAMERequiredError: Self = Self(68);
    #[doc(alias = "NSXMLParserPCDATARequiredError")]
    pub const PCDATARequiredError: Self = Self(69);
    #[doc(alias = "NSXMLParserURIRequiredError")]
    pub const URIRequiredError: Self = Self(70);
    #[doc(alias = "NSXMLParserPublicIdentifierRequiredError")]
    pub const PublicIdentifierRequiredError: Self = Self(71);
    #[doc(alias = "NSXMLParserLTRequiredError")]
    pub const LTRequiredError: Self = Self(72);
    #[doc(alias = "NSXMLParserGTRequiredError")]
    pub const GTRequiredError: Self = Self(73);
    #[doc(alias = "NSXMLParserLTSlashRequiredError")]
    pub const LTSlashRequiredError: Self = Self(74);
    #[doc(alias = "NSXMLParserEqualExpectedError")]
    pub const EqualExpectedError: Self = Self(75);
    #[doc(alias = "NSXMLParserTagNameMismatchError")]
    pub const TagNameMismatchError: Self = Self(76);
    #[doc(alias = "NSXMLParserUnfinishedTagError")]
    pub const UnfinishedTagError: Self = Self(77);
    #[doc(alias = "NSXMLParserStandaloneValueError")]
    pub const StandaloneValueError: Self = Self(78);
    #[doc(alias = "NSXMLParserInvalidEncodingNameError")]
    pub const InvalidEncodingNameError: Self = Self(79);
    #[doc(alias = "NSXMLParserCommentContainsDoubleHyphenError")]
    pub const CommentContainsDoubleHyphenError: Self = Self(80);
    #[doc(alias = "NSXMLParserInvalidEncodingError")]
    pub const InvalidEncodingError: Self = Self(81);
    #[doc(alias = "NSXMLParserExternalStandaloneEntityError")]
    pub const ExternalStandaloneEntityError: Self = Self(82);
    #[doc(alias = "NSXMLParserInvalidConditionalSectionError")]
    pub const InvalidConditionalSectionError: Self = Self(83);
    #[doc(alias = "NSXMLParserEntityValueRequiredError")]
    pub const EntityValueRequiredError: Self = Self(84);
    #[doc(alias = "NSXMLParserNotWellBalancedError")]
    pub const NotWellBalancedError: Self = Self(85);
    #[doc(alias = "NSXMLParserExtraContentError")]
    pub const ExtraContentError: Self = Self(86);
    #[doc(alias = "NSXMLParserInvalidCharacterInEntityError")]
    pub const InvalidCharacterInEntityError: Self = Self(87);
    #[doc(alias = "NSXMLParserParsedEntityRefInInternalError")]
    pub const ParsedEntityRefInInternalError: Self = Self(88);
    #[doc(alias = "NSXMLParserEntityRefLoopError")]
    pub const EntityRefLoopError: Self = Self(89);
    #[doc(alias = "NSXMLParserEntityBoundaryError")]
    pub const EntityBoundaryError: Self = Self(90);
    #[doc(alias = "NSXMLParserInvalidURIError")]
    pub const InvalidURIError: Self = Self(91);
    #[doc(alias = "NSXMLParserURIFragmentError")]
    pub const URIFragmentError: Self = Self(92);
    #[doc(alias = "NSXMLParserNoDTDError")]
    pub const NoDTDError: Self = Self(94);
    #[doc(alias = "NSXMLParserDelegateAbortedParseError")]
    pub const DelegateAbortedParseError: Self = Self(512);
}

unsafe impl Encode for NSXMLParserError {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for NSXMLParserError {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}