objc2_foundation/generated/
NSFileManager.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfileattributekey?language=objc)
10// NS_TYPED_EXTENSIBLE_ENUM
11#[cfg(feature = "NSString")]
12pub type NSFileAttributeKey = NSString;
13
14/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfileattributetype?language=objc)
15// NS_TYPED_ENUM
16#[cfg(feature = "NSString")]
17pub type NSFileAttributeType = NSString;
18
19/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfileprotectiontype?language=objc)
20// NS_TYPED_ENUM
21#[cfg(feature = "NSString")]
22pub type NSFileProtectionType = NSString;
23
24/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfileproviderservicename?language=objc)
25// NS_TYPED_EXTENSIBLE_ENUM
26#[cfg(feature = "NSString")]
27pub type NSFileProviderServiceName = NSString;
28
29/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsvolumeenumerationoptions?language=objc)
30// NS_OPTIONS
31#[repr(transparent)]
32#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
33pub struct NSVolumeEnumerationOptions(pub NSUInteger);
34bitflags::bitflags! {
35    impl NSVolumeEnumerationOptions: NSUInteger {
36        #[doc(alias = "NSVolumeEnumerationSkipHiddenVolumes")]
37        const SkipHiddenVolumes = 1<<1;
38        #[doc(alias = "NSVolumeEnumerationProduceFileReferenceURLs")]
39        const ProduceFileReferenceURLs = 1<<2;
40    }
41}
42
43unsafe impl Encode for NSVolumeEnumerationOptions {
44    const ENCODING: Encoding = NSUInteger::ENCODING;
45}
46
47unsafe impl RefEncode for NSVolumeEnumerationOptions {
48    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
49}
50
51/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsdirectoryenumerationoptions?language=objc)
52// NS_OPTIONS
53#[repr(transparent)]
54#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
55pub struct NSDirectoryEnumerationOptions(pub NSUInteger);
56bitflags::bitflags! {
57    impl NSDirectoryEnumerationOptions: NSUInteger {
58        #[doc(alias = "NSDirectoryEnumerationSkipsSubdirectoryDescendants")]
59        const SkipsSubdirectoryDescendants = 1<<0;
60        #[doc(alias = "NSDirectoryEnumerationSkipsPackageDescendants")]
61        const SkipsPackageDescendants = 1<<1;
62        #[doc(alias = "NSDirectoryEnumerationSkipsHiddenFiles")]
63        const SkipsHiddenFiles = 1<<2;
64        #[doc(alias = "NSDirectoryEnumerationIncludesDirectoriesPostOrder")]
65        const IncludesDirectoriesPostOrder = 1<<3;
66        #[doc(alias = "NSDirectoryEnumerationProducesRelativePathURLs")]
67        const ProducesRelativePathURLs = 1<<4;
68    }
69}
70
71unsafe impl Encode for NSDirectoryEnumerationOptions {
72    const ENCODING: Encoding = NSUInteger::ENCODING;
73}
74
75unsafe impl RefEncode for NSDirectoryEnumerationOptions {
76    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
77}
78
79/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfilemanageritemreplacementoptions?language=objc)
80// NS_OPTIONS
81#[repr(transparent)]
82#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
83pub struct NSFileManagerItemReplacementOptions(pub NSUInteger);
84bitflags::bitflags! {
85    impl NSFileManagerItemReplacementOptions: NSUInteger {
86        #[doc(alias = "NSFileManagerItemReplacementUsingNewMetadataOnly")]
87        const UsingNewMetadataOnly = 1<<0;
88        #[doc(alias = "NSFileManagerItemReplacementWithoutDeletingBackupItem")]
89        const WithoutDeletingBackupItem = 1<<1;
90    }
91}
92
93unsafe impl Encode for NSFileManagerItemReplacementOptions {
94    const ENCODING: Encoding = NSUInteger::ENCODING;
95}
96
97unsafe impl RefEncode for NSFileManagerItemReplacementOptions {
98    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
99}
100
101/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlrelationship?language=objc)
102// NS_ENUM
103#[repr(transparent)]
104#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
105pub struct NSURLRelationship(pub NSInteger);
106impl NSURLRelationship {
107    #[doc(alias = "NSURLRelationshipContains")]
108    pub const Contains: Self = Self(0);
109    #[doc(alias = "NSURLRelationshipSame")]
110    pub const Same: Self = Self(1);
111    #[doc(alias = "NSURLRelationshipOther")]
112    pub const Other: Self = Self(2);
113}
114
115unsafe impl Encode for NSURLRelationship {
116    const ENCODING: Encoding = NSInteger::ENCODING;
117}
118
119unsafe impl RefEncode for NSURLRelationship {
120    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
121}
122
123/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfilemanagerunmountoptions?language=objc)
124// NS_OPTIONS
125#[repr(transparent)]
126#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
127pub struct NSFileManagerUnmountOptions(pub NSUInteger);
128bitflags::bitflags! {
129    impl NSFileManagerUnmountOptions: NSUInteger {
130        #[doc(alias = "NSFileManagerUnmountAllPartitionsAndEjectDisk")]
131        const AllPartitionsAndEjectDisk = 1<<0;
132        #[doc(alias = "NSFileManagerUnmountWithoutUI")]
133        const WithoutUI = 1<<1;
134    }
135}
136
137unsafe impl Encode for NSFileManagerUnmountOptions {
138    const ENCODING: Encoding = NSUInteger::ENCODING;
139}
140
141unsafe impl RefEncode for NSFileManagerUnmountOptions {
142    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
143}
144
145extern "C" {
146    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfilemanagerunmountdissentingprocessidentifiererrorkey?language=objc)
147    #[cfg(feature = "NSString")]
148    pub static NSFileManagerUnmountDissentingProcessIdentifierErrorKey: &'static NSString;
149}
150
151extern "C" {
152    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsubiquityidentitydidchangenotification?language=objc)
153    #[cfg(all(feature = "NSNotification", feature = "NSString"))]
154    pub static NSUbiquityIdentityDidChangeNotification: &'static NSNotificationName;
155}
156
157extern_class!(
158    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfilemanager?language=objc)
159    #[unsafe(super(NSObject))]
160    #[derive(Debug, PartialEq, Eq, Hash)]
161    pub struct NSFileManager;
162);
163
164unsafe impl NSObjectProtocol for NSFileManager {}
165
166impl NSFileManager {
167    extern_methods!(
168        #[unsafe(method(defaultManager))]
169        #[unsafe(method_family = none)]
170        pub unsafe fn defaultManager() -> Retained<NSFileManager>;
171
172        #[cfg(all(feature = "NSArray", feature = "NSString", feature = "NSURL"))]
173        #[unsafe(method(mountedVolumeURLsIncludingResourceValuesForKeys:options:))]
174        #[unsafe(method_family = none)]
175        pub unsafe fn mountedVolumeURLsIncludingResourceValuesForKeys_options(
176            &self,
177            property_keys: Option<&NSArray<NSURLResourceKey>>,
178            options: NSVolumeEnumerationOptions,
179        ) -> Option<Retained<NSArray<NSURL>>>;
180
181        #[cfg(all(feature = "NSError", feature = "NSURL", feature = "block2"))]
182        #[unsafe(method(unmountVolumeAtURL:options:completionHandler:))]
183        #[unsafe(method_family = none)]
184        pub unsafe fn unmountVolumeAtURL_options_completionHandler(
185            &self,
186            url: &NSURL,
187            mask: NSFileManagerUnmountOptions,
188            completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
189        );
190
191        #[cfg(all(
192            feature = "NSArray",
193            feature = "NSError",
194            feature = "NSString",
195            feature = "NSURL"
196        ))]
197        #[unsafe(method(contentsOfDirectoryAtURL:includingPropertiesForKeys:options:error:_))]
198        #[unsafe(method_family = none)]
199        pub unsafe fn contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error(
200            &self,
201            url: &NSURL,
202            keys: Option<&NSArray<NSURLResourceKey>>,
203            mask: NSDirectoryEnumerationOptions,
204        ) -> Result<Retained<NSArray<NSURL>>, Retained<NSError>>;
205
206        #[cfg(all(feature = "NSArray", feature = "NSPathUtilities", feature = "NSURL"))]
207        #[unsafe(method(URLsForDirectory:inDomains:))]
208        #[unsafe(method_family = none)]
209        pub unsafe fn URLsForDirectory_inDomains(
210            &self,
211            directory: NSSearchPathDirectory,
212            domain_mask: NSSearchPathDomainMask,
213        ) -> Retained<NSArray<NSURL>>;
214
215        #[cfg(all(feature = "NSError", feature = "NSPathUtilities", feature = "NSURL"))]
216        #[unsafe(method(URLForDirectory:inDomain:appropriateForURL:create:error:_))]
217        #[unsafe(method_family = none)]
218        pub unsafe fn URLForDirectory_inDomain_appropriateForURL_create_error(
219            &self,
220            directory: NSSearchPathDirectory,
221            domain: NSSearchPathDomainMask,
222            url: Option<&NSURL>,
223            should_create: bool,
224        ) -> Result<Retained<NSURL>, Retained<NSError>>;
225
226        #[cfg(all(feature = "NSError", feature = "NSURL"))]
227        #[unsafe(method(getRelationship:ofDirectoryAtURL:toItemAtURL:error:_))]
228        #[unsafe(method_family = none)]
229        pub unsafe fn getRelationship_ofDirectoryAtURL_toItemAtURL_error(
230            &self,
231            out_relationship: NonNull<NSURLRelationship>,
232            directory_url: &NSURL,
233            other_url: &NSURL,
234        ) -> Result<(), Retained<NSError>>;
235
236        #[cfg(all(feature = "NSError", feature = "NSPathUtilities", feature = "NSURL"))]
237        #[unsafe(method(getRelationship:ofDirectory:inDomain:toItemAtURL:error:_))]
238        #[unsafe(method_family = none)]
239        pub unsafe fn getRelationship_ofDirectory_inDomain_toItemAtURL_error(
240            &self,
241            out_relationship: NonNull<NSURLRelationship>,
242            directory: NSSearchPathDirectory,
243            domain_mask: NSSearchPathDomainMask,
244            url: &NSURL,
245        ) -> Result<(), Retained<NSError>>;
246
247        #[cfg(all(
248            feature = "NSDictionary",
249            feature = "NSError",
250            feature = "NSString",
251            feature = "NSURL"
252        ))]
253        #[unsafe(method(createDirectoryAtURL:withIntermediateDirectories:attributes:error:_))]
254        #[unsafe(method_family = none)]
255        pub unsafe fn createDirectoryAtURL_withIntermediateDirectories_attributes_error(
256            &self,
257            url: &NSURL,
258            create_intermediates: bool,
259            attributes: Option<&NSDictionary<NSFileAttributeKey, AnyObject>>,
260        ) -> Result<(), Retained<NSError>>;
261
262        #[cfg(all(feature = "NSError", feature = "NSURL"))]
263        #[unsafe(method(createSymbolicLinkAtURL:withDestinationURL:error:_))]
264        #[unsafe(method_family = none)]
265        pub unsafe fn createSymbolicLinkAtURL_withDestinationURL_error(
266            &self,
267            url: &NSURL,
268            dest_url: &NSURL,
269        ) -> Result<(), Retained<NSError>>;
270
271        #[unsafe(method(delegate))]
272        #[unsafe(method_family = none)]
273        pub unsafe fn delegate(
274            &self,
275        ) -> Option<Retained<ProtocolObject<dyn NSFileManagerDelegate>>>;
276
277        /// Setter for [`delegate`][Self::delegate].
278        #[unsafe(method(setDelegate:))]
279        #[unsafe(method_family = none)]
280        pub unsafe fn setDelegate(
281            &self,
282            delegate: Option<&ProtocolObject<dyn NSFileManagerDelegate>>,
283        );
284
285        #[cfg(all(feature = "NSDictionary", feature = "NSError", feature = "NSString"))]
286        #[unsafe(method(setAttributes:ofItemAtPath:error:_))]
287        #[unsafe(method_family = none)]
288        pub unsafe fn setAttributes_ofItemAtPath_error(
289            &self,
290            attributes: &NSDictionary<NSFileAttributeKey, AnyObject>,
291            path: &NSString,
292        ) -> Result<(), Retained<NSError>>;
293
294        #[cfg(all(feature = "NSDictionary", feature = "NSError", feature = "NSString"))]
295        #[unsafe(method(createDirectoryAtPath:withIntermediateDirectories:attributes:error:_))]
296        #[unsafe(method_family = none)]
297        pub unsafe fn createDirectoryAtPath_withIntermediateDirectories_attributes_error(
298            &self,
299            path: &NSString,
300            create_intermediates: bool,
301            attributes: Option<&NSDictionary<NSFileAttributeKey, AnyObject>>,
302        ) -> Result<(), Retained<NSError>>;
303
304        #[cfg(all(feature = "NSArray", feature = "NSError", feature = "NSString"))]
305        #[unsafe(method(contentsOfDirectoryAtPath:error:_))]
306        #[unsafe(method_family = none)]
307        pub unsafe fn contentsOfDirectoryAtPath_error(
308            &self,
309            path: &NSString,
310        ) -> Result<Retained<NSArray<NSString>>, Retained<NSError>>;
311
312        #[cfg(all(feature = "NSArray", feature = "NSError", feature = "NSString"))]
313        #[unsafe(method(subpathsOfDirectoryAtPath:error:_))]
314        #[unsafe(method_family = none)]
315        pub unsafe fn subpathsOfDirectoryAtPath_error(
316            &self,
317            path: &NSString,
318        ) -> Result<Retained<NSArray<NSString>>, Retained<NSError>>;
319
320        #[cfg(all(feature = "NSDictionary", feature = "NSError", feature = "NSString"))]
321        #[unsafe(method(attributesOfItemAtPath:error:_))]
322        #[unsafe(method_family = none)]
323        pub unsafe fn attributesOfItemAtPath_error(
324            &self,
325            path: &NSString,
326        ) -> Result<Retained<NSDictionary<NSFileAttributeKey, AnyObject>>, Retained<NSError>>;
327
328        #[cfg(all(feature = "NSDictionary", feature = "NSError", feature = "NSString"))]
329        #[unsafe(method(attributesOfFileSystemForPath:error:_))]
330        #[unsafe(method_family = none)]
331        pub unsafe fn attributesOfFileSystemForPath_error(
332            &self,
333            path: &NSString,
334        ) -> Result<Retained<NSDictionary<NSFileAttributeKey, AnyObject>>, Retained<NSError>>;
335
336        #[cfg(all(feature = "NSError", feature = "NSString"))]
337        #[unsafe(method(createSymbolicLinkAtPath:withDestinationPath:error:_))]
338        #[unsafe(method_family = none)]
339        pub unsafe fn createSymbolicLinkAtPath_withDestinationPath_error(
340            &self,
341            path: &NSString,
342            dest_path: &NSString,
343        ) -> Result<(), Retained<NSError>>;
344
345        #[cfg(all(feature = "NSError", feature = "NSString"))]
346        #[unsafe(method(destinationOfSymbolicLinkAtPath:error:_))]
347        #[unsafe(method_family = none)]
348        pub unsafe fn destinationOfSymbolicLinkAtPath_error(
349            &self,
350            path: &NSString,
351        ) -> Result<Retained<NSString>, Retained<NSError>>;
352
353        #[cfg(all(feature = "NSError", feature = "NSString"))]
354        #[unsafe(method(copyItemAtPath:toPath:error:_))]
355        #[unsafe(method_family = none)]
356        pub unsafe fn copyItemAtPath_toPath_error(
357            &self,
358            src_path: &NSString,
359            dst_path: &NSString,
360        ) -> Result<(), Retained<NSError>>;
361
362        #[cfg(all(feature = "NSError", feature = "NSString"))]
363        #[unsafe(method(moveItemAtPath:toPath:error:_))]
364        #[unsafe(method_family = none)]
365        pub unsafe fn moveItemAtPath_toPath_error(
366            &self,
367            src_path: &NSString,
368            dst_path: &NSString,
369        ) -> Result<(), Retained<NSError>>;
370
371        #[cfg(all(feature = "NSError", feature = "NSString"))]
372        #[unsafe(method(linkItemAtPath:toPath:error:_))]
373        #[unsafe(method_family = none)]
374        pub unsafe fn linkItemAtPath_toPath_error(
375            &self,
376            src_path: &NSString,
377            dst_path: &NSString,
378        ) -> Result<(), Retained<NSError>>;
379
380        #[cfg(all(feature = "NSError", feature = "NSString"))]
381        #[unsafe(method(removeItemAtPath:error:_))]
382        #[unsafe(method_family = none)]
383        pub unsafe fn removeItemAtPath_error(
384            &self,
385            path: &NSString,
386        ) -> Result<(), Retained<NSError>>;
387
388        #[cfg(all(feature = "NSError", feature = "NSURL"))]
389        #[unsafe(method(copyItemAtURL:toURL:error:_))]
390        #[unsafe(method_family = none)]
391        pub unsafe fn copyItemAtURL_toURL_error(
392            &self,
393            src_url: &NSURL,
394            dst_url: &NSURL,
395        ) -> Result<(), Retained<NSError>>;
396
397        #[cfg(all(feature = "NSError", feature = "NSURL"))]
398        #[unsafe(method(moveItemAtURL:toURL:error:_))]
399        #[unsafe(method_family = none)]
400        pub unsafe fn moveItemAtURL_toURL_error(
401            &self,
402            src_url: &NSURL,
403            dst_url: &NSURL,
404        ) -> Result<(), Retained<NSError>>;
405
406        #[cfg(all(feature = "NSError", feature = "NSURL"))]
407        #[unsafe(method(linkItemAtURL:toURL:error:_))]
408        #[unsafe(method_family = none)]
409        pub unsafe fn linkItemAtURL_toURL_error(
410            &self,
411            src_url: &NSURL,
412            dst_url: &NSURL,
413        ) -> Result<(), Retained<NSError>>;
414
415        #[cfg(all(feature = "NSError", feature = "NSURL"))]
416        #[unsafe(method(removeItemAtURL:error:_))]
417        #[unsafe(method_family = none)]
418        pub unsafe fn removeItemAtURL_error(&self, url: &NSURL) -> Result<(), Retained<NSError>>;
419
420        #[cfg(all(feature = "NSError", feature = "NSURL"))]
421        #[unsafe(method(trashItemAtURL:resultingItemURL:error:_))]
422        #[unsafe(method_family = none)]
423        pub unsafe fn trashItemAtURL_resultingItemURL_error(
424            &self,
425            url: &NSURL,
426            out_resulting_url: Option<&mut Option<Retained<NSURL>>>,
427        ) -> Result<(), Retained<NSError>>;
428
429        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
430        #[deprecated = "Use -attributesOfItemAtPath:error: instead"]
431        #[unsafe(method(fileAttributesAtPath:traverseLink:))]
432        #[unsafe(method_family = none)]
433        pub unsafe fn fileAttributesAtPath_traverseLink(
434            &self,
435            path: &NSString,
436            yorn: bool,
437        ) -> Option<Retained<NSDictionary>>;
438
439        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
440        #[deprecated = "Use -setAttributes:ofItemAtPath:error: instead"]
441        #[unsafe(method(changeFileAttributes:atPath:))]
442        #[unsafe(method_family = none)]
443        pub unsafe fn changeFileAttributes_atPath(
444            &self,
445            attributes: &NSDictionary,
446            path: &NSString,
447        ) -> bool;
448
449        #[cfg(all(feature = "NSArray", feature = "NSString"))]
450        #[deprecated = "Use -contentsOfDirectoryAtPath:error: instead"]
451        #[unsafe(method(directoryContentsAtPath:))]
452        #[unsafe(method_family = none)]
453        pub unsafe fn directoryContentsAtPath(&self, path: &NSString) -> Option<Retained<NSArray>>;
454
455        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
456        #[deprecated = "Use -attributesOfFileSystemForPath:error: instead"]
457        #[unsafe(method(fileSystemAttributesAtPath:))]
458        #[unsafe(method_family = none)]
459        pub unsafe fn fileSystemAttributesAtPath(
460            &self,
461            path: &NSString,
462        ) -> Option<Retained<NSDictionary>>;
463
464        #[cfg(feature = "NSString")]
465        #[deprecated = "Use -destinationOfSymbolicLinkAtPath:error:"]
466        #[unsafe(method(pathContentOfSymbolicLinkAtPath:))]
467        #[unsafe(method_family = none)]
468        pub unsafe fn pathContentOfSymbolicLinkAtPath(
469            &self,
470            path: &NSString,
471        ) -> Option<Retained<NSString>>;
472
473        #[cfg(feature = "NSString")]
474        #[deprecated = "Use -createSymbolicLinkAtPath:error: instead"]
475        #[unsafe(method(createSymbolicLinkAtPath:pathContent:))]
476        #[unsafe(method_family = none)]
477        pub unsafe fn createSymbolicLinkAtPath_pathContent(
478            &self,
479            path: &NSString,
480            otherpath: &NSString,
481        ) -> bool;
482
483        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
484        #[deprecated = "Use -createDirectoryAtPath:withIntermediateDirectories:attributes:error: instead"]
485        #[unsafe(method(createDirectoryAtPath:attributes:))]
486        #[unsafe(method_family = none)]
487        pub unsafe fn createDirectoryAtPath_attributes(
488            &self,
489            path: &NSString,
490            attributes: &NSDictionary,
491        ) -> bool;
492
493        #[cfg(feature = "NSString")]
494        #[deprecated = "Not supported"]
495        #[unsafe(method(linkPath:toPath:handler:))]
496        #[unsafe(method_family = none)]
497        pub unsafe fn linkPath_toPath_handler(
498            &self,
499            src: &NSString,
500            dest: &NSString,
501            handler: Option<&AnyObject>,
502        ) -> bool;
503
504        #[cfg(feature = "NSString")]
505        #[deprecated = "Not supported"]
506        #[unsafe(method(copyPath:toPath:handler:))]
507        #[unsafe(method_family = none)]
508        pub unsafe fn copyPath_toPath_handler(
509            &self,
510            src: &NSString,
511            dest: &NSString,
512            handler: Option<&AnyObject>,
513        ) -> bool;
514
515        #[cfg(feature = "NSString")]
516        #[deprecated = "Not supported"]
517        #[unsafe(method(movePath:toPath:handler:))]
518        #[unsafe(method_family = none)]
519        pub unsafe fn movePath_toPath_handler(
520            &self,
521            src: &NSString,
522            dest: &NSString,
523            handler: Option<&AnyObject>,
524        ) -> bool;
525
526        #[cfg(feature = "NSString")]
527        #[deprecated = "Not supported"]
528        #[unsafe(method(removeFileAtPath:handler:))]
529        #[unsafe(method_family = none)]
530        pub unsafe fn removeFileAtPath_handler(
531            &self,
532            path: &NSString,
533            handler: Option<&AnyObject>,
534        ) -> bool;
535
536        #[cfg(feature = "NSString")]
537        #[unsafe(method(currentDirectoryPath))]
538        #[unsafe(method_family = none)]
539        pub unsafe fn currentDirectoryPath(&self) -> Retained<NSString>;
540
541        #[cfg(feature = "NSString")]
542        #[unsafe(method(changeCurrentDirectoryPath:))]
543        #[unsafe(method_family = none)]
544        pub unsafe fn changeCurrentDirectoryPath(&self, path: &NSString) -> bool;
545
546        #[cfg(feature = "NSString")]
547        #[unsafe(method(fileExistsAtPath:))]
548        #[unsafe(method_family = none)]
549        pub unsafe fn fileExistsAtPath(&self, path: &NSString) -> bool;
550
551        #[cfg(feature = "NSString")]
552        #[unsafe(method(fileExistsAtPath:isDirectory:))]
553        #[unsafe(method_family = none)]
554        pub unsafe fn fileExistsAtPath_isDirectory(
555            &self,
556            path: &NSString,
557            is_directory: *mut Bool,
558        ) -> bool;
559
560        #[cfg(feature = "NSString")]
561        #[unsafe(method(isReadableFileAtPath:))]
562        #[unsafe(method_family = none)]
563        pub unsafe fn isReadableFileAtPath(&self, path: &NSString) -> bool;
564
565        #[cfg(feature = "NSString")]
566        #[unsafe(method(isWritableFileAtPath:))]
567        #[unsafe(method_family = none)]
568        pub unsafe fn isWritableFileAtPath(&self, path: &NSString) -> bool;
569
570        #[cfg(feature = "NSString")]
571        #[unsafe(method(isExecutableFileAtPath:))]
572        #[unsafe(method_family = none)]
573        pub unsafe fn isExecutableFileAtPath(&self, path: &NSString) -> bool;
574
575        #[cfg(feature = "NSString")]
576        #[unsafe(method(isDeletableFileAtPath:))]
577        #[unsafe(method_family = none)]
578        pub unsafe fn isDeletableFileAtPath(&self, path: &NSString) -> bool;
579
580        #[cfg(feature = "NSString")]
581        #[unsafe(method(contentsEqualAtPath:andPath:))]
582        #[unsafe(method_family = none)]
583        pub unsafe fn contentsEqualAtPath_andPath(
584            &self,
585            path1: &NSString,
586            path2: &NSString,
587        ) -> bool;
588
589        #[cfg(feature = "NSString")]
590        #[unsafe(method(displayNameAtPath:))]
591        #[unsafe(method_family = none)]
592        pub unsafe fn displayNameAtPath(&self, path: &NSString) -> Retained<NSString>;
593
594        #[cfg(all(feature = "NSArray", feature = "NSString"))]
595        #[unsafe(method(componentsToDisplayForPath:))]
596        #[unsafe(method_family = none)]
597        pub unsafe fn componentsToDisplayForPath(
598            &self,
599            path: &NSString,
600        ) -> Option<Retained<NSArray<NSString>>>;
601
602        #[cfg(all(feature = "NSEnumerator", feature = "NSString"))]
603        #[unsafe(method(enumeratorAtPath:))]
604        #[unsafe(method_family = none)]
605        pub unsafe fn enumeratorAtPath(
606            &self,
607            path: &NSString,
608        ) -> Option<Retained<NSDirectoryEnumerator<NSString>>>;
609
610        #[cfg(all(
611            feature = "NSArray",
612            feature = "NSEnumerator",
613            feature = "NSError",
614            feature = "NSString",
615            feature = "NSURL",
616            feature = "block2"
617        ))]
618        #[unsafe(method(enumeratorAtURL:includingPropertiesForKeys:options:errorHandler:))]
619        #[unsafe(method_family = none)]
620        pub unsafe fn enumeratorAtURL_includingPropertiesForKeys_options_errorHandler(
621            &self,
622            url: &NSURL,
623            keys: Option<&NSArray<NSURLResourceKey>>,
624            mask: NSDirectoryEnumerationOptions,
625            handler: Option<&block2::Block<dyn Fn(NonNull<NSURL>, NonNull<NSError>) -> Bool>>,
626        ) -> Option<Retained<NSDirectoryEnumerator<NSURL>>>;
627
628        #[cfg(all(feature = "NSArray", feature = "NSString"))]
629        #[unsafe(method(subpathsAtPath:))]
630        #[unsafe(method_family = none)]
631        pub unsafe fn subpathsAtPath(&self, path: &NSString)
632            -> Option<Retained<NSArray<NSString>>>;
633
634        #[cfg(all(feature = "NSData", feature = "NSString"))]
635        #[unsafe(method(contentsAtPath:))]
636        #[unsafe(method_family = none)]
637        pub unsafe fn contentsAtPath(&self, path: &NSString) -> Option<Retained<NSData>>;
638
639        #[cfg(all(feature = "NSData", feature = "NSDictionary", feature = "NSString"))]
640        #[unsafe(method(createFileAtPath:contents:attributes:))]
641        #[unsafe(method_family = none)]
642        pub unsafe fn createFileAtPath_contents_attributes(
643            &self,
644            path: &NSString,
645            data: Option<&NSData>,
646            attr: Option<&NSDictionary<NSFileAttributeKey, AnyObject>>,
647        ) -> bool;
648
649        #[cfg(feature = "NSString")]
650        #[unsafe(method(fileSystemRepresentationWithPath:))]
651        #[unsafe(method_family = none)]
652        pub unsafe fn fileSystemRepresentationWithPath(&self, path: &NSString) -> NonNull<c_char>;
653
654        #[cfg(feature = "NSString")]
655        #[unsafe(method(stringWithFileSystemRepresentation:length:))]
656        #[unsafe(method_family = none)]
657        pub unsafe fn stringWithFileSystemRepresentation_length(
658            &self,
659            str: NonNull<c_char>,
660            len: NSUInteger,
661        ) -> Retained<NSString>;
662
663        #[cfg(all(feature = "NSError", feature = "NSString", feature = "NSURL"))]
664        #[unsafe(method(replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error:_))]
665        #[unsafe(method_family = none)]
666        pub unsafe fn replaceItemAtURL_withItemAtURL_backupItemName_options_resultingItemURL_error(
667            &self,
668            original_item_url: &NSURL,
669            new_item_url: &NSURL,
670            backup_item_name: Option<&NSString>,
671            options: NSFileManagerItemReplacementOptions,
672            resulting_url: Option<&mut Option<Retained<NSURL>>>,
673        ) -> Result<(), Retained<NSError>>;
674
675        #[cfg(all(feature = "NSError", feature = "NSURL"))]
676        #[unsafe(method(setUbiquitous:itemAtURL:destinationURL:error:_))]
677        #[unsafe(method_family = none)]
678        pub unsafe fn setUbiquitous_itemAtURL_destinationURL_error(
679            &self,
680            flag: bool,
681            url: &NSURL,
682            destination_url: &NSURL,
683        ) -> Result<(), Retained<NSError>>;
684
685        #[cfg(feature = "NSURL")]
686        #[unsafe(method(isUbiquitousItemAtURL:))]
687        #[unsafe(method_family = none)]
688        pub unsafe fn isUbiquitousItemAtURL(&self, url: &NSURL) -> bool;
689
690        #[cfg(all(feature = "NSError", feature = "NSURL"))]
691        #[unsafe(method(startDownloadingUbiquitousItemAtURL:error:_))]
692        #[unsafe(method_family = none)]
693        pub unsafe fn startDownloadingUbiquitousItemAtURL_error(
694            &self,
695            url: &NSURL,
696        ) -> Result<(), Retained<NSError>>;
697
698        #[cfg(all(feature = "NSError", feature = "NSURL"))]
699        #[unsafe(method(evictUbiquitousItemAtURL:error:_))]
700        #[unsafe(method_family = none)]
701        pub unsafe fn evictUbiquitousItemAtURL_error(
702            &self,
703            url: &NSURL,
704        ) -> Result<(), Retained<NSError>>;
705
706        #[cfg(all(feature = "NSString", feature = "NSURL"))]
707        #[unsafe(method(URLForUbiquityContainerIdentifier:))]
708        #[unsafe(method_family = none)]
709        pub unsafe fn URLForUbiquityContainerIdentifier(
710            &self,
711            container_identifier: Option<&NSString>,
712        ) -> Option<Retained<NSURL>>;
713
714        #[cfg(all(feature = "NSDate", feature = "NSError", feature = "NSURL"))]
715        #[unsafe(method(URLForPublishingUbiquitousItemAtURL:expirationDate:error:_))]
716        #[unsafe(method_family = none)]
717        pub unsafe fn URLForPublishingUbiquitousItemAtURL_expirationDate_error(
718            &self,
719            url: &NSURL,
720            out_date: Option<&mut Option<Retained<NSDate>>>,
721        ) -> Result<Retained<NSURL>, Retained<NSError>>;
722
723        #[cfg(feature = "NSObject")]
724        #[unsafe(method(ubiquityIdentityToken))]
725        #[unsafe(method_family = none)]
726        pub unsafe fn ubiquityIdentityToken(
727            &self,
728        ) -> Option<Retained<AnyObject /* NSObjectProtocol+ NSCopying+ NSCoding */>>;
729
730        #[cfg(all(
731            feature = "NSDictionary",
732            feature = "NSError",
733            feature = "NSString",
734            feature = "NSURL",
735            feature = "block2"
736        ))]
737        #[unsafe(method(getFileProviderServicesForItemAtURL:completionHandler:))]
738        #[unsafe(method_family = none)]
739        pub unsafe fn getFileProviderServicesForItemAtURL_completionHandler(
740            &self,
741            url: &NSURL,
742            completion_handler: &block2::Block<
743                dyn Fn(
744                    *mut NSDictionary<NSFileProviderServiceName, NSFileProviderService>,
745                    *mut NSError,
746                ),
747            >,
748        );
749
750        #[cfg(all(feature = "NSString", feature = "NSURL"))]
751        #[unsafe(method(containerURLForSecurityApplicationGroupIdentifier:))]
752        #[unsafe(method_family = none)]
753        pub unsafe fn containerURLForSecurityApplicationGroupIdentifier(
754            &self,
755            group_identifier: &NSString,
756        ) -> Option<Retained<NSURL>>;
757    );
758}
759
760/// Methods declared on superclass `NSObject`.
761impl NSFileManager {
762    extern_methods!(
763        #[unsafe(method(init))]
764        #[unsafe(method_family = init)]
765        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
766
767        #[unsafe(method(new))]
768        #[unsafe(method_family = new)]
769        pub unsafe fn new() -> Retained<Self>;
770    );
771}
772
773/// NSUserInformation.
774impl NSFileManager {
775    extern_methods!(
776        #[cfg(feature = "NSURL")]
777        #[unsafe(method(homeDirectoryForCurrentUser))]
778        #[unsafe(method_family = none)]
779        pub unsafe fn homeDirectoryForCurrentUser(&self) -> Retained<NSURL>;
780
781        #[cfg(feature = "NSURL")]
782        #[unsafe(method(temporaryDirectory))]
783        #[unsafe(method_family = none)]
784        pub unsafe fn temporaryDirectory(&self) -> Retained<NSURL>;
785
786        #[cfg(all(feature = "NSString", feature = "NSURL"))]
787        #[unsafe(method(homeDirectoryForUser:))]
788        #[unsafe(method_family = none)]
789        pub unsafe fn homeDirectoryForUser(&self, user_name: &NSString) -> Option<Retained<NSURL>>;
790    );
791}
792
793extern_protocol!(
794    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfilemanagerdelegate?language=objc)
795    pub unsafe trait NSFileManagerDelegate: NSObjectProtocol {
796        #[cfg(feature = "NSString")]
797        #[optional]
798        #[unsafe(method(fileManager:shouldCopyItemAtPath:toPath:))]
799        #[unsafe(method_family = none)]
800        unsafe fn fileManager_shouldCopyItemAtPath_toPath(
801            &self,
802            file_manager: &NSFileManager,
803            src_path: &NSString,
804            dst_path: &NSString,
805        ) -> bool;
806
807        #[cfg(feature = "NSURL")]
808        #[optional]
809        #[unsafe(method(fileManager:shouldCopyItemAtURL:toURL:))]
810        #[unsafe(method_family = none)]
811        unsafe fn fileManager_shouldCopyItemAtURL_toURL(
812            &self,
813            file_manager: &NSFileManager,
814            src_url: &NSURL,
815            dst_url: &NSURL,
816        ) -> bool;
817
818        #[cfg(all(feature = "NSError", feature = "NSString"))]
819        #[optional]
820        #[unsafe(method(fileManager:shouldProceedAfterError:copyingItemAtPath:toPath:))]
821        #[unsafe(method_family = none)]
822        unsafe fn fileManager_shouldProceedAfterError_copyingItemAtPath_toPath(
823            &self,
824            file_manager: &NSFileManager,
825            error: &NSError,
826            src_path: &NSString,
827            dst_path: &NSString,
828        ) -> bool;
829
830        #[cfg(all(feature = "NSError", feature = "NSURL"))]
831        #[optional]
832        #[unsafe(method(fileManager:shouldProceedAfterError:copyingItemAtURL:toURL:))]
833        #[unsafe(method_family = none)]
834        unsafe fn fileManager_shouldProceedAfterError_copyingItemAtURL_toURL(
835            &self,
836            file_manager: &NSFileManager,
837            error: &NSError,
838            src_url: &NSURL,
839            dst_url: &NSURL,
840        ) -> bool;
841
842        #[cfg(feature = "NSString")]
843        #[optional]
844        #[unsafe(method(fileManager:shouldMoveItemAtPath:toPath:))]
845        #[unsafe(method_family = none)]
846        unsafe fn fileManager_shouldMoveItemAtPath_toPath(
847            &self,
848            file_manager: &NSFileManager,
849            src_path: &NSString,
850            dst_path: &NSString,
851        ) -> bool;
852
853        #[cfg(feature = "NSURL")]
854        #[optional]
855        #[unsafe(method(fileManager:shouldMoveItemAtURL:toURL:))]
856        #[unsafe(method_family = none)]
857        unsafe fn fileManager_shouldMoveItemAtURL_toURL(
858            &self,
859            file_manager: &NSFileManager,
860            src_url: &NSURL,
861            dst_url: &NSURL,
862        ) -> bool;
863
864        #[cfg(all(feature = "NSError", feature = "NSString"))]
865        #[optional]
866        #[unsafe(method(fileManager:shouldProceedAfterError:movingItemAtPath:toPath:))]
867        #[unsafe(method_family = none)]
868        unsafe fn fileManager_shouldProceedAfterError_movingItemAtPath_toPath(
869            &self,
870            file_manager: &NSFileManager,
871            error: &NSError,
872            src_path: &NSString,
873            dst_path: &NSString,
874        ) -> bool;
875
876        #[cfg(all(feature = "NSError", feature = "NSURL"))]
877        #[optional]
878        #[unsafe(method(fileManager:shouldProceedAfterError:movingItemAtURL:toURL:))]
879        #[unsafe(method_family = none)]
880        unsafe fn fileManager_shouldProceedAfterError_movingItemAtURL_toURL(
881            &self,
882            file_manager: &NSFileManager,
883            error: &NSError,
884            src_url: &NSURL,
885            dst_url: &NSURL,
886        ) -> bool;
887
888        #[cfg(feature = "NSString")]
889        #[optional]
890        #[unsafe(method(fileManager:shouldLinkItemAtPath:toPath:))]
891        #[unsafe(method_family = none)]
892        unsafe fn fileManager_shouldLinkItemAtPath_toPath(
893            &self,
894            file_manager: &NSFileManager,
895            src_path: &NSString,
896            dst_path: &NSString,
897        ) -> bool;
898
899        #[cfg(feature = "NSURL")]
900        #[optional]
901        #[unsafe(method(fileManager:shouldLinkItemAtURL:toURL:))]
902        #[unsafe(method_family = none)]
903        unsafe fn fileManager_shouldLinkItemAtURL_toURL(
904            &self,
905            file_manager: &NSFileManager,
906            src_url: &NSURL,
907            dst_url: &NSURL,
908        ) -> bool;
909
910        #[cfg(all(feature = "NSError", feature = "NSString"))]
911        #[optional]
912        #[unsafe(method(fileManager:shouldProceedAfterError:linkingItemAtPath:toPath:))]
913        #[unsafe(method_family = none)]
914        unsafe fn fileManager_shouldProceedAfterError_linkingItemAtPath_toPath(
915            &self,
916            file_manager: &NSFileManager,
917            error: &NSError,
918            src_path: &NSString,
919            dst_path: &NSString,
920        ) -> bool;
921
922        #[cfg(all(feature = "NSError", feature = "NSURL"))]
923        #[optional]
924        #[unsafe(method(fileManager:shouldProceedAfterError:linkingItemAtURL:toURL:))]
925        #[unsafe(method_family = none)]
926        unsafe fn fileManager_shouldProceedAfterError_linkingItemAtURL_toURL(
927            &self,
928            file_manager: &NSFileManager,
929            error: &NSError,
930            src_url: &NSURL,
931            dst_url: &NSURL,
932        ) -> bool;
933
934        #[cfg(feature = "NSString")]
935        #[optional]
936        #[unsafe(method(fileManager:shouldRemoveItemAtPath:))]
937        #[unsafe(method_family = none)]
938        unsafe fn fileManager_shouldRemoveItemAtPath(
939            &self,
940            file_manager: &NSFileManager,
941            path: &NSString,
942        ) -> bool;
943
944        #[cfg(feature = "NSURL")]
945        #[optional]
946        #[unsafe(method(fileManager:shouldRemoveItemAtURL:))]
947        #[unsafe(method_family = none)]
948        unsafe fn fileManager_shouldRemoveItemAtURL(
949            &self,
950            file_manager: &NSFileManager,
951            url: &NSURL,
952        ) -> bool;
953
954        #[cfg(all(feature = "NSError", feature = "NSString"))]
955        #[optional]
956        #[unsafe(method(fileManager:shouldProceedAfterError:removingItemAtPath:))]
957        #[unsafe(method_family = none)]
958        unsafe fn fileManager_shouldProceedAfterError_removingItemAtPath(
959            &self,
960            file_manager: &NSFileManager,
961            error: &NSError,
962            path: &NSString,
963        ) -> bool;
964
965        #[cfg(all(feature = "NSError", feature = "NSURL"))]
966        #[optional]
967        #[unsafe(method(fileManager:shouldProceedAfterError:removingItemAtURL:))]
968        #[unsafe(method_family = none)]
969        unsafe fn fileManager_shouldProceedAfterError_removingItemAtURL(
970            &self,
971            file_manager: &NSFileManager,
972            error: &NSError,
973            url: &NSURL,
974        ) -> bool;
975    }
976);
977
978extern_class!(
979    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsdirectoryenumerator?language=objc)
980    #[unsafe(super(NSEnumerator<ObjectType, >, NSObject))]
981    #[derive(Debug, PartialEq, Eq, Hash)]
982    #[cfg(feature = "NSEnumerator")]
983    pub struct NSDirectoryEnumerator<ObjectType: ?Sized = AnyObject>;
984);
985
986#[cfg(feature = "NSEnumerator")]
987unsafe impl<ObjectType: ?Sized> NSFastEnumeration for NSDirectoryEnumerator<ObjectType> {}
988
989#[cfg(feature = "NSEnumerator")]
990unsafe impl<ObjectType: ?Sized> NSObjectProtocol for NSDirectoryEnumerator<ObjectType> {}
991
992#[cfg(feature = "NSEnumerator")]
993impl<ObjectType: Message> NSDirectoryEnumerator<ObjectType> {
994    extern_methods!(
995        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
996        #[unsafe(method(fileAttributes))]
997        #[unsafe(method_family = none)]
998        pub unsafe fn fileAttributes(
999            &self,
1000        ) -> Option<Retained<NSDictionary<NSFileAttributeKey, AnyObject>>>;
1001
1002        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
1003        #[unsafe(method(directoryAttributes))]
1004        #[unsafe(method_family = none)]
1005        pub unsafe fn directoryAttributes(
1006            &self,
1007        ) -> Option<Retained<NSDictionary<NSFileAttributeKey, AnyObject>>>;
1008
1009        #[unsafe(method(isEnumeratingDirectoryPostOrder))]
1010        #[unsafe(method_family = none)]
1011        pub unsafe fn isEnumeratingDirectoryPostOrder(&self) -> bool;
1012
1013        #[unsafe(method(skipDescendents))]
1014        #[unsafe(method_family = none)]
1015        pub unsafe fn skipDescendents(&self);
1016
1017        #[unsafe(method(level))]
1018        #[unsafe(method_family = none)]
1019        pub unsafe fn level(&self) -> NSUInteger;
1020
1021        #[unsafe(method(skipDescendants))]
1022        #[unsafe(method_family = none)]
1023        pub unsafe fn skipDescendants(&self);
1024    );
1025}
1026
1027/// Methods declared on superclass `NSObject`.
1028#[cfg(feature = "NSEnumerator")]
1029impl<ObjectType: Message> NSDirectoryEnumerator<ObjectType> {
1030    extern_methods!(
1031        #[unsafe(method(init))]
1032        #[unsafe(method_family = init)]
1033        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1034
1035        #[unsafe(method(new))]
1036        #[unsafe(method_family = new)]
1037        pub unsafe fn new() -> Retained<Self>;
1038    );
1039}
1040
1041extern_class!(
1042    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfileproviderservice?language=objc)
1043    #[unsafe(super(NSObject))]
1044    #[derive(Debug, PartialEq, Eq, Hash)]
1045    pub struct NSFileProviderService;
1046);
1047
1048unsafe impl NSObjectProtocol for NSFileProviderService {}
1049
1050impl NSFileProviderService {
1051    extern_methods!(
1052        #[cfg(all(feature = "NSError", feature = "NSXPCConnection", feature = "block2"))]
1053        #[unsafe(method(getFileProviderConnectionWithCompletionHandler:))]
1054        #[unsafe(method_family = none)]
1055        pub unsafe fn getFileProviderConnectionWithCompletionHandler(
1056            &self,
1057            completion_handler: &block2::Block<dyn Fn(*mut NSXPCConnection, *mut NSError)>,
1058        );
1059
1060        #[cfg(feature = "NSString")]
1061        #[unsafe(method(name))]
1062        #[unsafe(method_family = none)]
1063        pub unsafe fn name(&self) -> Retained<NSFileProviderServiceName>;
1064    );
1065}
1066
1067/// Methods declared on superclass `NSObject`.
1068impl NSFileProviderService {
1069    extern_methods!(
1070        #[unsafe(method(init))]
1071        #[unsafe(method_family = init)]
1072        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1073
1074        #[unsafe(method(new))]
1075        #[unsafe(method_family = new)]
1076        pub unsafe fn new() -> Retained<Self>;
1077    );
1078}
1079
1080extern "C" {
1081    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfiletype?language=objc)
1082    #[cfg(feature = "NSString")]
1083    pub static NSFileType: &'static NSFileAttributeKey;
1084}
1085
1086extern "C" {
1087    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfiletypedirectory?language=objc)
1088    #[cfg(feature = "NSString")]
1089    pub static NSFileTypeDirectory: &'static NSFileAttributeType;
1090}
1091
1092extern "C" {
1093    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfiletyperegular?language=objc)
1094    #[cfg(feature = "NSString")]
1095    pub static NSFileTypeRegular: &'static NSFileAttributeType;
1096}
1097
1098extern "C" {
1099    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfiletypesymboliclink?language=objc)
1100    #[cfg(feature = "NSString")]
1101    pub static NSFileTypeSymbolicLink: &'static NSFileAttributeType;
1102}
1103
1104extern "C" {
1105    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfiletypesocket?language=objc)
1106    #[cfg(feature = "NSString")]
1107    pub static NSFileTypeSocket: &'static NSFileAttributeType;
1108}
1109
1110extern "C" {
1111    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfiletypecharacterspecial?language=objc)
1112    #[cfg(feature = "NSString")]
1113    pub static NSFileTypeCharacterSpecial: &'static NSFileAttributeType;
1114}
1115
1116extern "C" {
1117    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfiletypeblockspecial?language=objc)
1118    #[cfg(feature = "NSString")]
1119    pub static NSFileTypeBlockSpecial: &'static NSFileAttributeType;
1120}
1121
1122extern "C" {
1123    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfiletypeunknown?language=objc)
1124    #[cfg(feature = "NSString")]
1125    pub static NSFileTypeUnknown: &'static NSFileAttributeType;
1126}
1127
1128extern "C" {
1129    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfilesize?language=objc)
1130    #[cfg(feature = "NSString")]
1131    pub static NSFileSize: &'static NSFileAttributeKey;
1132}
1133
1134extern "C" {
1135    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfilemodificationdate?language=objc)
1136    #[cfg(feature = "NSString")]
1137    pub static NSFileModificationDate: &'static NSFileAttributeKey;
1138}
1139
1140extern "C" {
1141    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfilereferencecount?language=objc)
1142    #[cfg(feature = "NSString")]
1143    pub static NSFileReferenceCount: &'static NSFileAttributeKey;
1144}
1145
1146extern "C" {
1147    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfiledeviceidentifier?language=objc)
1148    #[cfg(feature = "NSString")]
1149    pub static NSFileDeviceIdentifier: &'static NSFileAttributeKey;
1150}
1151
1152extern "C" {
1153    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfileowneraccountname?language=objc)
1154    #[cfg(feature = "NSString")]
1155    pub static NSFileOwnerAccountName: &'static NSFileAttributeKey;
1156}
1157
1158extern "C" {
1159    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfilegroupowneraccountname?language=objc)
1160    #[cfg(feature = "NSString")]
1161    pub static NSFileGroupOwnerAccountName: &'static NSFileAttributeKey;
1162}
1163
1164extern "C" {
1165    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfileposixpermissions?language=objc)
1166    #[cfg(feature = "NSString")]
1167    pub static NSFilePosixPermissions: &'static NSFileAttributeKey;
1168}
1169
1170extern "C" {
1171    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfilesystemnumber?language=objc)
1172    #[cfg(feature = "NSString")]
1173    pub static NSFileSystemNumber: &'static NSFileAttributeKey;
1174}
1175
1176extern "C" {
1177    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfilesystemfilenumber?language=objc)
1178    #[cfg(feature = "NSString")]
1179    pub static NSFileSystemFileNumber: &'static NSFileAttributeKey;
1180}
1181
1182extern "C" {
1183    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfileextensionhidden?language=objc)
1184    #[cfg(feature = "NSString")]
1185    pub static NSFileExtensionHidden: &'static NSFileAttributeKey;
1186}
1187
1188extern "C" {
1189    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfilehfscreatorcode?language=objc)
1190    #[cfg(feature = "NSString")]
1191    pub static NSFileHFSCreatorCode: &'static NSFileAttributeKey;
1192}
1193
1194extern "C" {
1195    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfilehfstypecode?language=objc)
1196    #[cfg(feature = "NSString")]
1197    pub static NSFileHFSTypeCode: &'static NSFileAttributeKey;
1198}
1199
1200extern "C" {
1201    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfileimmutable?language=objc)
1202    #[cfg(feature = "NSString")]
1203    pub static NSFileImmutable: &'static NSFileAttributeKey;
1204}
1205
1206extern "C" {
1207    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfileappendonly?language=objc)
1208    #[cfg(feature = "NSString")]
1209    pub static NSFileAppendOnly: &'static NSFileAttributeKey;
1210}
1211
1212extern "C" {
1213    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfilecreationdate?language=objc)
1214    #[cfg(feature = "NSString")]
1215    pub static NSFileCreationDate: &'static NSFileAttributeKey;
1216}
1217
1218extern "C" {
1219    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfileowneraccountid?language=objc)
1220    #[cfg(feature = "NSString")]
1221    pub static NSFileOwnerAccountID: &'static NSFileAttributeKey;
1222}
1223
1224extern "C" {
1225    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfilegroupowneraccountid?language=objc)
1226    #[cfg(feature = "NSString")]
1227    pub static NSFileGroupOwnerAccountID: &'static NSFileAttributeKey;
1228}
1229
1230extern "C" {
1231    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfilebusy?language=objc)
1232    #[cfg(feature = "NSString")]
1233    pub static NSFileBusy: &'static NSFileAttributeKey;
1234}
1235
1236extern "C" {
1237    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfileprotectionkey?language=objc)
1238    #[cfg(feature = "NSString")]
1239    pub static NSFileProtectionKey: &'static NSFileAttributeKey;
1240}
1241
1242extern "C" {
1243    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfileprotectionnone?language=objc)
1244    #[cfg(feature = "NSString")]
1245    pub static NSFileProtectionNone: &'static NSFileProtectionType;
1246}
1247
1248extern "C" {
1249    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfileprotectioncomplete?language=objc)
1250    #[cfg(feature = "NSString")]
1251    pub static NSFileProtectionComplete: &'static NSFileProtectionType;
1252}
1253
1254extern "C" {
1255    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfileprotectioncompleteunlessopen?language=objc)
1256    #[cfg(feature = "NSString")]
1257    pub static NSFileProtectionCompleteUnlessOpen: &'static NSFileProtectionType;
1258}
1259
1260extern "C" {
1261    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfileprotectioncompleteuntilfirstuserauthentication?language=objc)
1262    #[cfg(feature = "NSString")]
1263    pub static NSFileProtectionCompleteUntilFirstUserAuthentication: &'static NSFileProtectionType;
1264}
1265
1266extern "C" {
1267    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfileprotectioncompletewhenuserinactive?language=objc)
1268    #[cfg(feature = "NSString")]
1269    pub static NSFileProtectionCompleteWhenUserInactive: &'static NSFileProtectionType;
1270}
1271
1272extern "C" {
1273    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfilesystemsize?language=objc)
1274    #[cfg(feature = "NSString")]
1275    pub static NSFileSystemSize: &'static NSFileAttributeKey;
1276}
1277
1278extern "C" {
1279    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfilesystemfreesize?language=objc)
1280    #[cfg(feature = "NSString")]
1281    pub static NSFileSystemFreeSize: &'static NSFileAttributeKey;
1282}
1283
1284extern "C" {
1285    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfilesystemnodes?language=objc)
1286    #[cfg(feature = "NSString")]
1287    pub static NSFileSystemNodes: &'static NSFileAttributeKey;
1288}
1289
1290extern "C" {
1291    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfilesystemfreenodes?language=objc)
1292    #[cfg(feature = "NSString")]
1293    pub static NSFileSystemFreeNodes: &'static NSFileAttributeKey;
1294}
1295
1296/// NSFileAttributes.
1297#[cfg(feature = "NSDictionary")]
1298impl<KeyType: Message, ObjectType: Message> NSDictionary<KeyType, ObjectType> {
1299    extern_methods!(
1300        #[unsafe(method(fileSize))]
1301        #[unsafe(method_family = none)]
1302        pub unsafe fn fileSize(&self) -> c_ulonglong;
1303
1304        #[cfg(feature = "NSDate")]
1305        #[unsafe(method(fileModificationDate))]
1306        #[unsafe(method_family = none)]
1307        pub unsafe fn fileModificationDate(&self) -> Option<Retained<NSDate>>;
1308
1309        #[cfg(feature = "NSString")]
1310        #[unsafe(method(fileType))]
1311        #[unsafe(method_family = none)]
1312        pub unsafe fn fileType(&self) -> Option<Retained<NSString>>;
1313
1314        #[unsafe(method(filePosixPermissions))]
1315        #[unsafe(method_family = none)]
1316        pub unsafe fn filePosixPermissions(&self) -> NSUInteger;
1317
1318        #[cfg(feature = "NSString")]
1319        #[unsafe(method(fileOwnerAccountName))]
1320        #[unsafe(method_family = none)]
1321        pub unsafe fn fileOwnerAccountName(&self) -> Option<Retained<NSString>>;
1322
1323        #[cfg(feature = "NSString")]
1324        #[unsafe(method(fileGroupOwnerAccountName))]
1325        #[unsafe(method_family = none)]
1326        pub unsafe fn fileGroupOwnerAccountName(&self) -> Option<Retained<NSString>>;
1327
1328        #[unsafe(method(fileSystemNumber))]
1329        #[unsafe(method_family = none)]
1330        pub unsafe fn fileSystemNumber(&self) -> NSInteger;
1331
1332        #[unsafe(method(fileSystemFileNumber))]
1333        #[unsafe(method_family = none)]
1334        pub unsafe fn fileSystemFileNumber(&self) -> NSUInteger;
1335
1336        #[unsafe(method(fileExtensionHidden))]
1337        #[unsafe(method_family = none)]
1338        pub unsafe fn fileExtensionHidden(&self) -> bool;
1339
1340        #[unsafe(method(fileHFSCreatorCode))]
1341        #[unsafe(method_family = none)]
1342        pub unsafe fn fileHFSCreatorCode(&self) -> OSType;
1343
1344        #[unsafe(method(fileHFSTypeCode))]
1345        #[unsafe(method_family = none)]
1346        pub unsafe fn fileHFSTypeCode(&self) -> OSType;
1347
1348        #[unsafe(method(fileIsImmutable))]
1349        #[unsafe(method_family = none)]
1350        pub unsafe fn fileIsImmutable(&self) -> bool;
1351
1352        #[unsafe(method(fileIsAppendOnly))]
1353        #[unsafe(method_family = none)]
1354        pub unsafe fn fileIsAppendOnly(&self) -> bool;
1355
1356        #[cfg(feature = "NSDate")]
1357        #[unsafe(method(fileCreationDate))]
1358        #[unsafe(method_family = none)]
1359        pub unsafe fn fileCreationDate(&self) -> Option<Retained<NSDate>>;
1360
1361        #[cfg(feature = "NSValue")]
1362        #[unsafe(method(fileOwnerAccountID))]
1363        #[unsafe(method_family = none)]
1364        pub unsafe fn fileOwnerAccountID(&self) -> Option<Retained<NSNumber>>;
1365
1366        #[cfg(feature = "NSValue")]
1367        #[unsafe(method(fileGroupOwnerAccountID))]
1368        #[unsafe(method_family = none)]
1369        pub unsafe fn fileGroupOwnerAccountID(&self) -> Option<Retained<NSNumber>>;
1370    );
1371}