1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// Directory share for multiple directories.
///
/// This directory share exposes multiple directories from the host file system to the guest.
///
/// See: VZDirectorySharingDeviceConfiguration
///
/// See: VZSharedDirectory
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzmultipledirectoryshare?language=objc)
#[unsafe(super(VZDirectoryShare, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "VZDirectoryShare")]
pub struct VZMultipleDirectoryShare;
);
#[cfg(feature = "VZDirectoryShare")]
extern_conformance!(
unsafe impl NSObjectProtocol for VZMultipleDirectoryShare {}
);
#[cfg(feature = "VZDirectoryShare")]
impl VZMultipleDirectoryShare {
extern_methods!(
/// Initialize the directory share with an empty set of directories.
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[cfg(feature = "VZSharedDirectory")]
/// Initialize the directory share with a set of directories on the host.
///
/// Parameter `directories`: Directories on the host to expose to the guest by name.
///
/// The dictionary string keys will be the name for the directory. The keys must be valid names or an exception will be raised.
///
/// See: +[VZMultipleDirectoryShare validateName:error:]
#[unsafe(method(initWithDirectories:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithDirectories(
this: Allocated<Self>,
directories: &NSDictionary<NSString, VZSharedDirectory>,
) -> Retained<Self>;
#[cfg(feature = "VZSharedDirectory")]
/// The directories on the host to expose to the guest.
///
/// The dictionary string keys will be the name for the directory. The keys must be valid names or an exception will be raised.
///
/// See: +[VZMultipleDirectoryShare validateName:error:]
#[unsafe(method(directories))]
#[unsafe(method_family = none)]
pub unsafe fn directories(&self) -> Retained<NSDictionary<NSString, VZSharedDirectory>>;
/// Check if a name is a valid directory name.
///
/// Parameter `name`: The name to validate.
///
/// Parameter `error`: If not nil, assigned with an error describing why the name is not valid.
///
/// The name must not be empty, have characters unsafe for file systems, be longer than NAME_MAX, or other restrictions.
///
/// See: +[VZMultipleDirectoryShare canonicalizedNameFromName:]
#[unsafe(method(validateName:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn validateName_error(name: &NSString) -> Result<(), Retained<NSError>>;
/// Canonicalize a string to be a valid directory name.
///
/// Parameter `name`: The name to canonicalize.
///
/// This returns nil when it cannot produce a valid name. When not nil, the result is a valid directory name.
///
/// See: +[VZMultipleDirectoryShare validateName:error:]
#[unsafe(method(canonicalizedNameFromName:))]
#[unsafe(method_family = none)]
pub unsafe fn canonicalizedNameFromName(name: &NSString) -> Option<Retained<NSString>>;
);
}
/// Methods declared on superclass `VZDirectoryShare`.
#[cfg(feature = "VZDirectoryShare")]
impl VZMultipleDirectoryShare {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}