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