mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Further implementation
This commit is contained in:
parent
6e175942c2
commit
f2b3b97708
1 changed files with 11 additions and 2 deletions
|
@ -31,11 +31,13 @@
|
|||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSURL.h>
|
||||
#include <Foundation/NSPersonNameComponents.h>
|
||||
#include <Foundation/NSFileManager.h>
|
||||
|
||||
@interface NSFileVersion (Private)
|
||||
- (void) _setURL: (NSURL *)u;
|
||||
- (void) _setContentsURL: (NSURL *)u;
|
||||
- (void) _setConflict: (BOOL)f;
|
||||
- (void) _setLocalizedName: (NSString *)name;
|
||||
@end
|
||||
|
||||
@implementation NSFileVersion (Private)
|
||||
|
@ -53,6 +55,11 @@
|
|||
{
|
||||
_conflict = f;
|
||||
}
|
||||
|
||||
- (void) _setLocalizedName: (NSString *)name
|
||||
{
|
||||
ASSIGNCOPY(_localizedName, name);
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation NSFileVersion
|
||||
|
@ -66,6 +73,7 @@
|
|||
[fileVersion _setURL: url];
|
||||
[fileVersion _setContentsURL: url];
|
||||
[fileVersion _setConflict: NO];
|
||||
[fileVersion _setLocalizedName: [url path]];
|
||||
[fileVersion setDiscardable: NO];
|
||||
[fileVersion setResolved: YES];
|
||||
}
|
||||
|
@ -80,7 +88,7 @@
|
|||
+ (NSFileVersion *)versionOfItemAtURL: (NSURL *)url
|
||||
forPersistentIdentifier: (id)persistentIdentifier
|
||||
{
|
||||
return nil;
|
||||
return [NSFileVersion currentVersionOfItemAtURL: url];
|
||||
}
|
||||
|
||||
+ (NSURL *)temporaryDirectoryURLForNewVersionOfItemAtURL: (NSURL *)url
|
||||
|
@ -104,7 +112,8 @@
|
|||
+ (BOOL)removeOtherVersionsOfItemAtURL: (NSURL *)url
|
||||
error: (NSError **)outError
|
||||
{
|
||||
return NO;
|
||||
NSFileManager *mgr = [NSFileManager defaultManager];
|
||||
return [mgr removeItemAtPath: [url path] error: outError];
|
||||
}
|
||||
|
||||
// Instance methods...
|
||||
|
|
Loading…
Reference in a new issue