mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +00:00
Implement -[NSFileManager URLsForDirectory:inDomains:]
This commit is contained in:
parent
930b901558
commit
952e076084
4 changed files with 36 additions and 1 deletions
|
@ -59,6 +59,7 @@
|
|||
#import "Foundation/NSSet.h"
|
||||
#import "Foundation/NSURL.h"
|
||||
#import "Foundation/NSValue.h"
|
||||
#import "GSFastEnumeration.h"
|
||||
#import "GSPrivate.h"
|
||||
#import "GSPThread.h"
|
||||
#import "GNUstepBase/NSString+GNUstepBase.h"
|
||||
|
@ -925,6 +926,20 @@ static gs_mutex_t classLock = GS_MUTEX_INIT_STATIC;
|
|||
return [NSURL fileURLWithPath: path];
|
||||
}
|
||||
|
||||
- (GS_GENERIC_CLASS(NSArray, NSURL *) *)URLsForDirectory: (NSSearchPathDirectory)directory
|
||||
inDomains: (NSSearchPathDomainMask)domain
|
||||
{
|
||||
NSArray *paths = NSSearchPathForDirectoriesInDomains(directory, domain, YES);
|
||||
NSMutableArray *urls = [[NSMutableArray alloc] initWithCapacity: paths.count];
|
||||
|
||||
FOR_IN(NSString *, path, paths)
|
||||
[urls addObject: [NSURL fileURLWithPath: path]];
|
||||
END_FOR_IN(paths)
|
||||
|
||||
RELEASE(paths);
|
||||
return urls;
|
||||
}
|
||||
|
||||
- (NSDirectoryEnumerator*) enumeratorAtURL: (NSURL*)url
|
||||
includingPropertiesForKeys: (NSArray*)keys
|
||||
options: (NSDirectoryEnumerationOptions)mask
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue