NSURL: add stubs for alias functions

The OSX filesystem implements "aliases", a species of symlink which
tracks its source if it was moved. Create stubs for the NSURL functions
which handle these aliases.
This commit is contained in:
Daniel Ferreira 2017-06-22 06:42:49 +10:00 committed by Ivan Vučica
parent e813dde02c
commit 064df5ba69
2 changed files with 27 additions and 0 deletions

View file

@ -42,6 +42,19 @@ extern "C" {
*/
GS_EXPORT NSString* const NSURLFileScheme;
/** URL Bookmark Resolution Options **/
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST)
typedef NSUInteger NSURLBookmarkResolutionOptions;
enum
{
NSURLBookmarkResolutionWithoutUI = (1 << 8),
NSURLBookmarkResolutionWithoutMounting = (1 << 9),
#if OS_API_VERSION(MAC_OS_X_VERSION_10_7, GS_API_LATEST)
NSURLBookmarkResolutionWithSecurityScope = (1 << 10)
#endif
};
#endif
/**
* This class permits manipulation of URLs and the resources to which they
* refer. They can be used to represent absolute URLs or relative URLs
@ -87,6 +100,12 @@ GS_EXPORT NSString* const NSURLFileScheme;
*/
+ (id) URLWithString: (NSString*)aUrlString;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_10, GS_API_LATEST)
+ (id) URLByResolvingAliasFileAtURL: (NSURL*)url
options: (NSURLBookmarkResolutionOptions)options
error: (NSError**)error;
#endif
/**
* Create and return a URL with the supplied string, which should
* be a string (containing percent escape codes where necessary)

View file

@ -649,6 +649,14 @@ static NSUInteger urlAlign;
relativeToURL: aBaseUrl]);
}
+ (id) URLByResolvingAliasFileAtURL: (NSURL*)url
options: (NSURLBookmarkResolutionOptions)options
error: (NSError**)error
{
// TODO: unimplemented
return nil;
}
- (id) initFileURLWithPath: (NSString*)aPath
{
NSFileManager *mgr = [NSFileManager defaultManager];