1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9pub const NSFoundationVersionWithFileManagerResourceForkSupport: c_uint = 412;
11#[cfg(feature = "NSString")]
14pub type NSFileAttributeKey = NSString;
15
16#[cfg(feature = "NSString")]
19pub type NSFileAttributeType = NSString;
20
21#[cfg(feature = "NSString")]
24pub type NSFileProtectionType = NSString;
25
26#[cfg(feature = "NSString")]
29pub type NSFileProviderServiceName = NSString;
30
31#[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#[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#[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#[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#[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 #[cfg(feature = "NSString")]
150 pub static NSFileManagerUnmountDissentingProcessIdentifierErrorKey: &'static NSString;
151}
152
153extern "C" {
154 #[cfg(all(feature = "NSNotification", feature = "NSString"))]
156 pub static NSUbiquityIdentityDidChangeNotification: &'static NSNotificationName;
157}
158
159#[repr(transparent)]
166#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
167pub struct NSFileManagerSupportedSyncControls(pub NSUInteger);
168bitflags::bitflags! {
169 impl NSFileManagerSupportedSyncControls: NSUInteger {
170#[doc(alias = "NSFileManagerSupportedSyncControlsPauseSync")]
172 const PauseSync = 1<<0;
173#[doc(alias = "NSFileManagerSupportedSyncControlsFailUploadOnConflict")]
175 const FailUploadOnConflict = 1<<1;
176 }
177}
178
179unsafe impl Encode for NSFileManagerSupportedSyncControls {
180 const ENCODING: Encoding = NSUInteger::ENCODING;
181}
182
183unsafe impl RefEncode for NSFileManagerSupportedSyncControls {
184 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
185}
186
187#[repr(transparent)]
195#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
196pub struct NSFileManagerResumeSyncBehavior(pub NSInteger);
197impl NSFileManagerResumeSyncBehavior {
198 #[doc(alias = "NSFileManagerResumeSyncBehaviorPreserveLocalChanges")]
203 pub const PreserveLocalChanges: Self = Self(0);
204 #[doc(alias = "NSFileManagerResumeSyncBehaviorAfterUploadWithFailOnConflict")]
215 pub const AfterUploadWithFailOnConflict: Self = Self(1);
216 #[doc(alias = "NSFileManagerResumeSyncBehaviorDropLocalChanges")]
221 pub const DropLocalChanges: Self = Self(2);
222}
223
224unsafe impl Encode for NSFileManagerResumeSyncBehavior {
225 const ENCODING: Encoding = NSInteger::ENCODING;
226}
227
228unsafe impl RefEncode for NSFileManagerResumeSyncBehavior {
229 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
230}
231
232#[repr(transparent)]
237#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
238pub struct NSFileManagerUploadLocalVersionConflictPolicy(pub NSInteger);
239impl NSFileManagerUploadLocalVersionConflictPolicy {
240 #[doc(alias = "NSFileManagerUploadConflictPolicyDefault")]
242 pub const ConflictPolicyDefault: Self = Self(0);
243 #[doc(alias = "NSFileManagerUploadConflictPolicyFailOnConflict")]
251 pub const ConflictPolicyFailOnConflict: Self = Self(1);
252}
253
254unsafe impl Encode for NSFileManagerUploadLocalVersionConflictPolicy {
255 const ENCODING: Encoding = NSInteger::ENCODING;
256}
257
258unsafe impl RefEncode for NSFileManagerUploadLocalVersionConflictPolicy {
259 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
260}
261
262extern_class!(
263 #[unsafe(super(NSObject))]
265 #[derive(Debug, PartialEq, Eq, Hash)]
266 pub struct NSFileManager;
267);
268
269extern_conformance!(
270 unsafe impl NSObjectProtocol for NSFileManager {}
271);
272
273impl NSFileManager {
274 extern_methods!(
275 #[unsafe(method(defaultManager))]
276 #[unsafe(method_family = none)]
277 pub fn defaultManager() -> Retained<NSFileManager>;
278
279 #[cfg(all(feature = "NSArray", feature = "NSString", feature = "NSURL"))]
280 #[unsafe(method(mountedVolumeURLsIncludingResourceValuesForKeys:options:))]
281 #[unsafe(method_family = none)]
282 pub fn mountedVolumeURLsIncludingResourceValuesForKeys_options(
283 &self,
284 property_keys: Option<&NSArray<NSURLResourceKey>>,
285 options: NSVolumeEnumerationOptions,
286 ) -> Option<Retained<NSArray<NSURL>>>;
287
288 #[cfg(all(feature = "NSError", feature = "NSURL", feature = "block2"))]
289 #[unsafe(method(unmountVolumeAtURL:options:completionHandler:))]
293 #[unsafe(method_family = none)]
294 pub unsafe fn unmountVolumeAtURL_options_completionHandler(
295 &self,
296 url: &NSURL,
297 mask: NSFileManagerUnmountOptions,
298 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
299 );
300
301 #[cfg(all(
302 feature = "NSArray",
303 feature = "NSError",
304 feature = "NSString",
305 feature = "NSURL"
306 ))]
307 #[unsafe(method(contentsOfDirectoryAtURL:includingPropertiesForKeys:options:error:_))]
308 #[unsafe(method_family = none)]
309 pub fn contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error(
310 &self,
311 url: &NSURL,
312 keys: Option<&NSArray<NSURLResourceKey>>,
313 mask: NSDirectoryEnumerationOptions,
314 ) -> Result<Retained<NSArray<NSURL>>, Retained<NSError>>;
315
316 #[cfg(all(feature = "NSArray", feature = "NSPathUtilities", feature = "NSURL"))]
317 #[unsafe(method(URLsForDirectory:inDomains:))]
318 #[unsafe(method_family = none)]
319 pub fn URLsForDirectory_inDomains(
320 &self,
321 directory: NSSearchPathDirectory,
322 domain_mask: NSSearchPathDomainMask,
323 ) -> Retained<NSArray<NSURL>>;
324
325 #[cfg(all(feature = "NSError", feature = "NSPathUtilities", feature = "NSURL"))]
326 #[unsafe(method(URLForDirectory:inDomain:appropriateForURL:create:error:_))]
327 #[unsafe(method_family = none)]
328 pub fn URLForDirectory_inDomain_appropriateForURL_create_error(
329 &self,
330 directory: NSSearchPathDirectory,
331 domain: NSSearchPathDomainMask,
332 url: Option<&NSURL>,
333 should_create: bool,
334 ) -> Result<Retained<NSURL>, Retained<NSError>>;
335
336 #[cfg(all(feature = "NSError", feature = "NSURL"))]
337 #[unsafe(method(getRelationship:ofDirectoryAtURL:toItemAtURL:error:_))]
341 #[unsafe(method_family = none)]
342 pub unsafe fn getRelationship_ofDirectoryAtURL_toItemAtURL_error(
343 &self,
344 out_relationship: NonNull<NSURLRelationship>,
345 directory_url: &NSURL,
346 other_url: &NSURL,
347 ) -> Result<(), Retained<NSError>>;
348
349 #[cfg(all(feature = "NSError", feature = "NSPathUtilities", feature = "NSURL"))]
350 #[unsafe(method(getRelationship:ofDirectory:inDomain:toItemAtURL:error:_))]
354 #[unsafe(method_family = none)]
355 pub unsafe fn getRelationship_ofDirectory_inDomain_toItemAtURL_error(
356 &self,
357 out_relationship: NonNull<NSURLRelationship>,
358 directory: NSSearchPathDirectory,
359 domain_mask: NSSearchPathDomainMask,
360 url: &NSURL,
361 ) -> Result<(), Retained<NSError>>;
362
363 #[cfg(all(
364 feature = "NSDictionary",
365 feature = "NSError",
366 feature = "NSString",
367 feature = "NSURL"
368 ))]
369 #[unsafe(method(createDirectoryAtURL:withIntermediateDirectories:attributes:error:_))]
373 #[unsafe(method_family = none)]
374 pub unsafe fn createDirectoryAtURL_withIntermediateDirectories_attributes_error(
375 &self,
376 url: &NSURL,
377 create_intermediates: bool,
378 attributes: Option<&NSDictionary<NSFileAttributeKey, AnyObject>>,
379 ) -> Result<(), Retained<NSError>>;
380
381 #[cfg(all(feature = "NSError", feature = "NSURL"))]
382 #[unsafe(method(createSymbolicLinkAtURL:withDestinationURL:error:_))]
383 #[unsafe(method_family = none)]
384 pub fn createSymbolicLinkAtURL_withDestinationURL_error(
385 &self,
386 url: &NSURL,
387 dest_url: &NSURL,
388 ) -> Result<(), Retained<NSError>>;
389
390 #[unsafe(method(delegate))]
394 #[unsafe(method_family = none)]
395 pub unsafe fn delegate(
396 &self,
397 ) -> Option<Retained<ProtocolObject<dyn NSFileManagerDelegate>>>;
398
399 #[unsafe(method(setDelegate:))]
405 #[unsafe(method_family = none)]
406 pub unsafe fn setDelegate(
407 &self,
408 delegate: Option<&ProtocolObject<dyn NSFileManagerDelegate>>,
409 );
410
411 #[cfg(all(feature = "NSDictionary", feature = "NSError", feature = "NSString"))]
412 #[unsafe(method(setAttributes:ofItemAtPath:error:_))]
416 #[unsafe(method_family = none)]
417 pub unsafe fn setAttributes_ofItemAtPath_error(
418 &self,
419 attributes: &NSDictionary<NSFileAttributeKey, AnyObject>,
420 path: &NSString,
421 ) -> Result<(), Retained<NSError>>;
422
423 #[cfg(all(feature = "NSDictionary", feature = "NSError", feature = "NSString"))]
424 #[unsafe(method(createDirectoryAtPath:withIntermediateDirectories:attributes:error:_))]
428 #[unsafe(method_family = none)]
429 pub unsafe fn createDirectoryAtPath_withIntermediateDirectories_attributes_error(
430 &self,
431 path: &NSString,
432 create_intermediates: bool,
433 attributes: Option<&NSDictionary<NSFileAttributeKey, AnyObject>>,
434 ) -> Result<(), Retained<NSError>>;
435
436 #[cfg(all(feature = "NSArray", feature = "NSError", feature = "NSString"))]
437 #[unsafe(method(contentsOfDirectoryAtPath:error:_))]
438 #[unsafe(method_family = none)]
439 pub fn contentsOfDirectoryAtPath_error(
440 &self,
441 path: &NSString,
442 ) -> Result<Retained<NSArray<NSString>>, Retained<NSError>>;
443
444 #[cfg(all(feature = "NSArray", feature = "NSError", feature = "NSString"))]
445 #[unsafe(method(subpathsOfDirectoryAtPath:error:_))]
446 #[unsafe(method_family = none)]
447 pub fn subpathsOfDirectoryAtPath_error(
448 &self,
449 path: &NSString,
450 ) -> Result<Retained<NSArray<NSString>>, Retained<NSError>>;
451
452 #[cfg(all(feature = "NSDictionary", feature = "NSError", feature = "NSString"))]
453 #[unsafe(method(attributesOfItemAtPath:error:_))]
454 #[unsafe(method_family = none)]
455 pub fn attributesOfItemAtPath_error(
456 &self,
457 path: &NSString,
458 ) -> Result<Retained<NSDictionary<NSFileAttributeKey, AnyObject>>, Retained<NSError>>;
459
460 #[cfg(all(feature = "NSDictionary", feature = "NSError", feature = "NSString"))]
461 #[unsafe(method(attributesOfFileSystemForPath:error:_))]
462 #[unsafe(method_family = none)]
463 pub fn attributesOfFileSystemForPath_error(
464 &self,
465 path: &NSString,
466 ) -> Result<Retained<NSDictionary<NSFileAttributeKey, AnyObject>>, Retained<NSError>>;
467
468 #[cfg(all(feature = "NSError", feature = "NSString"))]
469 #[unsafe(method(createSymbolicLinkAtPath:withDestinationPath:error:_))]
470 #[unsafe(method_family = none)]
471 pub fn createSymbolicLinkAtPath_withDestinationPath_error(
472 &self,
473 path: &NSString,
474 dest_path: &NSString,
475 ) -> Result<(), Retained<NSError>>;
476
477 #[cfg(all(feature = "NSError", feature = "NSString"))]
478 #[unsafe(method(destinationOfSymbolicLinkAtPath:error:_))]
479 #[unsafe(method_family = none)]
480 pub fn destinationOfSymbolicLinkAtPath_error(
481 &self,
482 path: &NSString,
483 ) -> Result<Retained<NSString>, Retained<NSError>>;
484
485 #[cfg(all(feature = "NSError", feature = "NSString"))]
486 #[unsafe(method(copyItemAtPath:toPath:error:_))]
487 #[unsafe(method_family = none)]
488 pub fn copyItemAtPath_toPath_error(
489 &self,
490 src_path: &NSString,
491 dst_path: &NSString,
492 ) -> Result<(), Retained<NSError>>;
493
494 #[cfg(all(feature = "NSError", feature = "NSString"))]
495 #[unsafe(method(moveItemAtPath:toPath:error:_))]
496 #[unsafe(method_family = none)]
497 pub fn moveItemAtPath_toPath_error(
498 &self,
499 src_path: &NSString,
500 dst_path: &NSString,
501 ) -> Result<(), Retained<NSError>>;
502
503 #[cfg(all(feature = "NSError", feature = "NSString"))]
504 #[unsafe(method(linkItemAtPath:toPath:error:_))]
505 #[unsafe(method_family = none)]
506 pub fn linkItemAtPath_toPath_error(
507 &self,
508 src_path: &NSString,
509 dst_path: &NSString,
510 ) -> Result<(), Retained<NSError>>;
511
512 #[cfg(all(feature = "NSError", feature = "NSString"))]
513 #[unsafe(method(removeItemAtPath:error:_))]
514 #[unsafe(method_family = none)]
515 pub fn removeItemAtPath_error(&self, path: &NSString) -> Result<(), Retained<NSError>>;
516
517 #[cfg(all(feature = "NSError", feature = "NSURL"))]
518 #[unsafe(method(copyItemAtURL:toURL:error:_))]
519 #[unsafe(method_family = none)]
520 pub fn copyItemAtURL_toURL_error(
521 &self,
522 src_url: &NSURL,
523 dst_url: &NSURL,
524 ) -> Result<(), Retained<NSError>>;
525
526 #[cfg(all(feature = "NSError", feature = "NSURL"))]
527 #[unsafe(method(moveItemAtURL:toURL:error:_))]
528 #[unsafe(method_family = none)]
529 pub fn moveItemAtURL_toURL_error(
530 &self,
531 src_url: &NSURL,
532 dst_url: &NSURL,
533 ) -> Result<(), Retained<NSError>>;
534
535 #[cfg(all(feature = "NSError", feature = "NSURL"))]
536 #[unsafe(method(linkItemAtURL:toURL:error:_))]
537 #[unsafe(method_family = none)]
538 pub fn linkItemAtURL_toURL_error(
539 &self,
540 src_url: &NSURL,
541 dst_url: &NSURL,
542 ) -> Result<(), Retained<NSError>>;
543
544 #[cfg(all(feature = "NSError", feature = "NSURL"))]
545 #[unsafe(method(removeItemAtURL:error:_))]
546 #[unsafe(method_family = none)]
547 pub fn removeItemAtURL_error(&self, url: &NSURL) -> Result<(), Retained<NSError>>;
548
549 #[cfg(all(feature = "NSError", feature = "NSURL"))]
550 #[unsafe(method(trashItemAtURL:resultingItemURL:error:_))]
551 #[unsafe(method_family = none)]
552 pub fn trashItemAtURL_resultingItemURL_error(
553 &self,
554 url: &NSURL,
555 out_resulting_url: Option<&mut Option<Retained<NSURL>>>,
556 ) -> Result<(), Retained<NSError>>;
557
558 #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
559 #[deprecated = "Use -attributesOfItemAtPath:error: instead"]
560 #[unsafe(method(fileAttributesAtPath:traverseLink:))]
561 #[unsafe(method_family = none)]
562 pub fn fileAttributesAtPath_traverseLink(
563 &self,
564 path: &NSString,
565 yorn: bool,
566 ) -> Option<Retained<NSDictionary>>;
567
568 #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
569 #[deprecated = "Use -setAttributes:ofItemAtPath:error: instead"]
573 #[unsafe(method(changeFileAttributes:atPath:))]
574 #[unsafe(method_family = none)]
575 pub unsafe fn changeFileAttributes_atPath(
576 &self,
577 attributes: &NSDictionary,
578 path: &NSString,
579 ) -> bool;
580
581 #[cfg(all(feature = "NSArray", feature = "NSString"))]
582 #[deprecated = "Use -contentsOfDirectoryAtPath:error: instead"]
583 #[unsafe(method(directoryContentsAtPath:))]
584 #[unsafe(method_family = none)]
585 pub fn directoryContentsAtPath(&self, path: &NSString) -> Option<Retained<NSArray>>;
586
587 #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
588 #[deprecated = "Use -attributesOfFileSystemForPath:error: instead"]
589 #[unsafe(method(fileSystemAttributesAtPath:))]
590 #[unsafe(method_family = none)]
591 pub fn fileSystemAttributesAtPath(&self, path: &NSString)
592 -> Option<Retained<NSDictionary>>;
593
594 #[cfg(feature = "NSString")]
595 #[deprecated = "Use -destinationOfSymbolicLinkAtPath:error:"]
596 #[unsafe(method(pathContentOfSymbolicLinkAtPath:))]
597 #[unsafe(method_family = none)]
598 pub fn pathContentOfSymbolicLinkAtPath(
599 &self,
600 path: &NSString,
601 ) -> Option<Retained<NSString>>;
602
603 #[cfg(feature = "NSString")]
604 #[deprecated = "Use -createSymbolicLinkAtPath:error: instead"]
605 #[unsafe(method(createSymbolicLinkAtPath:pathContent:))]
606 #[unsafe(method_family = none)]
607 pub fn createSymbolicLinkAtPath_pathContent(
608 &self,
609 path: &NSString,
610 otherpath: &NSString,
611 ) -> bool;
612
613 #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
614 #[deprecated = "Use -createDirectoryAtPath:withIntermediateDirectories:attributes:error: instead"]
618 #[unsafe(method(createDirectoryAtPath:attributes:))]
619 #[unsafe(method_family = none)]
620 pub unsafe fn createDirectoryAtPath_attributes(
621 &self,
622 path: &NSString,
623 attributes: &NSDictionary,
624 ) -> bool;
625
626 #[cfg(feature = "NSString")]
627 #[deprecated = "Not supported"]
631 #[unsafe(method(linkPath:toPath:handler:))]
632 #[unsafe(method_family = none)]
633 pub unsafe fn linkPath_toPath_handler(
634 &self,
635 src: &NSString,
636 dest: &NSString,
637 handler: Option<&AnyObject>,
638 ) -> bool;
639
640 #[cfg(feature = "NSString")]
641 #[deprecated = "Not supported"]
645 #[unsafe(method(copyPath:toPath:handler:))]
646 #[unsafe(method_family = none)]
647 pub unsafe fn copyPath_toPath_handler(
648 &self,
649 src: &NSString,
650 dest: &NSString,
651 handler: Option<&AnyObject>,
652 ) -> bool;
653
654 #[cfg(feature = "NSString")]
655 #[deprecated = "Not supported"]
659 #[unsafe(method(movePath:toPath:handler:))]
660 #[unsafe(method_family = none)]
661 pub unsafe fn movePath_toPath_handler(
662 &self,
663 src: &NSString,
664 dest: &NSString,
665 handler: Option<&AnyObject>,
666 ) -> bool;
667
668 #[cfg(feature = "NSString")]
669 #[deprecated = "Not supported"]
673 #[unsafe(method(removeFileAtPath:handler:))]
674 #[unsafe(method_family = none)]
675 pub unsafe fn removeFileAtPath_handler(
676 &self,
677 path: &NSString,
678 handler: Option<&AnyObject>,
679 ) -> bool;
680
681 #[cfg(feature = "NSString")]
682 #[unsafe(method(currentDirectoryPath))]
683 #[unsafe(method_family = none)]
684 pub fn currentDirectoryPath(&self) -> Retained<NSString>;
685
686 #[cfg(feature = "NSString")]
687 #[unsafe(method(changeCurrentDirectoryPath:))]
688 #[unsafe(method_family = none)]
689 pub fn changeCurrentDirectoryPath(&self, path: &NSString) -> bool;
690
691 #[cfg(feature = "NSString")]
692 #[unsafe(method(fileExistsAtPath:))]
693 #[unsafe(method_family = none)]
694 pub fn fileExistsAtPath(&self, path: &NSString) -> bool;
695
696 #[cfg(feature = "NSString")]
697 #[unsafe(method(fileExistsAtPath:isDirectory:))]
701 #[unsafe(method_family = none)]
702 pub unsafe fn fileExistsAtPath_isDirectory(
703 &self,
704 path: &NSString,
705 is_directory: *mut Bool,
706 ) -> bool;
707
708 #[cfg(feature = "NSString")]
709 #[unsafe(method(isReadableFileAtPath:))]
710 #[unsafe(method_family = none)]
711 pub fn isReadableFileAtPath(&self, path: &NSString) -> bool;
712
713 #[cfg(feature = "NSString")]
714 #[unsafe(method(isWritableFileAtPath:))]
715 #[unsafe(method_family = none)]
716 pub fn isWritableFileAtPath(&self, path: &NSString) -> bool;
717
718 #[cfg(feature = "NSString")]
719 #[unsafe(method(isExecutableFileAtPath:))]
720 #[unsafe(method_family = none)]
721 pub fn isExecutableFileAtPath(&self, path: &NSString) -> bool;
722
723 #[cfg(feature = "NSString")]
724 #[unsafe(method(isDeletableFileAtPath:))]
725 #[unsafe(method_family = none)]
726 pub fn isDeletableFileAtPath(&self, path: &NSString) -> bool;
727
728 #[cfg(feature = "NSString")]
729 #[unsafe(method(contentsEqualAtPath:andPath:))]
730 #[unsafe(method_family = none)]
731 pub fn contentsEqualAtPath_andPath(&self, path1: &NSString, path2: &NSString) -> bool;
732
733 #[cfg(feature = "NSString")]
734 #[unsafe(method(displayNameAtPath:))]
735 #[unsafe(method_family = none)]
736 pub fn displayNameAtPath(&self, path: &NSString) -> Retained<NSString>;
737
738 #[cfg(all(feature = "NSArray", feature = "NSString"))]
739 #[unsafe(method(componentsToDisplayForPath:))]
740 #[unsafe(method_family = none)]
741 pub fn componentsToDisplayForPath(
742 &self,
743 path: &NSString,
744 ) -> Option<Retained<NSArray<NSString>>>;
745
746 #[cfg(all(feature = "NSEnumerator", feature = "NSString"))]
747 #[unsafe(method(enumeratorAtPath:))]
748 #[unsafe(method_family = none)]
749 pub fn enumeratorAtPath(
750 &self,
751 path: &NSString,
752 ) -> Option<Retained<NSDirectoryEnumerator<NSString>>>;
753
754 #[cfg(all(
755 feature = "NSArray",
756 feature = "NSEnumerator",
757 feature = "NSError",
758 feature = "NSString",
759 feature = "NSURL",
760 feature = "block2"
761 ))]
762 #[unsafe(method(enumeratorAtURL:includingPropertiesForKeys:options:errorHandler:))]
763 #[unsafe(method_family = none)]
764 pub fn enumeratorAtURL_includingPropertiesForKeys_options_errorHandler(
765 &self,
766 url: &NSURL,
767 keys: Option<&NSArray<NSURLResourceKey>>,
768 mask: NSDirectoryEnumerationOptions,
769 handler: Option<&block2::DynBlock<dyn Fn(NonNull<NSURL>, NonNull<NSError>) -> Bool>>,
770 ) -> Option<Retained<NSDirectoryEnumerator<NSURL>>>;
771
772 #[cfg(all(feature = "NSArray", feature = "NSString"))]
773 #[unsafe(method(subpathsAtPath:))]
774 #[unsafe(method_family = none)]
775 pub fn subpathsAtPath(&self, path: &NSString) -> Option<Retained<NSArray<NSString>>>;
776
777 #[cfg(all(feature = "NSData", feature = "NSString"))]
778 #[unsafe(method(contentsAtPath:))]
779 #[unsafe(method_family = none)]
780 pub fn contentsAtPath(&self, path: &NSString) -> Option<Retained<NSData>>;
781
782 #[cfg(all(feature = "NSData", feature = "NSDictionary", feature = "NSString"))]
783 #[unsafe(method(createFileAtPath:contents:attributes:))]
787 #[unsafe(method_family = none)]
788 pub unsafe fn createFileAtPath_contents_attributes(
789 &self,
790 path: &NSString,
791 data: Option<&NSData>,
792 attr: Option<&NSDictionary<NSFileAttributeKey, AnyObject>>,
793 ) -> bool;
794
795 #[cfg(feature = "NSString")]
796 #[unsafe(method(fileSystemRepresentationWithPath:))]
797 #[unsafe(method_family = none)]
798 pub fn fileSystemRepresentationWithPath(&self, path: &NSString) -> NonNull<c_char>;
799
800 #[cfg(feature = "NSString")]
801 #[unsafe(method(stringWithFileSystemRepresentation:length:))]
805 #[unsafe(method_family = none)]
806 pub unsafe fn stringWithFileSystemRepresentation_length(
807 &self,
808 str: NonNull<c_char>,
809 len: NSUInteger,
810 ) -> Retained<NSString>;
811
812 #[cfg(all(feature = "NSError", feature = "NSString", feature = "NSURL"))]
813 #[unsafe(method(replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error:_))]
814 #[unsafe(method_family = none)]
815 pub fn replaceItemAtURL_withItemAtURL_backupItemName_options_resultingItemURL_error(
816 &self,
817 original_item_url: &NSURL,
818 new_item_url: &NSURL,
819 backup_item_name: Option<&NSString>,
820 options: NSFileManagerItemReplacementOptions,
821 resulting_url: Option<&mut Option<Retained<NSURL>>>,
822 ) -> Result<(), Retained<NSError>>;
823
824 #[cfg(all(feature = "NSError", feature = "NSURL"))]
825 #[unsafe(method(setUbiquitous:itemAtURL:destinationURL:error:_))]
826 #[unsafe(method_family = none)]
827 pub fn setUbiquitous_itemAtURL_destinationURL_error(
828 &self,
829 flag: bool,
830 url: &NSURL,
831 destination_url: &NSURL,
832 ) -> Result<(), Retained<NSError>>;
833
834 #[cfg(feature = "NSURL")]
835 #[unsafe(method(isUbiquitousItemAtURL:))]
836 #[unsafe(method_family = none)]
837 pub fn isUbiquitousItemAtURL(&self, url: &NSURL) -> bool;
838
839 #[cfg(all(feature = "NSError", feature = "NSURL"))]
840 #[unsafe(method(startDownloadingUbiquitousItemAtURL:error:_))]
841 #[unsafe(method_family = none)]
842 pub fn startDownloadingUbiquitousItemAtURL_error(
843 &self,
844 url: &NSURL,
845 ) -> Result<(), Retained<NSError>>;
846
847 #[cfg(all(feature = "NSError", feature = "NSURL"))]
848 #[unsafe(method(evictUbiquitousItemAtURL:error:_))]
849 #[unsafe(method_family = none)]
850 pub fn evictUbiquitousItemAtURL_error(&self, url: &NSURL) -> Result<(), Retained<NSError>>;
851
852 #[cfg(all(feature = "NSString", feature = "NSURL"))]
853 #[unsafe(method(URLForUbiquityContainerIdentifier:))]
854 #[unsafe(method_family = none)]
855 pub fn URLForUbiquityContainerIdentifier(
856 &self,
857 container_identifier: Option<&NSString>,
858 ) -> Option<Retained<NSURL>>;
859
860 #[cfg(all(feature = "NSDate", feature = "NSError", feature = "NSURL"))]
861 #[unsafe(method(URLForPublishingUbiquitousItemAtURL:expirationDate:error:_))]
862 #[unsafe(method_family = none)]
863 pub fn URLForPublishingUbiquitousItemAtURL_expirationDate_error(
864 &self,
865 url: &NSURL,
866 out_date: Option<&mut Option<Retained<NSDate>>>,
867 ) -> Result<Retained<NSURL>, Retained<NSError>>;
868
869 #[cfg(feature = "NSObject")]
870 #[unsafe(method(ubiquityIdentityToken))]
871 #[unsafe(method_family = none)]
872 pub fn ubiquityIdentityToken(
873 &self,
874 ) -> Option<Retained<AnyObject >>;
875
876 #[cfg(all(feature = "NSError", feature = "NSURL", feature = "block2"))]
877 #[unsafe(method(pauseSyncForUbiquitousItemAtURL:completionHandler:))]
902 #[unsafe(method_family = none)]
903 pub unsafe fn pauseSyncForUbiquitousItemAtURL_completionHandler(
904 &self,
905 url: &NSURL,
906 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
907 );
908
909 #[cfg(all(feature = "NSError", feature = "NSURL", feature = "block2"))]
910 #[unsafe(method(resumeSyncForUbiquitousItemAtURL:withBehavior:completionHandler:))]
930 #[unsafe(method_family = none)]
931 pub unsafe fn resumeSyncForUbiquitousItemAtURL_withBehavior_completionHandler(
932 &self,
933 url: &NSURL,
934 behavior: NSFileManagerResumeSyncBehavior,
935 completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
936 );
937
938 #[cfg(all(
939 feature = "NSError",
940 feature = "NSFileVersion",
941 feature = "NSURL",
942 feature = "block2"
943 ))]
944 #[unsafe(method(fetchLatestRemoteVersionOfItemAtURL:completionHandler:))]
966 #[unsafe(method_family = none)]
967 pub unsafe fn fetchLatestRemoteVersionOfItemAtURL_completionHandler(
968 &self,
969 url: &NSURL,
970 completion_handler: &block2::DynBlock<dyn Fn(*mut NSFileVersion, *mut NSError)>,
971 );
972
973 #[cfg(all(
974 feature = "NSError",
975 feature = "NSFileVersion",
976 feature = "NSURL",
977 feature = "block2"
978 ))]
979 #[unsafe(method(uploadLocalVersionOfUbiquitousItemAtURL:withConflictResolutionPolicy:completionHandler:))]
1002 #[unsafe(method_family = none)]
1003 pub unsafe fn uploadLocalVersionOfUbiquitousItemAtURL_withConflictResolutionPolicy_completionHandler(
1004 &self,
1005 url: &NSURL,
1006 conflict_resolution_policy: NSFileManagerUploadLocalVersionConflictPolicy,
1007 completion_handler: &block2::DynBlock<dyn Fn(*mut NSFileVersion, *mut NSError)>,
1008 );
1009
1010 #[cfg(all(
1011 feature = "NSDictionary",
1012 feature = "NSError",
1013 feature = "NSString",
1014 feature = "NSURL",
1015 feature = "block2"
1016 ))]
1017 #[unsafe(method(getFileProviderServicesForItemAtURL:completionHandler:))]
1021 #[unsafe(method_family = none)]
1022 pub unsafe fn getFileProviderServicesForItemAtURL_completionHandler(
1023 &self,
1024 url: &NSURL,
1025 completion_handler: &block2::DynBlock<
1026 dyn Fn(
1027 *mut NSDictionary<NSFileProviderServiceName, NSFileProviderService>,
1028 *mut NSError,
1029 ),
1030 >,
1031 );
1032
1033 #[cfg(all(feature = "NSString", feature = "NSURL"))]
1034 #[unsafe(method(containerURLForSecurityApplicationGroupIdentifier:))]
1035 #[unsafe(method_family = none)]
1036 pub fn containerURLForSecurityApplicationGroupIdentifier(
1037 &self,
1038 group_identifier: &NSString,
1039 ) -> Option<Retained<NSURL>>;
1040 );
1041}
1042
1043impl NSFileManager {
1045 extern_methods!(
1046 #[unsafe(method(init))]
1047 #[unsafe(method_family = init)]
1048 pub fn init(this: Allocated<Self>) -> Retained<Self>;
1049
1050 #[unsafe(method(new))]
1051 #[unsafe(method_family = new)]
1052 pub fn new() -> Retained<Self>;
1053 );
1054}
1055
1056impl DefaultRetained for NSFileManager {
1057 #[inline]
1058 fn default_retained() -> Retained<Self> {
1059 Self::new()
1060 }
1061}
1062
1063impl NSFileManager {
1065 extern_methods!(
1066 #[cfg(feature = "NSURL")]
1067 #[unsafe(method(homeDirectoryForCurrentUser))]
1068 #[unsafe(method_family = none)]
1069 pub fn homeDirectoryForCurrentUser(&self) -> Retained<NSURL>;
1070
1071 #[cfg(feature = "NSURL")]
1072 #[unsafe(method(temporaryDirectory))]
1073 #[unsafe(method_family = none)]
1074 pub fn temporaryDirectory(&self) -> Retained<NSURL>;
1075
1076 #[cfg(all(feature = "NSString", feature = "NSURL"))]
1077 #[unsafe(method(homeDirectoryForUser:))]
1078 #[unsafe(method_family = none)]
1079 pub fn homeDirectoryForUser(&self, user_name: &NSString) -> Option<Retained<NSURL>>;
1080 );
1081}
1082
1083extern_protocol!(
1084 pub unsafe trait NSFileManagerDelegate: NSObjectProtocol {
1086 #[cfg(feature = "NSString")]
1087 #[optional]
1088 #[unsafe(method(fileManager:shouldCopyItemAtPath:toPath:))]
1089 #[unsafe(method_family = none)]
1090 fn fileManager_shouldCopyItemAtPath_toPath(
1091 &self,
1092 file_manager: &NSFileManager,
1093 src_path: &NSString,
1094 dst_path: &NSString,
1095 ) -> bool;
1096
1097 #[cfg(feature = "NSURL")]
1098 #[optional]
1099 #[unsafe(method(fileManager:shouldCopyItemAtURL:toURL:))]
1100 #[unsafe(method_family = none)]
1101 fn fileManager_shouldCopyItemAtURL_toURL(
1102 &self,
1103 file_manager: &NSFileManager,
1104 src_url: &NSURL,
1105 dst_url: &NSURL,
1106 ) -> bool;
1107
1108 #[cfg(all(feature = "NSError", feature = "NSString"))]
1109 #[optional]
1110 #[unsafe(method(fileManager:shouldProceedAfterError:copyingItemAtPath:toPath:))]
1111 #[unsafe(method_family = none)]
1112 fn fileManager_shouldProceedAfterError_copyingItemAtPath_toPath(
1113 &self,
1114 file_manager: &NSFileManager,
1115 error: &NSError,
1116 src_path: &NSString,
1117 dst_path: &NSString,
1118 ) -> bool;
1119
1120 #[cfg(all(feature = "NSError", feature = "NSURL"))]
1121 #[optional]
1122 #[unsafe(method(fileManager:shouldProceedAfterError:copyingItemAtURL:toURL:))]
1123 #[unsafe(method_family = none)]
1124 fn fileManager_shouldProceedAfterError_copyingItemAtURL_toURL(
1125 &self,
1126 file_manager: &NSFileManager,
1127 error: &NSError,
1128 src_url: &NSURL,
1129 dst_url: &NSURL,
1130 ) -> bool;
1131
1132 #[cfg(feature = "NSString")]
1133 #[optional]
1134 #[unsafe(method(fileManager:shouldMoveItemAtPath:toPath:))]
1135 #[unsafe(method_family = none)]
1136 fn fileManager_shouldMoveItemAtPath_toPath(
1137 &self,
1138 file_manager: &NSFileManager,
1139 src_path: &NSString,
1140 dst_path: &NSString,
1141 ) -> bool;
1142
1143 #[cfg(feature = "NSURL")]
1144 #[optional]
1145 #[unsafe(method(fileManager:shouldMoveItemAtURL:toURL:))]
1146 #[unsafe(method_family = none)]
1147 fn fileManager_shouldMoveItemAtURL_toURL(
1148 &self,
1149 file_manager: &NSFileManager,
1150 src_url: &NSURL,
1151 dst_url: &NSURL,
1152 ) -> bool;
1153
1154 #[cfg(all(feature = "NSError", feature = "NSString"))]
1155 #[optional]
1156 #[unsafe(method(fileManager:shouldProceedAfterError:movingItemAtPath:toPath:))]
1157 #[unsafe(method_family = none)]
1158 fn fileManager_shouldProceedAfterError_movingItemAtPath_toPath(
1159 &self,
1160 file_manager: &NSFileManager,
1161 error: &NSError,
1162 src_path: &NSString,
1163 dst_path: &NSString,
1164 ) -> bool;
1165
1166 #[cfg(all(feature = "NSError", feature = "NSURL"))]
1167 #[optional]
1168 #[unsafe(method(fileManager:shouldProceedAfterError:movingItemAtURL:toURL:))]
1169 #[unsafe(method_family = none)]
1170 fn fileManager_shouldProceedAfterError_movingItemAtURL_toURL(
1171 &self,
1172 file_manager: &NSFileManager,
1173 error: &NSError,
1174 src_url: &NSURL,
1175 dst_url: &NSURL,
1176 ) -> bool;
1177
1178 #[cfg(feature = "NSString")]
1179 #[optional]
1180 #[unsafe(method(fileManager:shouldLinkItemAtPath:toPath:))]
1181 #[unsafe(method_family = none)]
1182 fn fileManager_shouldLinkItemAtPath_toPath(
1183 &self,
1184 file_manager: &NSFileManager,
1185 src_path: &NSString,
1186 dst_path: &NSString,
1187 ) -> bool;
1188
1189 #[cfg(feature = "NSURL")]
1190 #[optional]
1191 #[unsafe(method(fileManager:shouldLinkItemAtURL:toURL:))]
1192 #[unsafe(method_family = none)]
1193 fn fileManager_shouldLinkItemAtURL_toURL(
1194 &self,
1195 file_manager: &NSFileManager,
1196 src_url: &NSURL,
1197 dst_url: &NSURL,
1198 ) -> bool;
1199
1200 #[cfg(all(feature = "NSError", feature = "NSString"))]
1201 #[optional]
1202 #[unsafe(method(fileManager:shouldProceedAfterError:linkingItemAtPath:toPath:))]
1203 #[unsafe(method_family = none)]
1204 fn fileManager_shouldProceedAfterError_linkingItemAtPath_toPath(
1205 &self,
1206 file_manager: &NSFileManager,
1207 error: &NSError,
1208 src_path: &NSString,
1209 dst_path: &NSString,
1210 ) -> bool;
1211
1212 #[cfg(all(feature = "NSError", feature = "NSURL"))]
1213 #[optional]
1214 #[unsafe(method(fileManager:shouldProceedAfterError:linkingItemAtURL:toURL:))]
1215 #[unsafe(method_family = none)]
1216 fn fileManager_shouldProceedAfterError_linkingItemAtURL_toURL(
1217 &self,
1218 file_manager: &NSFileManager,
1219 error: &NSError,
1220 src_url: &NSURL,
1221 dst_url: &NSURL,
1222 ) -> bool;
1223
1224 #[cfg(feature = "NSString")]
1225 #[optional]
1226 #[unsafe(method(fileManager:shouldRemoveItemAtPath:))]
1227 #[unsafe(method_family = none)]
1228 fn fileManager_shouldRemoveItemAtPath(
1229 &self,
1230 file_manager: &NSFileManager,
1231 path: &NSString,
1232 ) -> bool;
1233
1234 #[cfg(feature = "NSURL")]
1235 #[optional]
1236 #[unsafe(method(fileManager:shouldRemoveItemAtURL:))]
1237 #[unsafe(method_family = none)]
1238 fn fileManager_shouldRemoveItemAtURL(
1239 &self,
1240 file_manager: &NSFileManager,
1241 url: &NSURL,
1242 ) -> bool;
1243
1244 #[cfg(all(feature = "NSError", feature = "NSString"))]
1245 #[optional]
1246 #[unsafe(method(fileManager:shouldProceedAfterError:removingItemAtPath:))]
1247 #[unsafe(method_family = none)]
1248 fn fileManager_shouldProceedAfterError_removingItemAtPath(
1249 &self,
1250 file_manager: &NSFileManager,
1251 error: &NSError,
1252 path: &NSString,
1253 ) -> bool;
1254
1255 #[cfg(all(feature = "NSError", feature = "NSURL"))]
1256 #[optional]
1257 #[unsafe(method(fileManager:shouldProceedAfterError:removingItemAtURL:))]
1258 #[unsafe(method_family = none)]
1259 fn fileManager_shouldProceedAfterError_removingItemAtURL(
1260 &self,
1261 file_manager: &NSFileManager,
1262 error: &NSError,
1263 url: &NSURL,
1264 ) -> bool;
1265 }
1266);
1267
1268extern_class!(
1269 #[unsafe(super(NSEnumerator<ObjectType>, NSObject))]
1271 #[derive(Debug, PartialEq, Eq, Hash)]
1272 #[cfg(feature = "NSEnumerator")]
1273 pub struct NSDirectoryEnumerator<ObjectType: ?Sized = AnyObject>;
1274);
1275
1276#[cfg(feature = "NSEnumerator")]
1277impl<ObjectType: ?Sized + Message> NSDirectoryEnumerator<ObjectType> {
1278 #[inline]
1284 pub unsafe fn cast_unchecked<NewObjectType: ?Sized + Message>(
1285 &self,
1286 ) -> &NSDirectoryEnumerator<NewObjectType> {
1287 unsafe { &*((self as *const Self).cast()) }
1288 }
1289}
1290
1291#[cfg(feature = "NSEnumerator")]
1292extern_conformance!(
1293 unsafe impl<ObjectType: ?Sized> NSFastEnumeration for NSDirectoryEnumerator<ObjectType> {}
1294);
1295
1296#[cfg(feature = "NSEnumerator")]
1297extern_conformance!(
1298 unsafe impl<ObjectType: ?Sized> NSObjectProtocol for NSDirectoryEnumerator<ObjectType> {}
1299);
1300
1301#[cfg(feature = "NSEnumerator")]
1302impl<ObjectType: Message> NSDirectoryEnumerator<ObjectType> {
1303 extern_methods!(
1304 #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
1305 #[unsafe(method(fileAttributes))]
1306 #[unsafe(method_family = none)]
1307 pub fn fileAttributes(
1308 &self,
1309 ) -> Option<Retained<NSDictionary<NSFileAttributeKey, AnyObject>>>;
1310
1311 #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
1312 #[unsafe(method(directoryAttributes))]
1313 #[unsafe(method_family = none)]
1314 pub fn directoryAttributes(
1315 &self,
1316 ) -> Option<Retained<NSDictionary<NSFileAttributeKey, AnyObject>>>;
1317
1318 #[unsafe(method(isEnumeratingDirectoryPostOrder))]
1319 #[unsafe(method_family = none)]
1320 pub fn isEnumeratingDirectoryPostOrder(&self) -> bool;
1321
1322 #[unsafe(method(skipDescendents))]
1323 #[unsafe(method_family = none)]
1324 pub fn skipDescendents(&self);
1325
1326 #[unsafe(method(level))]
1327 #[unsafe(method_family = none)]
1328 pub fn level(&self) -> NSUInteger;
1329
1330 #[unsafe(method(skipDescendants))]
1331 #[unsafe(method_family = none)]
1332 pub fn skipDescendants(&self);
1333 );
1334}
1335
1336#[cfg(feature = "NSEnumerator")]
1338impl<ObjectType: Message> NSDirectoryEnumerator<ObjectType> {
1339 extern_methods!(
1340 #[unsafe(method(init))]
1341 #[unsafe(method_family = init)]
1342 pub fn init(this: Allocated<Self>) -> Retained<Self>;
1343
1344 #[unsafe(method(new))]
1345 #[unsafe(method_family = new)]
1346 pub fn new() -> Retained<Self>;
1347 );
1348}
1349
1350#[cfg(feature = "NSEnumerator")]
1351impl<ObjectType: Message> DefaultRetained for NSDirectoryEnumerator<ObjectType> {
1352 #[inline]
1353 fn default_retained() -> Retained<Self> {
1354 Self::new()
1355 }
1356}
1357
1358extern_class!(
1359 #[unsafe(super(NSObject))]
1361 #[derive(Debug, PartialEq, Eq, Hash)]
1362 pub struct NSFileProviderService;
1363);
1364
1365extern_conformance!(
1366 unsafe impl NSObjectProtocol for NSFileProviderService {}
1367);
1368
1369impl NSFileProviderService {
1370 extern_methods!(
1371 #[cfg(all(feature = "NSError", feature = "NSXPCConnection", feature = "block2"))]
1372 #[unsafe(method(getFileProviderConnectionWithCompletionHandler:))]
1376 #[unsafe(method_family = none)]
1377 pub unsafe fn getFileProviderConnectionWithCompletionHandler(
1378 &self,
1379 completion_handler: &block2::DynBlock<dyn Fn(*mut NSXPCConnection, *mut NSError)>,
1380 );
1381
1382 #[cfg(feature = "NSString")]
1383 #[unsafe(method(name))]
1384 #[unsafe(method_family = none)]
1385 pub fn name(&self) -> Retained<NSFileProviderServiceName>;
1386 );
1387}
1388
1389impl NSFileProviderService {
1391 extern_methods!(
1392 #[unsafe(method(init))]
1393 #[unsafe(method_family = init)]
1394 pub fn init(this: Allocated<Self>) -> Retained<Self>;
1395
1396 #[unsafe(method(new))]
1397 #[unsafe(method_family = new)]
1398 pub fn new() -> Retained<Self>;
1399 );
1400}
1401
1402impl DefaultRetained for NSFileProviderService {
1403 #[inline]
1404 fn default_retained() -> Retained<Self> {
1405 Self::new()
1406 }
1407}
1408
1409extern "C" {
1410 #[cfg(feature = "NSString")]
1412 pub static NSFileType: &'static NSFileAttributeKey;
1413}
1414
1415extern "C" {
1416 #[cfg(feature = "NSString")]
1418 pub static NSFileTypeDirectory: &'static NSFileAttributeType;
1419}
1420
1421extern "C" {
1422 #[cfg(feature = "NSString")]
1424 pub static NSFileTypeRegular: &'static NSFileAttributeType;
1425}
1426
1427extern "C" {
1428 #[cfg(feature = "NSString")]
1430 pub static NSFileTypeSymbolicLink: &'static NSFileAttributeType;
1431}
1432
1433extern "C" {
1434 #[cfg(feature = "NSString")]
1436 pub static NSFileTypeSocket: &'static NSFileAttributeType;
1437}
1438
1439extern "C" {
1440 #[cfg(feature = "NSString")]
1442 pub static NSFileTypeCharacterSpecial: &'static NSFileAttributeType;
1443}
1444
1445extern "C" {
1446 #[cfg(feature = "NSString")]
1448 pub static NSFileTypeBlockSpecial: &'static NSFileAttributeType;
1449}
1450
1451extern "C" {
1452 #[cfg(feature = "NSString")]
1454 pub static NSFileTypeUnknown: &'static NSFileAttributeType;
1455}
1456
1457extern "C" {
1458 #[cfg(feature = "NSString")]
1460 pub static NSFileSize: &'static NSFileAttributeKey;
1461}
1462
1463extern "C" {
1464 #[cfg(feature = "NSString")]
1466 pub static NSFileModificationDate: &'static NSFileAttributeKey;
1467}
1468
1469extern "C" {
1470 #[cfg(feature = "NSString")]
1472 pub static NSFileReferenceCount: &'static NSFileAttributeKey;
1473}
1474
1475extern "C" {
1476 #[cfg(feature = "NSString")]
1478 pub static NSFileDeviceIdentifier: &'static NSFileAttributeKey;
1479}
1480
1481extern "C" {
1482 #[cfg(feature = "NSString")]
1484 pub static NSFileOwnerAccountName: &'static NSFileAttributeKey;
1485}
1486
1487extern "C" {
1488 #[cfg(feature = "NSString")]
1490 pub static NSFileGroupOwnerAccountName: &'static NSFileAttributeKey;
1491}
1492
1493extern "C" {
1494 #[cfg(feature = "NSString")]
1496 pub static NSFilePosixPermissions: &'static NSFileAttributeKey;
1497}
1498
1499extern "C" {
1500 #[cfg(feature = "NSString")]
1502 pub static NSFileSystemNumber: &'static NSFileAttributeKey;
1503}
1504
1505extern "C" {
1506 #[cfg(feature = "NSString")]
1508 pub static NSFileSystemFileNumber: &'static NSFileAttributeKey;
1509}
1510
1511extern "C" {
1512 #[cfg(feature = "NSString")]
1514 pub static NSFileExtensionHidden: &'static NSFileAttributeKey;
1515}
1516
1517extern "C" {
1518 #[cfg(feature = "NSString")]
1520 pub static NSFileHFSCreatorCode: &'static NSFileAttributeKey;
1521}
1522
1523extern "C" {
1524 #[cfg(feature = "NSString")]
1526 pub static NSFileHFSTypeCode: &'static NSFileAttributeKey;
1527}
1528
1529extern "C" {
1530 #[cfg(feature = "NSString")]
1532 pub static NSFileImmutable: &'static NSFileAttributeKey;
1533}
1534
1535extern "C" {
1536 #[cfg(feature = "NSString")]
1538 pub static NSFileAppendOnly: &'static NSFileAttributeKey;
1539}
1540
1541extern "C" {
1542 #[cfg(feature = "NSString")]
1544 pub static NSFileCreationDate: &'static NSFileAttributeKey;
1545}
1546
1547extern "C" {
1548 #[cfg(feature = "NSString")]
1550 pub static NSFileOwnerAccountID: &'static NSFileAttributeKey;
1551}
1552
1553extern "C" {
1554 #[cfg(feature = "NSString")]
1556 pub static NSFileGroupOwnerAccountID: &'static NSFileAttributeKey;
1557}
1558
1559extern "C" {
1560 #[cfg(feature = "NSString")]
1562 pub static NSFileBusy: &'static NSFileAttributeKey;
1563}
1564
1565extern "C" {
1566 #[cfg(feature = "NSString")]
1568 pub static NSFileProtectionKey: &'static NSFileAttributeKey;
1569}
1570
1571extern "C" {
1572 #[cfg(feature = "NSString")]
1574 pub static NSFileProtectionNone: &'static NSFileProtectionType;
1575}
1576
1577extern "C" {
1578 #[cfg(feature = "NSString")]
1580 pub static NSFileProtectionComplete: &'static NSFileProtectionType;
1581}
1582
1583extern "C" {
1584 #[cfg(feature = "NSString")]
1586 pub static NSFileProtectionCompleteUnlessOpen: &'static NSFileProtectionType;
1587}
1588
1589extern "C" {
1590 #[cfg(feature = "NSString")]
1592 pub static NSFileProtectionCompleteUntilFirstUserAuthentication: &'static NSFileProtectionType;
1593}
1594
1595extern "C" {
1596 #[cfg(feature = "NSString")]
1598 pub static NSFileProtectionCompleteWhenUserInactive: &'static NSFileProtectionType;
1599}
1600
1601extern "C" {
1602 #[cfg(feature = "NSString")]
1604 pub static NSFileSystemSize: &'static NSFileAttributeKey;
1605}
1606
1607extern "C" {
1608 #[cfg(feature = "NSString")]
1610 pub static NSFileSystemFreeSize: &'static NSFileAttributeKey;
1611}
1612
1613extern "C" {
1614 #[cfg(feature = "NSString")]
1616 pub static NSFileSystemNodes: &'static NSFileAttributeKey;
1617}
1618
1619extern "C" {
1620 #[cfg(feature = "NSString")]
1622 pub static NSFileSystemFreeNodes: &'static NSFileAttributeKey;
1623}
1624
1625#[cfg(feature = "NSDictionary")]
1627impl<KeyType: Message, ObjectType: Message> NSDictionary<KeyType, ObjectType> {
1628 extern_methods!(
1629 #[unsafe(method(fileSize))]
1630 #[unsafe(method_family = none)]
1631 pub fn fileSize(&self) -> c_ulonglong;
1632
1633 #[cfg(feature = "NSDate")]
1634 #[unsafe(method(fileModificationDate))]
1635 #[unsafe(method_family = none)]
1636 pub fn fileModificationDate(&self) -> Option<Retained<NSDate>>;
1637
1638 #[cfg(feature = "NSString")]
1639 #[unsafe(method(fileType))]
1640 #[unsafe(method_family = none)]
1641 pub fn fileType(&self) -> Option<Retained<NSString>>;
1642
1643 #[unsafe(method(filePosixPermissions))]
1644 #[unsafe(method_family = none)]
1645 pub fn filePosixPermissions(&self) -> NSUInteger;
1646
1647 #[cfg(feature = "NSString")]
1648 #[unsafe(method(fileOwnerAccountName))]
1649 #[unsafe(method_family = none)]
1650 pub fn fileOwnerAccountName(&self) -> Option<Retained<NSString>>;
1651
1652 #[cfg(feature = "NSString")]
1653 #[unsafe(method(fileGroupOwnerAccountName))]
1654 #[unsafe(method_family = none)]
1655 pub fn fileGroupOwnerAccountName(&self) -> Option<Retained<NSString>>;
1656
1657 #[unsafe(method(fileSystemNumber))]
1658 #[unsafe(method_family = none)]
1659 pub fn fileSystemNumber(&self) -> NSInteger;
1660
1661 #[unsafe(method(fileSystemFileNumber))]
1662 #[unsafe(method_family = none)]
1663 pub fn fileSystemFileNumber(&self) -> NSUInteger;
1664
1665 #[unsafe(method(fileExtensionHidden))]
1666 #[unsafe(method_family = none)]
1667 pub fn fileExtensionHidden(&self) -> bool;
1668
1669 #[unsafe(method(fileHFSCreatorCode))]
1670 #[unsafe(method_family = none)]
1671 pub fn fileHFSCreatorCode(&self) -> OSType;
1672
1673 #[unsafe(method(fileHFSTypeCode))]
1674 #[unsafe(method_family = none)]
1675 pub fn fileHFSTypeCode(&self) -> OSType;
1676
1677 #[unsafe(method(fileIsImmutable))]
1678 #[unsafe(method_family = none)]
1679 pub fn fileIsImmutable(&self) -> bool;
1680
1681 #[unsafe(method(fileIsAppendOnly))]
1682 #[unsafe(method_family = none)]
1683 pub fn fileIsAppendOnly(&self) -> bool;
1684
1685 #[cfg(feature = "NSDate")]
1686 #[unsafe(method(fileCreationDate))]
1687 #[unsafe(method_family = none)]
1688 pub fn fileCreationDate(&self) -> Option<Retained<NSDate>>;
1689
1690 #[cfg(feature = "NSValue")]
1691 #[unsafe(method(fileOwnerAccountID))]
1692 #[unsafe(method_family = none)]
1693 pub fn fileOwnerAccountID(&self) -> Option<Retained<NSNumber>>;
1694
1695 #[cfg(feature = "NSValue")]
1696 #[unsafe(method(fileGroupOwnerAccountID))]
1697 #[unsafe(method_family = none)]
1698 pub fn fileGroupOwnerAccountID(&self) -> Option<Retained<NSNumber>>;
1699 );
1700}