mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
Merge pull request #154 from triplef/nsurl-additions
Add various NSURL methods.
This commit is contained in:
commit
95a71ea552
4 changed files with 59 additions and 1 deletions
|
@ -1,3 +1,12 @@
|
|||
2020-10-06-03 Frederik Seiffert <frederik@algoriddim.com>
|
||||
|
||||
* Headers/Foundation/NSURL.h,
|
||||
* Source/NSURL.h: Add NSURL methods:
|
||||
- URLByAppendingPathComponent:isDirectory:
|
||||
- isFileReferenceURL (always returns NO)
|
||||
- fileReferenceURL
|
||||
- filePathURL
|
||||
|
||||
2020-08-30 Fred Kiefer <fredkiefer@gmx.de>
|
||||
|
||||
* Source/NSDateComponentsFormatter.m: Fix use of wrong operator.
|
||||
|
|
|
@ -411,7 +411,23 @@ enum
|
|||
|
||||
#endif
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_7, GS_API_LATEST)
|
||||
/** Returns a URL formed by adding a path component to the path of the
|
||||
* receiver, along with a trailing slash if the component is designated a
|
||||
* directory.<br />
|
||||
* See [NSString-stringByAppendingPathComponent:].
|
||||
*/
|
||||
- (NSURL *) URLByAppendingPathComponent:(NSString *)pathComponent
|
||||
isDirectory:(BOOL)isDirectory;
|
||||
#endif
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST)
|
||||
- (BOOL) isFileReferenceURL;
|
||||
|
||||
- (NSURL *) fileReferenceURL;
|
||||
|
||||
- (NSURL *) filePathURL;
|
||||
|
||||
- (BOOL) getResourceValue: (id*)value
|
||||
forKey: (NSString *)key
|
||||
error: (NSError**)error;
|
||||
|
|
1
MISSING
1
MISSING
|
@ -774,7 +774,6 @@ NSURL:
|
|||
- stopAccessingSecurityScopedResource
|
||||
- stringByAddingPercentEscapesUsingEncoding:
|
||||
- stringByReplacingPercentEscapesUsingEncoding:
|
||||
- URLByAppendingPathComponent:isDirectory:
|
||||
-------------------------------------------------------------
|
||||
NSURLAuthenticationChallenge:
|
||||
- performDefaultHandlingForAuthenticationChallenge:
|
||||
|
|
|
@ -1539,6 +1539,29 @@ static NSUInteger urlAlign;
|
|||
return [[self path] lastPathComponent];
|
||||
}
|
||||
|
||||
- (BOOL) isFileReferenceURL
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (NSURL *) fileReferenceURL
|
||||
{
|
||||
if ([self isFileURL])
|
||||
{
|
||||
return self;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSURL *) filePathURL
|
||||
{
|
||||
if ([self isFileURL])
|
||||
{
|
||||
return self;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (BOOL) getResourceValue: (id*)value
|
||||
forKey: (NSString *)key
|
||||
error: (NSError**)error
|
||||
|
@ -1951,6 +1974,17 @@ static NSUInteger urlAlign;
|
|||
return self;
|
||||
}
|
||||
|
||||
- (NSURL *) URLByAppendingPathComponent:(NSString *)pathComponent
|
||||
isDirectory:(BOOL)isDirectory
|
||||
{
|
||||
NSString *path = [[self path] stringByAppendingPathComponent: pathComponent];
|
||||
if (isDirectory)
|
||||
{
|
||||
path = [path stringByAppendingString: @"/"];
|
||||
}
|
||||
return [self _URLBySettingPath: path];
|
||||
}
|
||||
|
||||
- (void) URLHandle: (NSURLHandle*)sender
|
||||
resourceDataDidBecomeAvailable: (NSData*)newData
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue