mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Start implementing some secure coding methods.
This commit is contained in:
parent
a9767cdff7
commit
082f87fbc3
2 changed files with 32 additions and 0 deletions
|
@ -460,6 +460,28 @@ static NSDictionary *makeReference(unsigned ref)
|
|||
return AUTORELEASE(d);
|
||||
}
|
||||
|
||||
+ (NSData *) archivedDataWithRootObject: (id)anObject
|
||||
requiringSecureCoding: (BOOL)requiresSecureCoding
|
||||
error: (NSError **)error
|
||||
{
|
||||
NSData *data = nil;
|
||||
if (requiresSecureCoding == YES)
|
||||
{
|
||||
*error = [NSError errorWithDomain: @"NSKeyedArchiver"
|
||||
code: 0
|
||||
userInfo: [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
@"Could not create secure keyed archive",
|
||||
NSLocalizedDescriptionKey, nil]];
|
||||
}
|
||||
else
|
||||
{
|
||||
error = NULL;
|
||||
data = [self archivedDataWithRootObject: anObject];
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
+ (BOOL) archiveRootObject: (id)anObject toFile: (NSString*)aPath
|
||||
{
|
||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue