mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Allow easy user-modification of concrete class. Removed references to
NSGData. ([NSArchiver +_setConcreteClass:]): New method. ([NSArchiver +_concreteClass]): New method. ([NSArchiver +initialize]): New method. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@490 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
dae6bee1a3
commit
adf8c49d78
1 changed files with 19 additions and 3 deletions
|
@ -24,11 +24,27 @@
|
|||
#include <objects/stdobjects.h>
|
||||
#include <Foundation/NSArchiver.h>
|
||||
#include <Foundation/NSGArchiver.h>
|
||||
#include <Foundation/NSGData.h>
|
||||
#include <objects/NSCoder.h>
|
||||
|
||||
@implementation NSArchiver
|
||||
|
||||
static Class NSArchiver_concrete_class;
|
||||
|
||||
+ (void) _setConcreteClass: (Class)c
|
||||
{
|
||||
NSArchiver_concrete_class = c;
|
||||
}
|
||||
|
||||
+ (Class) _concreteClass
|
||||
{
|
||||
return NSArchiver_concrete_class;
|
||||
}
|
||||
|
||||
+ (void) initialize
|
||||
{
|
||||
NSArchiver_concrete_class = [NSGArchiver class];
|
||||
}
|
||||
|
||||
// Initializing an archiver
|
||||
|
||||
/* This is the designated initializer */
|
||||
|
@ -43,8 +59,8 @@
|
|||
+ (NSData*) archivedDataWithRootObject: (id)rootObject
|
||||
{
|
||||
/* xxx a quick kludge implementation */
|
||||
id d = [[NSGMutableData alloc] init];
|
||||
id a = [[NSGArchiver alloc] initForWritingWithMutableData:d];
|
||||
id d = [[NSMutableData alloc] init];
|
||||
id a = [[NSArchiver alloc] initForWritingWithMutableData:d];
|
||||
[a encodeRootObject:rootObject];
|
||||
return [d autorelease];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue