use crate::common::*;
use crate::Foundation::*;
typed_extensible_enum!(
pub type NSURLResourceKey = NSString;
);
extern_static!(NSURLFileScheme: &'static NSString);
extern_static!(NSURLKeysOfUnsetValuesKey: &'static NSURLResourceKey);
extern_static!(NSURLNameKey: &'static NSURLResourceKey);
extern_static!(NSURLLocalizedNameKey: &'static NSURLResourceKey);
extern_static!(NSURLIsRegularFileKey: &'static NSURLResourceKey);
extern_static!(NSURLIsDirectoryKey: &'static NSURLResourceKey);
extern_static!(NSURLIsSymbolicLinkKey: &'static NSURLResourceKey);
extern_static!(NSURLIsVolumeKey: &'static NSURLResourceKey);
extern_static!(NSURLIsPackageKey: &'static NSURLResourceKey);
extern_static!(NSURLIsApplicationKey: &'static NSURLResourceKey);
extern_static!(NSURLApplicationIsScriptableKey: &'static NSURLResourceKey);
extern_static!(NSURLIsSystemImmutableKey: &'static NSURLResourceKey);
extern_static!(NSURLIsUserImmutableKey: &'static NSURLResourceKey);
extern_static!(NSURLIsHiddenKey: &'static NSURLResourceKey);
extern_static!(NSURLHasHiddenExtensionKey: &'static NSURLResourceKey);
extern_static!(NSURLCreationDateKey: &'static NSURLResourceKey);
extern_static!(NSURLContentAccessDateKey: &'static NSURLResourceKey);
extern_static!(NSURLContentModificationDateKey: &'static NSURLResourceKey);
extern_static!(NSURLAttributeModificationDateKey: &'static NSURLResourceKey);
extern_static!(NSURLLinkCountKey: &'static NSURLResourceKey);
extern_static!(NSURLParentDirectoryURLKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeURLKey: &'static NSURLResourceKey);
extern_static!(NSURLTypeIdentifierKey: &'static NSURLResourceKey);
extern_static!(NSURLContentTypeKey: &'static NSURLResourceKey);
extern_static!(NSURLLocalizedTypeDescriptionKey: &'static NSURLResourceKey);
extern_static!(NSURLLabelNumberKey: &'static NSURLResourceKey);
extern_static!(NSURLLabelColorKey: &'static NSURLResourceKey);
extern_static!(NSURLLocalizedLabelKey: &'static NSURLResourceKey);
extern_static!(NSURLEffectiveIconKey: &'static NSURLResourceKey);
extern_static!(NSURLCustomIconKey: &'static NSURLResourceKey);
extern_static!(NSURLFileResourceIdentifierKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeIdentifierKey: &'static NSURLResourceKey);
extern_static!(NSURLPreferredIOBlockSizeKey: &'static NSURLResourceKey);
extern_static!(NSURLIsReadableKey: &'static NSURLResourceKey);
extern_static!(NSURLIsWritableKey: &'static NSURLResourceKey);
extern_static!(NSURLIsExecutableKey: &'static NSURLResourceKey);
extern_static!(NSURLFileSecurityKey: &'static NSURLResourceKey);
extern_static!(NSURLIsExcludedFromBackupKey: &'static NSURLResourceKey);
extern_static!(NSURLTagNamesKey: &'static NSURLResourceKey);
extern_static!(NSURLPathKey: &'static NSURLResourceKey);
extern_static!(NSURLCanonicalPathKey: &'static NSURLResourceKey);
extern_static!(NSURLIsMountTriggerKey: &'static NSURLResourceKey);
extern_static!(NSURLGenerationIdentifierKey: &'static NSURLResourceKey);
extern_static!(NSURLDocumentIdentifierKey: &'static NSURLResourceKey);
extern_static!(NSURLAddedToDirectoryDateKey: &'static NSURLResourceKey);
extern_static!(NSURLQuarantinePropertiesKey: &'static NSURLResourceKey);
extern_static!(NSURLFileResourceTypeKey: &'static NSURLResourceKey);
extern_static!(NSURLFileContentIdentifierKey: &'static NSURLResourceKey);
extern_static!(NSURLMayShareFileContentKey: &'static NSURLResourceKey);
extern_static!(NSURLMayHaveExtendedAttributesKey: &'static NSURLResourceKey);
extern_static!(NSURLIsPurgeableKey: &'static NSURLResourceKey);
extern_static!(NSURLIsSparseKey: &'static NSURLResourceKey);
typed_enum!(
pub type NSURLFileResourceType = NSString;
);
extern_static!(NSURLFileResourceTypeNamedPipe: &'static NSURLFileResourceType);
extern_static!(NSURLFileResourceTypeCharacterSpecial: &'static NSURLFileResourceType);
extern_static!(NSURLFileResourceTypeDirectory: &'static NSURLFileResourceType);
extern_static!(NSURLFileResourceTypeBlockSpecial: &'static NSURLFileResourceType);
extern_static!(NSURLFileResourceTypeRegular: &'static NSURLFileResourceType);
extern_static!(NSURLFileResourceTypeSymbolicLink: &'static NSURLFileResourceType);
extern_static!(NSURLFileResourceTypeSocket: &'static NSURLFileResourceType);
extern_static!(NSURLFileResourceTypeUnknown: &'static NSURLFileResourceType);
extern_static!(NSURLThumbnailDictionaryKey: &'static NSURLResourceKey);
extern_static!(NSURLThumbnailKey: &'static NSURLResourceKey);
typed_extensible_enum!(
pub type NSURLThumbnailDictionaryItem = NSString;
);
extern_static!(NSThumbnail1024x1024SizeKey: &'static NSURLThumbnailDictionaryItem);
extern_static!(NSURLFileSizeKey: &'static NSURLResourceKey);
extern_static!(NSURLFileAllocatedSizeKey: &'static NSURLResourceKey);
extern_static!(NSURLTotalFileSizeKey: &'static NSURLResourceKey);
extern_static!(NSURLTotalFileAllocatedSizeKey: &'static NSURLResourceKey);
extern_static!(NSURLIsAliasFileKey: &'static NSURLResourceKey);
extern_static!(NSURLFileProtectionKey: &'static NSURLResourceKey);
typed_enum!(
pub type NSURLFileProtectionType = NSString;
);
extern_static!(NSURLFileProtectionNone: &'static NSURLFileProtectionType);
extern_static!(NSURLFileProtectionComplete: &'static NSURLFileProtectionType);
extern_static!(NSURLFileProtectionCompleteUnlessOpen: &'static NSURLFileProtectionType);
extern_static!(
NSURLFileProtectionCompleteUntilFirstUserAuthentication: &'static NSURLFileProtectionType
);
extern_static!(NSURLVolumeLocalizedFormatDescriptionKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeTotalCapacityKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeAvailableCapacityKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeResourceCountKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeSupportsPersistentIDsKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeSupportsSymbolicLinksKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeSupportsHardLinksKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeSupportsJournalingKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeIsJournalingKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeSupportsSparseFilesKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeSupportsZeroRunsKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeSupportsCaseSensitiveNamesKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeSupportsCasePreservedNamesKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeSupportsRootDirectoryDatesKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeSupportsVolumeSizesKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeSupportsRenamingKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeSupportsAdvisoryFileLockingKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeSupportsExtendedSecurityKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeIsBrowsableKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeMaximumFileSizeKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeIsEjectableKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeIsRemovableKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeIsInternalKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeIsAutomountedKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeIsLocalKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeIsReadOnlyKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeCreationDateKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeURLForRemountingKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeUUIDStringKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeNameKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeLocalizedNameKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeIsEncryptedKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeIsRootFileSystemKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeSupportsCompressionKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeSupportsFileCloningKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeSupportsSwapRenamingKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeSupportsExclusiveRenamingKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeSupportsImmutableFilesKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeSupportsAccessPermissionsKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeSupportsFileProtectionKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeAvailableCapacityForImportantUsageKey: &'static NSURLResourceKey);
extern_static!(NSURLVolumeAvailableCapacityForOpportunisticUsageKey: &'static NSURLResourceKey);
extern_static!(NSURLIsUbiquitousItemKey: &'static NSURLResourceKey);
extern_static!(NSURLUbiquitousItemHasUnresolvedConflictsKey: &'static NSURLResourceKey);
extern_static!(NSURLUbiquitousItemIsDownloadedKey: &'static NSURLResourceKey);
extern_static!(NSURLUbiquitousItemIsDownloadingKey: &'static NSURLResourceKey);
extern_static!(NSURLUbiquitousItemIsUploadedKey: &'static NSURLResourceKey);
extern_static!(NSURLUbiquitousItemIsUploadingKey: &'static NSURLResourceKey);
extern_static!(NSURLUbiquitousItemPercentDownloadedKey: &'static NSURLResourceKey);
extern_static!(NSURLUbiquitousItemPercentUploadedKey: &'static NSURLResourceKey);
extern_static!(NSURLUbiquitousItemDownloadingStatusKey: &'static NSURLResourceKey);
extern_static!(NSURLUbiquitousItemDownloadingErrorKey: &'static NSURLResourceKey);
extern_static!(NSURLUbiquitousItemUploadingErrorKey: &'static NSURLResourceKey);
extern_static!(NSURLUbiquitousItemDownloadRequestedKey: &'static NSURLResourceKey);
extern_static!(NSURLUbiquitousItemContainerDisplayNameKey: &'static NSURLResourceKey);
extern_static!(NSURLUbiquitousItemIsExcludedFromSyncKey: &'static NSURLResourceKey);
extern_static!(NSURLUbiquitousItemIsSharedKey: &'static NSURLResourceKey);
extern_static!(NSURLUbiquitousSharedItemCurrentUserRoleKey: &'static NSURLResourceKey);
extern_static!(NSURLUbiquitousSharedItemCurrentUserPermissionsKey: &'static NSURLResourceKey);
extern_static!(NSURLUbiquitousSharedItemOwnerNameComponentsKey: &'static NSURLResourceKey);
extern_static!(
NSURLUbiquitousSharedItemMostRecentEditorNameComponentsKey: &'static NSURLResourceKey
);
typed_enum!(
pub type NSURLUbiquitousItemDownloadingStatus = NSString;
);
extern_static!(
NSURLUbiquitousItemDownloadingStatusNotDownloaded:
&'static NSURLUbiquitousItemDownloadingStatus
);
extern_static!(
NSURLUbiquitousItemDownloadingStatusDownloaded: &'static NSURLUbiquitousItemDownloadingStatus
);
extern_static!(
NSURLUbiquitousItemDownloadingStatusCurrent: &'static NSURLUbiquitousItemDownloadingStatus
);
typed_enum!(
pub type NSURLUbiquitousSharedItemRole = NSString;
);
extern_static!(NSURLUbiquitousSharedItemRoleOwner: &'static NSURLUbiquitousSharedItemRole);
extern_static!(NSURLUbiquitousSharedItemRoleParticipant: &'static NSURLUbiquitousSharedItemRole);
typed_enum!(
pub type NSURLUbiquitousSharedItemPermissions = NSString;
);
extern_static!(
NSURLUbiquitousSharedItemPermissionsReadOnly: &'static NSURLUbiquitousSharedItemPermissions
);
extern_static!(
NSURLUbiquitousSharedItemPermissionsReadWrite: &'static NSURLUbiquitousSharedItemPermissions
);
ns_options!(
#[underlying(NSUInteger)]
pub enum NSURLBookmarkCreationOptions {
NSURLBookmarkCreationPreferFileIDResolution = 1 << 8,
NSURLBookmarkCreationMinimalBookmark = 1 << 9,
NSURLBookmarkCreationSuitableForBookmarkFile = 1 << 10,
NSURLBookmarkCreationWithSecurityScope = 1 << 11,
NSURLBookmarkCreationSecurityScopeAllowOnlyReadAccess = 1 << 12,
NSURLBookmarkCreationWithoutImplicitSecurityScope = 1 << 29,
}
);
ns_options!(
#[underlying(NSUInteger)]
pub enum NSURLBookmarkResolutionOptions {
NSURLBookmarkResolutionWithoutUI = 1 << 8,
NSURLBookmarkResolutionWithoutMounting = 1 << 9,
NSURLBookmarkResolutionWithSecurityScope = 1 << 10,
NSURLBookmarkResolutionWithoutImplicitStartAccessing = 1 << 15,
}
);
pub type NSURLBookmarkFileCreationOptions = NSUInteger;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSURL;
unsafe impl ClassType for NSURL {
type Super = NSObject;
}
);
extern_methods!(
unsafe impl NSURL {
#[method_id(@__retain_semantics Init initWithScheme:host:path:)]
pub unsafe fn initWithScheme_host_path(
this: Option<Allocated<Self>>,
scheme: &NSString,
host: Option<&NSString>,
path: &NSString,
) -> Option<Id<Self, Shared>>;
#[method_id(@__retain_semantics Init initFileURLWithPath:isDirectory:relativeToURL:)]
pub unsafe fn initFileURLWithPath_isDirectory_relativeToURL(
this: Option<Allocated<Self>>,
path: &NSString,
isDir: bool,
baseURL: Option<&NSURL>,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Init initFileURLWithPath:relativeToURL:)]
pub unsafe fn initFileURLWithPath_relativeToURL(
this: Option<Allocated<Self>>,
path: &NSString,
baseURL: Option<&NSURL>,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Init initFileURLWithPath:isDirectory:)]
pub unsafe fn initFileURLWithPath_isDirectory(
this: Option<Allocated<Self>>,
path: &NSString,
isDir: bool,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Init initFileURLWithPath:)]
pub unsafe fn initFileURLWithPath(
this: Option<Allocated<Self>>,
path: &NSString,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other fileURLWithPath:isDirectory:relativeToURL:)]
pub unsafe fn fileURLWithPath_isDirectory_relativeToURL(
path: &NSString,
isDir: bool,
baseURL: Option<&NSURL>,
) -> Id<NSURL, Shared>;
#[method_id(@__retain_semantics Other fileURLWithPath:relativeToURL:)]
pub unsafe fn fileURLWithPath_relativeToURL(
path: &NSString,
baseURL: Option<&NSURL>,
) -> Id<NSURL, Shared>;
#[method_id(@__retain_semantics Other fileURLWithPath:isDirectory:)]
pub unsafe fn fileURLWithPath_isDirectory(
path: &NSString,
isDir: bool,
) -> Id<NSURL, Shared>;
#[method_id(@__retain_semantics Other fileURLWithPath:)]
pub unsafe fn fileURLWithPath(path: &NSString) -> Id<NSURL, Shared>;
#[method_id(@__retain_semantics Init initFileURLWithFileSystemRepresentation:isDirectory:relativeToURL:)]
pub unsafe fn initFileURLWithFileSystemRepresentation_isDirectory_relativeToURL(
this: Option<Allocated<Self>>,
path: NonNull<c_char>,
isDir: bool,
baseURL: Option<&NSURL>,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other fileURLWithFileSystemRepresentation:isDirectory:relativeToURL:)]
pub unsafe fn fileURLWithFileSystemRepresentation_isDirectory_relativeToURL(
path: NonNull<c_char>,
isDir: bool,
baseURL: Option<&NSURL>,
) -> Id<NSURL, Shared>;
#[method_id(@__retain_semantics Init initWithString:)]
pub unsafe fn initWithString(
this: Option<Allocated<Self>>,
URLString: &NSString,
) -> Option<Id<Self, Shared>>;
#[method_id(@__retain_semantics Init initWithString:relativeToURL:)]
pub unsafe fn initWithString_relativeToURL(
this: Option<Allocated<Self>>,
URLString: &NSString,
baseURL: Option<&NSURL>,
) -> Option<Id<Self, Shared>>;
#[method_id(@__retain_semantics Other URLWithString:)]
pub unsafe fn URLWithString(URLString: &NSString) -> Option<Id<Self, Shared>>;
#[method_id(@__retain_semantics Other URLWithString:relativeToURL:)]
pub unsafe fn URLWithString_relativeToURL(
URLString: &NSString,
baseURL: Option<&NSURL>,
) -> Option<Id<Self, Shared>>;
#[method_id(@__retain_semantics Init initWithDataRepresentation:relativeToURL:)]
pub unsafe fn initWithDataRepresentation_relativeToURL(
this: Option<Allocated<Self>>,
data: &NSData,
baseURL: Option<&NSURL>,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other URLWithDataRepresentation:relativeToURL:)]
pub unsafe fn URLWithDataRepresentation_relativeToURL(
data: &NSData,
baseURL: Option<&NSURL>,
) -> Id<NSURL, Shared>;
#[method_id(@__retain_semantics Init initAbsoluteURLWithDataRepresentation:relativeToURL:)]
pub unsafe fn initAbsoluteURLWithDataRepresentation_relativeToURL(
this: Option<Allocated<Self>>,
data: &NSData,
baseURL: Option<&NSURL>,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other absoluteURLWithDataRepresentation:relativeToURL:)]
pub unsafe fn absoluteURLWithDataRepresentation_relativeToURL(
data: &NSData,
baseURL: Option<&NSURL>,
) -> Id<NSURL, Shared>;
#[method_id(@__retain_semantics Other dataRepresentation)]
pub unsafe fn dataRepresentation(&self) -> Id<NSData, Shared>;
#[method_id(@__retain_semantics Other absoluteString)]
pub unsafe fn absoluteString(&self) -> Option<Id<NSString, Shared>>;
#[method_id(@__retain_semantics Other relativeString)]
pub unsafe fn relativeString(&self) -> Id<NSString, Shared>;
#[method_id(@__retain_semantics Other baseURL)]
pub unsafe fn baseURL(&self) -> Option<Id<NSURL, Shared>>;
#[method_id(@__retain_semantics Other absoluteURL)]
pub unsafe fn absoluteURL(&self) -> Option<Id<NSURL, Shared>>;
#[method_id(@__retain_semantics Other scheme)]
pub unsafe fn scheme(&self) -> Option<Id<NSString, Shared>>;
#[method_id(@__retain_semantics Other resourceSpecifier)]
pub unsafe fn resourceSpecifier(&self) -> Option<Id<NSString, Shared>>;
#[method_id(@__retain_semantics Other host)]
pub unsafe fn host(&self) -> Option<Id<NSString, Shared>>;
#[method_id(@__retain_semantics Other port)]
pub unsafe fn port(&self) -> Option<Id<NSNumber, Shared>>;
#[method_id(@__retain_semantics Other user)]
pub unsafe fn user(&self) -> Option<Id<NSString, Shared>>;
#[method_id(@__retain_semantics Other password)]
pub unsafe fn password(&self) -> Option<Id<NSString, Shared>>;
#[method_id(@__retain_semantics Other path)]
pub unsafe fn path(&self) -> Option<Id<NSString, Shared>>;
#[method_id(@__retain_semantics Other fragment)]
pub unsafe fn fragment(&self) -> Option<Id<NSString, Shared>>;
#[method_id(@__retain_semantics Other parameterString)]
pub unsafe fn parameterString(&self) -> Option<Id<NSString, Shared>>;
#[method_id(@__retain_semantics Other query)]
pub unsafe fn query(&self) -> Option<Id<NSString, Shared>>;
#[method_id(@__retain_semantics Other relativePath)]
pub unsafe fn relativePath(&self) -> Option<Id<NSString, Shared>>;
#[method(hasDirectoryPath)]
pub unsafe fn hasDirectoryPath(&self) -> bool;
#[method(getFileSystemRepresentation:maxLength:)]
pub unsafe fn getFileSystemRepresentation_maxLength(
&self,
buffer: NonNull<c_char>,
maxBufferLength: NSUInteger,
) -> bool;
#[method(fileSystemRepresentation)]
pub unsafe fn fileSystemRepresentation(&self) -> NonNull<c_char>;
#[method(isFileURL)]
pub unsafe fn isFileURL(&self) -> bool;
#[method_id(@__retain_semantics Other standardizedURL)]
pub unsafe fn standardizedURL(&self) -> Option<Id<NSURL, Shared>>;
#[method(checkResourceIsReachableAndReturnError:)]
pub unsafe fn checkResourceIsReachableAndReturnError(
&self,
) -> Result<(), Id<NSError, Shared>>;
#[method(isFileReferenceURL)]
pub unsafe fn isFileReferenceURL(&self) -> bool;
#[method_id(@__retain_semantics Other fileReferenceURL)]
pub unsafe fn fileReferenceURL(&self) -> Option<Id<NSURL, Shared>>;
#[method_id(@__retain_semantics Other filePathURL)]
pub unsafe fn filePathURL(&self) -> Option<Id<NSURL, Shared>>;
#[method(getResourceValue:forKey:error:)]
pub unsafe fn getResourceValue_forKey_error(
&self,
value: NonNull<*mut Object>,
key: &NSURLResourceKey,
) -> Result<(), Id<NSError, Shared>>;
#[method_id(@__retain_semantics Other resourceValuesForKeys:error:)]
pub unsafe fn resourceValuesForKeys_error(
&self,
keys: &NSArray<NSURLResourceKey>,
) -> Result<Id<NSDictionary<NSURLResourceKey, Object>, Shared>, Id<NSError, Shared>>;
#[method(setResourceValue:forKey:error:)]
pub unsafe fn setResourceValue_forKey_error(
&self,
value: Option<&Object>,
key: &NSURLResourceKey,
) -> Result<(), Id<NSError, Shared>>;
#[method(setResourceValues:error:)]
pub unsafe fn setResourceValues_error(
&self,
keyedValues: &NSDictionary<NSURLResourceKey, Object>,
) -> Result<(), Id<NSError, Shared>>;
#[method(removeCachedResourceValueForKey:)]
pub unsafe fn removeCachedResourceValueForKey(&self, key: &NSURLResourceKey);
#[method(removeAllCachedResourceValues)]
pub unsafe fn removeAllCachedResourceValues(&self);
#[method(setTemporaryResourceValue:forKey:)]
pub unsafe fn setTemporaryResourceValue_forKey(
&self,
value: Option<&Object>,
key: &NSURLResourceKey,
);
#[method_id(@__retain_semantics Other bookmarkDataWithOptions:includingResourceValuesForKeys:relativeToURL:error:)]
pub unsafe fn bookmarkDataWithOptions_includingResourceValuesForKeys_relativeToURL_error(
&self,
options: NSURLBookmarkCreationOptions,
keys: Option<&NSArray<NSURLResourceKey>>,
relativeURL: Option<&NSURL>,
) -> Result<Id<NSData, Shared>, Id<NSError, Shared>>;
#[method_id(@__retain_semantics Init initByResolvingBookmarkData:options:relativeToURL:bookmarkDataIsStale:error:)]
pub unsafe fn initByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error(
this: Option<Allocated<Self>>,
bookmarkData: &NSData,
options: NSURLBookmarkResolutionOptions,
relativeURL: Option<&NSURL>,
isStale: *mut Bool,
) -> Result<Id<Self, Shared>, Id<NSError, Shared>>;
#[method_id(@__retain_semantics Other URLByResolvingBookmarkData:options:relativeToURL:bookmarkDataIsStale:error:)]
pub unsafe fn URLByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error(
bookmarkData: &NSData,
options: NSURLBookmarkResolutionOptions,
relativeURL: Option<&NSURL>,
isStale: *mut Bool,
) -> Result<Id<Self, Shared>, Id<NSError, Shared>>;
#[method_id(@__retain_semantics Other resourceValuesForKeys:fromBookmarkData:)]
pub unsafe fn resourceValuesForKeys_fromBookmarkData(
keys: &NSArray<NSURLResourceKey>,
bookmarkData: &NSData,
) -> Option<Id<NSDictionary<NSURLResourceKey, Object>, Shared>>;
#[method(writeBookmarkData:toURL:options:error:)]
pub unsafe fn writeBookmarkData_toURL_options_error(
bookmarkData: &NSData,
bookmarkFileURL: &NSURL,
options: NSURLBookmarkFileCreationOptions,
) -> Result<(), Id<NSError, Shared>>;
#[method_id(@__retain_semantics Other bookmarkDataWithContentsOfURL:error:)]
pub unsafe fn bookmarkDataWithContentsOfURL_error(
bookmarkFileURL: &NSURL,
) -> Result<Id<NSData, Shared>, Id<NSError, Shared>>;
#[method_id(@__retain_semantics Other URLByResolvingAliasFileAtURL:options:error:)]
pub unsafe fn URLByResolvingAliasFileAtURL_options_error(
url: &NSURL,
options: NSURLBookmarkResolutionOptions,
) -> Result<Id<Self, Shared>, Id<NSError, Shared>>;
#[method(startAccessingSecurityScopedResource)]
pub unsafe fn startAccessingSecurityScopedResource(&self) -> bool;
#[method(stopAccessingSecurityScopedResource)]
pub unsafe fn stopAccessingSecurityScopedResource(&self);
}
);
extern_methods!(
unsafe impl NSURL {
#[method(getPromisedItemResourceValue:forKey:error:)]
pub unsafe fn getPromisedItemResourceValue_forKey_error(
&self,
value: NonNull<*mut Object>,
key: &NSURLResourceKey,
) -> Result<(), Id<NSError, Shared>>;
#[method_id(@__retain_semantics Other promisedItemResourceValuesForKeys:error:)]
pub unsafe fn promisedItemResourceValuesForKeys_error(
&self,
keys: &NSArray<NSURLResourceKey>,
) -> Result<Id<NSDictionary<NSURLResourceKey, Object>, Shared>, Id<NSError, Shared>>;
#[method(checkPromisedItemIsReachableAndReturnError:)]
pub unsafe fn checkPromisedItemIsReachableAndReturnError(
&self,
) -> Result<(), Id<NSError, Shared>>;
}
);
extern_methods!(
unsafe impl NSURL {}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSURLQueryItem;
unsafe impl ClassType for NSURLQueryItem {
type Super = NSObject;
}
);
extern_methods!(
unsafe impl NSURLQueryItem {
#[method_id(@__retain_semantics Init initWithName:value:)]
pub unsafe fn initWithName_value(
this: Option<Allocated<Self>>,
name: &NSString,
value: Option<&NSString>,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other queryItemWithName:value:)]
pub unsafe fn queryItemWithName_value(
name: &NSString,
value: Option<&NSString>,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other name)]
pub unsafe fn name(&self) -> Id<NSString, Shared>;
#[method_id(@__retain_semantics Other value)]
pub unsafe fn value(&self) -> Option<Id<NSString, Shared>>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSURLComponents;
unsafe impl ClassType for NSURLComponents {
type Super = NSObject;
}
);
extern_methods!(
unsafe impl NSURLComponents {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Option<Allocated<Self>>) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Init initWithURL:resolvingAgainstBaseURL:)]
pub unsafe fn initWithURL_resolvingAgainstBaseURL(
this: Option<Allocated<Self>>,
url: &NSURL,
resolve: bool,
) -> Option<Id<Self, Shared>>;
#[method_id(@__retain_semantics Other componentsWithURL:resolvingAgainstBaseURL:)]
pub unsafe fn componentsWithURL_resolvingAgainstBaseURL(
url: &NSURL,
resolve: bool,
) -> Option<Id<Self, Shared>>;
#[method_id(@__retain_semantics Init initWithString:)]
pub unsafe fn initWithString(
this: Option<Allocated<Self>>,
URLString: &NSString,
) -> Option<Id<Self, Shared>>;
#[method_id(@__retain_semantics Other componentsWithString:)]
pub unsafe fn componentsWithString(URLString: &NSString) -> Option<Id<Self, Shared>>;
#[method_id(@__retain_semantics Other URL)]
pub unsafe fn URL(&self) -> Option<Id<NSURL, Shared>>;
#[method_id(@__retain_semantics Other URLRelativeToURL:)]
pub unsafe fn URLRelativeToURL(&self, baseURL: Option<&NSURL>)
-> Option<Id<NSURL, Shared>>;
#[method_id(@__retain_semantics Other string)]
pub unsafe fn string(&self) -> Option<Id<NSString, Shared>>;
#[method_id(@__retain_semantics Other scheme)]
pub unsafe fn scheme(&self) -> Option<Id<NSString, Shared>>;
#[method(setScheme:)]
pub unsafe fn setScheme(&self, scheme: Option<&NSString>);
#[method_id(@__retain_semantics Other user)]
pub unsafe fn user(&self) -> Option<Id<NSString, Shared>>;
#[method(setUser:)]
pub unsafe fn setUser(&self, user: Option<&NSString>);
#[method_id(@__retain_semantics Other password)]
pub unsafe fn password(&self) -> Option<Id<NSString, Shared>>;
#[method(setPassword:)]
pub unsafe fn setPassword(&self, password: Option<&NSString>);
#[method_id(@__retain_semantics Other host)]
pub unsafe fn host(&self) -> Option<Id<NSString, Shared>>;
#[method(setHost:)]
pub unsafe fn setHost(&self, host: Option<&NSString>);
#[method_id(@__retain_semantics Other port)]
pub unsafe fn port(&self) -> Option<Id<NSNumber, Shared>>;
#[method(setPort:)]
pub unsafe fn setPort(&self, port: Option<&NSNumber>);
#[method_id(@__retain_semantics Other path)]
pub unsafe fn path(&self) -> Option<Id<NSString, Shared>>;
#[method(setPath:)]
pub unsafe fn setPath(&self, path: Option<&NSString>);
#[method_id(@__retain_semantics Other query)]
pub unsafe fn query(&self) -> Option<Id<NSString, Shared>>;
#[method(setQuery:)]
pub unsafe fn setQuery(&self, query: Option<&NSString>);
#[method_id(@__retain_semantics Other fragment)]
pub unsafe fn fragment(&self) -> Option<Id<NSString, Shared>>;
#[method(setFragment:)]
pub unsafe fn setFragment(&self, fragment: Option<&NSString>);
#[method_id(@__retain_semantics Other percentEncodedUser)]
pub unsafe fn percentEncodedUser(&self) -> Option<Id<NSString, Shared>>;
#[method(setPercentEncodedUser:)]
pub unsafe fn setPercentEncodedUser(&self, percentEncodedUser: Option<&NSString>);
#[method_id(@__retain_semantics Other percentEncodedPassword)]
pub unsafe fn percentEncodedPassword(&self) -> Option<Id<NSString, Shared>>;
#[method(setPercentEncodedPassword:)]
pub unsafe fn setPercentEncodedPassword(&self, percentEncodedPassword: Option<&NSString>);
#[method_id(@__retain_semantics Other percentEncodedHost)]
pub unsafe fn percentEncodedHost(&self) -> Option<Id<NSString, Shared>>;
#[method(setPercentEncodedHost:)]
pub unsafe fn setPercentEncodedHost(&self, percentEncodedHost: Option<&NSString>);
#[method_id(@__retain_semantics Other percentEncodedPath)]
pub unsafe fn percentEncodedPath(&self) -> Option<Id<NSString, Shared>>;
#[method(setPercentEncodedPath:)]
pub unsafe fn setPercentEncodedPath(&self, percentEncodedPath: Option<&NSString>);
#[method_id(@__retain_semantics Other percentEncodedQuery)]
pub unsafe fn percentEncodedQuery(&self) -> Option<Id<NSString, Shared>>;
#[method(setPercentEncodedQuery:)]
pub unsafe fn setPercentEncodedQuery(&self, percentEncodedQuery: Option<&NSString>);
#[method_id(@__retain_semantics Other percentEncodedFragment)]
pub unsafe fn percentEncodedFragment(&self) -> Option<Id<NSString, Shared>>;
#[method(setPercentEncodedFragment:)]
pub unsafe fn setPercentEncodedFragment(&self, percentEncodedFragment: Option<&NSString>);
#[method(rangeOfScheme)]
pub unsafe fn rangeOfScheme(&self) -> NSRange;
#[method(rangeOfUser)]
pub unsafe fn rangeOfUser(&self) -> NSRange;
#[method(rangeOfPassword)]
pub unsafe fn rangeOfPassword(&self) -> NSRange;
#[method(rangeOfHost)]
pub unsafe fn rangeOfHost(&self) -> NSRange;
#[method(rangeOfPort)]
pub unsafe fn rangeOfPort(&self) -> NSRange;
#[method(rangeOfPath)]
pub unsafe fn rangeOfPath(&self) -> NSRange;
#[method(rangeOfQuery)]
pub unsafe fn rangeOfQuery(&self) -> NSRange;
#[method(rangeOfFragment)]
pub unsafe fn rangeOfFragment(&self) -> NSRange;
#[method_id(@__retain_semantics Other queryItems)]
pub unsafe fn queryItems(&self) -> Option<Id<NSArray<NSURLQueryItem>, Shared>>;
#[method(setQueryItems:)]
pub unsafe fn setQueryItems(&self, queryItems: Option<&NSArray<NSURLQueryItem>>);
#[method_id(@__retain_semantics Other percentEncodedQueryItems)]
pub unsafe fn percentEncodedQueryItems(
&self,
) -> Option<Id<NSArray<NSURLQueryItem>, Shared>>;
#[method(setPercentEncodedQueryItems:)]
pub unsafe fn setPercentEncodedQueryItems(
&self,
percentEncodedQueryItems: Option<&NSArray<NSURLQueryItem>>,
);
}
);
extern_methods!(
unsafe impl NSCharacterSet {
#[method_id(@__retain_semantics Other URLUserAllowedCharacterSet)]
pub unsafe fn URLUserAllowedCharacterSet() -> Id<NSCharacterSet, Shared>;
#[method_id(@__retain_semantics Other URLPasswordAllowedCharacterSet)]
pub unsafe fn URLPasswordAllowedCharacterSet() -> Id<NSCharacterSet, Shared>;
#[method_id(@__retain_semantics Other URLHostAllowedCharacterSet)]
pub unsafe fn URLHostAllowedCharacterSet() -> Id<NSCharacterSet, Shared>;
#[method_id(@__retain_semantics Other URLPathAllowedCharacterSet)]
pub unsafe fn URLPathAllowedCharacterSet() -> Id<NSCharacterSet, Shared>;
#[method_id(@__retain_semantics Other URLQueryAllowedCharacterSet)]
pub unsafe fn URLQueryAllowedCharacterSet() -> Id<NSCharacterSet, Shared>;
#[method_id(@__retain_semantics Other URLFragmentAllowedCharacterSet)]
pub unsafe fn URLFragmentAllowedCharacterSet() -> Id<NSCharacterSet, Shared>;
}
);
extern_methods!(
unsafe impl NSString {
#[method_id(@__retain_semantics Other stringByAddingPercentEncodingWithAllowedCharacters:)]
pub unsafe fn stringByAddingPercentEncodingWithAllowedCharacters(
&self,
allowedCharacters: &NSCharacterSet,
) -> Option<Id<NSString, Shared>>;
#[method_id(@__retain_semantics Other stringByRemovingPercentEncoding)]
pub unsafe fn stringByRemovingPercentEncoding(&self) -> Option<Id<NSString, Shared>>;
#[method_id(@__retain_semantics Other stringByAddingPercentEscapesUsingEncoding:)]
pub unsafe fn stringByAddingPercentEscapesUsingEncoding(
&self,
enc: NSStringEncoding,
) -> Option<Id<NSString, Shared>>;
#[method_id(@__retain_semantics Other stringByReplacingPercentEscapesUsingEncoding:)]
pub unsafe fn stringByReplacingPercentEscapesUsingEncoding(
&self,
enc: NSStringEncoding,
) -> Option<Id<NSString, Shared>>;
}
);
extern_methods!(
unsafe impl NSURL {
#[method_id(@__retain_semantics Other fileURLWithPathComponents:)]
pub unsafe fn fileURLWithPathComponents(
components: &NSArray<NSString>,
) -> Option<Id<NSURL, Shared>>;
#[method_id(@__retain_semantics Other pathComponents)]
pub unsafe fn pathComponents(&self) -> Option<Id<NSArray<NSString>, Shared>>;
#[method_id(@__retain_semantics Other lastPathComponent)]
pub unsafe fn lastPathComponent(&self) -> Option<Id<NSString, Shared>>;
#[method_id(@__retain_semantics Other pathExtension)]
pub unsafe fn pathExtension(&self) -> Option<Id<NSString, Shared>>;
#[method_id(@__retain_semantics Other URLByAppendingPathComponent:)]
pub unsafe fn URLByAppendingPathComponent(
&self,
pathComponent: &NSString,
) -> Option<Id<NSURL, Shared>>;
#[method_id(@__retain_semantics Other URLByAppendingPathComponent:isDirectory:)]
pub unsafe fn URLByAppendingPathComponent_isDirectory(
&self,
pathComponent: &NSString,
isDirectory: bool,
) -> Option<Id<NSURL, Shared>>;
#[method_id(@__retain_semantics Other URLByDeletingLastPathComponent)]
pub unsafe fn URLByDeletingLastPathComponent(&self) -> Option<Id<NSURL, Shared>>;
#[method_id(@__retain_semantics Other URLByAppendingPathExtension:)]
pub unsafe fn URLByAppendingPathExtension(
&self,
pathExtension: &NSString,
) -> Option<Id<NSURL, Shared>>;
#[method_id(@__retain_semantics Other URLByDeletingPathExtension)]
pub unsafe fn URLByDeletingPathExtension(&self) -> Option<Id<NSURL, Shared>>;
#[method_id(@__retain_semantics Other URLByStandardizingPath)]
pub unsafe fn URLByStandardizingPath(&self) -> Option<Id<NSURL, Shared>>;
#[method_id(@__retain_semantics Other URLByResolvingSymlinksInPath)]
pub unsafe fn URLByResolvingSymlinksInPath(&self) -> Option<Id<NSURL, Shared>>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSFileSecurity;
unsafe impl ClassType for NSFileSecurity {
type Super = NSObject;
}
);
extern_methods!(
unsafe impl NSFileSecurity {
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Option<Allocated<Self>>,
coder: &NSCoder,
) -> Option<Id<Self, Shared>>;
}
);
extern_methods!(
unsafe impl NSURL {
#[method_id(@__retain_semantics Other resourceDataUsingCache:)]
pub unsafe fn resourceDataUsingCache(
&self,
shouldUseCache: bool,
) -> Option<Id<NSData, Shared>>;
#[method(loadResourceDataNotifyingClient:usingCache:)]
pub unsafe fn loadResourceDataNotifyingClient_usingCache(
&self,
client: &Object,
shouldUseCache: bool,
);
#[method_id(@__retain_semantics Other propertyForKey:)]
pub unsafe fn propertyForKey(&self, propertyKey: &NSString) -> Option<Id<Object, Shared>>;
#[method(setResourceData:)]
pub unsafe fn setResourceData(&self, data: &NSData) -> bool;
#[method(setProperty:forKey:)]
pub unsafe fn setProperty_forKey(&self, property: &Object, propertyKey: &NSString) -> bool;
#[method_id(@__retain_semantics Other URLHandleUsingCache:)]
pub unsafe fn URLHandleUsingCache(
&self,
shouldUseCache: bool,
) -> Option<Id<NSURLHandle, Shared>>;
}
);