add coding

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30857 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2010-06-25 17:57:03 +00:00
parent 0bc859e03e
commit f531e36f64

View file

@ -25,6 +25,7 @@
#import "common.h"
#import "Foundation/NSLocale.h"
#import "Foundation/NSArray.h"
#import "Foundation/NSCoder.h"
#import "Foundation/NSDictionary.h"
#import "Foundation/NSLock.h"
#import "Foundation/NSUserDefaults.h"
@ -569,25 +570,21 @@ static NSArray *_currencyCodesWithType (uint32_t currType)
{
RELEASE(_localeId);
RELEASE(_components);
[super dealloc];
}
//
// NSCoding
//
- (void) encodeWithCoder: (NSCoder *) encoder
- (void) encodeWithCoder: (NSCoder*)encoder
{
[encoder encodeObject: _localeId];
}
- (id) initWithCoder: (NSCoder *) decoder
- (id) initWithCoder: (NSCoder*)decoder
{
return nil;
NSString *s = [decoder decodeObject];
return [self initWithLocaleIdentifier: s];
}
//
// NSCopying
//
- (id) copyWithZone: (NSZone *) zone
{
return RETAIN(self);