mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
Add stub methods for secure unarchiving
This commit is contained in:
parent
b1e43eb5dd
commit
f3555406af
2 changed files with 90 additions and 0 deletions
|
@ -40,6 +40,7 @@ extern "C" {
|
|||
#import <Foundation/NSMapTable.h>
|
||||
#import <Foundation/NSPropertyList.h>
|
||||
|
||||
@class GS_GENERIC_CLASS(NSSet, ElementT);
|
||||
@class NSMutableDictionary, NSMutableData, NSData, NSString;
|
||||
|
||||
/**
|
||||
|
@ -311,6 +312,40 @@ GS_EXPORT_CLASS
|
|||
*/
|
||||
+ (id) unarchiveObjectWithFile: (NSString*)aPath;
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_13,GS_API_LATEST)
|
||||
|
||||
+ (id) unarchivedObjectOfClass: (Class)cls
|
||||
fromData: (NSData*)data
|
||||
error: (NSError**)error;
|
||||
|
||||
+ (id) unarchivedObjectOfClasses: (GS_GENERIC_CLASS(NSSet,Class)*)classes
|
||||
fromData: (NSData*)data
|
||||
error: (NSError**)error;
|
||||
|
||||
#endif
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_VERSION_11_0,GS_API_LATEST)
|
||||
|
||||
+ (NSArray*) unarchivedArrayOfObjectsOfClass: (Class)cls
|
||||
fromData: (NSData*)data
|
||||
error: (NSError**)error;
|
||||
|
||||
+ (NSArray*) unarchivedArrayOfObjectsOfClasses: (GS_GENERIC_CLASS(NSSet,Class)*)classes
|
||||
fromData: (NSData*)data
|
||||
error: (NSError**)error;
|
||||
|
||||
+ (NSDictionary*) unarchivedDictionaryWithKeysOfClass: (Class)keyCls
|
||||
objectsOfClass: (Class)valueCls
|
||||
fromData: (NSData*)data
|
||||
error: (NSError**)error;
|
||||
|
||||
+ (NSDictionary*) unarchivedDictionaryWithKeysOfClasses: (GS_GENERIC_CLASS(NSSet,Class)*)keyClasses
|
||||
objectsOfClasses: (GS_GENERIC_CLASS(NSSet,Class)*)valueClasses
|
||||
fromData: (NSData*)data
|
||||
error: (NSError**)error;
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Returns whether the current instance of the archiver needs secure
|
||||
* coding.
|
||||
|
|
|
@ -354,6 +354,61 @@ static NSMapTable *globalClassMap = 0;
|
|||
return o;
|
||||
}
|
||||
|
||||
+ (id) unarchivedObjectOfClass: (Class)cls
|
||||
fromData: (NSData*)data
|
||||
error: (NSError**)error
|
||||
{
|
||||
return [self unarchivedObjectOfClasses: [NSSet setWithObject:cls]
|
||||
fromData: data
|
||||
error: error];
|
||||
}
|
||||
|
||||
+ (id) unarchivedObjectOfClasses: (GS_GENERIC_CLASS(NSSet,Class)*)classes
|
||||
fromData: (NSData*)data
|
||||
error: (NSError**)error
|
||||
{
|
||||
/* FIXME: implement proper secure coding support */
|
||||
return [self unarchiveObjectWithData: data];
|
||||
}
|
||||
|
||||
+ (NSArray*) unarchivedArrayOfObjectsOfClass: (Class)cls
|
||||
fromData: (NSData*)data
|
||||
error: (NSError**)error
|
||||
{
|
||||
return [self unarchivedArrayOfObjectsOfClasses: [NSSet setWithObject:cls]
|
||||
fromData: data
|
||||
error: error];
|
||||
}
|
||||
|
||||
+ (NSArray*) unarchivedArrayOfObjectsOfClasses: (GS_GENERIC_CLASS(NSSet,Class)*)classes
|
||||
fromData: (NSData*)data
|
||||
error: (NSError**)error
|
||||
{
|
||||
/* FIXME: implement proper secure coding support */
|
||||
return [self unarchiveObjectWithData: data];
|
||||
}
|
||||
|
||||
+ (NSDictionary*) unarchivedDictionaryWithKeysOfClass: (Class)keyCls
|
||||
objectsOfClass: (Class)valueCls
|
||||
fromData: (NSData*)data
|
||||
error: (NSError**)error
|
||||
{
|
||||
return [self unarchivedDictionaryWithKeysOfClasses: [NSSet setWithObject:keyCls]
|
||||
objectsOfClasses: [NSSet setWithObject:valueCls]
|
||||
fromData: data
|
||||
error: error];
|
||||
}
|
||||
|
||||
+ (NSDictionary*) unarchivedDictionaryWithKeysOfClasses: (GS_GENERIC_CLASS(NSSet,Class)*)keyClasses
|
||||
objectsOfClasses: (GS_GENERIC_CLASS(NSSet,Class)*)valueClasses
|
||||
fromData: (NSData*)data
|
||||
error: (NSError**)error
|
||||
{
|
||||
/* FIXME: implement proper secure coding support */
|
||||
return [self unarchiveObjectWithData: data];
|
||||
}
|
||||
|
||||
|
||||
- (BOOL) allowsKeyedCoding
|
||||
{
|
||||
return YES;
|
||||
|
|
Loading…
Reference in a new issue