mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
Added beginnings of an implementation.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@359 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
33ac515c6a
commit
26dfc2eb83
1 changed files with 53 additions and 1 deletions
|
@ -23,10 +23,62 @@
|
|||
|
||||
#include <objects/stdobjects.h>
|
||||
#include <foundation/NSArchiver.h>
|
||||
#include <foundation/NSGNUArchiver.h>
|
||||
#include <foundation/NSGArchiver.h>
|
||||
#include <foundation/NSGData.h>
|
||||
#include <objects/NSCoder.h>
|
||||
|
||||
@implementation NSArchiver
|
||||
|
||||
// Initializing an archiver
|
||||
|
||||
/* This is the designated initializer */
|
||||
- (id) initForWritingWithMutableData: (NSMutableData*)mdata
|
||||
{
|
||||
[self notImplemented:_cmd];
|
||||
return nil;
|
||||
}
|
||||
|
||||
// Archiving Data
|
||||
|
||||
+ (NSData*) archivedDataWithRootObject: (id)rootObject
|
||||
{
|
||||
/* xxx a quick kludge implementation */
|
||||
id d = [[NSGMutableData alloc] init];
|
||||
id a = [[NSGArchiver alloc] initForWritingWithMutableData:d];
|
||||
[a encodeRootObject:rootObject];
|
||||
return [d autorelease];
|
||||
}
|
||||
|
||||
+ (BOOL) archiveRootObject: (id)rootObject toFile: (NSString*)path
|
||||
{
|
||||
/* xxx a quick kludge implementation */
|
||||
id d = [self archivedDataWithRootObject:rootObject];
|
||||
[d writeToFile:path atomically:NO];
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
// Getting data from the archiver
|
||||
|
||||
- (NSMutableData*) archiverData
|
||||
{
|
||||
[self notImplemented:_cmd];
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
// Substituting Classes
|
||||
|
||||
+ (NSString*) classNameEncodedForTrueClassName: (NSString*)trueName
|
||||
{
|
||||
[self notImplemented:_cmd];
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void) enocdeClassName: (NSString*)trueName
|
||||
intoClassName: (NSString*)inArchiveName
|
||||
{
|
||||
[self notImplemented:_cmd];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue