Convert to new Coder scheme. Use -initWithCoder instead

of +newWithCoder where appropriate.  Remove arguments typed
(Coder*).  Replace +_newCollectionWithCoder with
-_initCollectionWithCoder.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@333 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Andrew McCallum 1995-04-09 01:53:53 +00:00
parent 779629a90d
commit 0dc629b0ae
29 changed files with 257 additions and 211 deletions

View file

@ -1,5 +1,5 @@
/* Implementation for Objective-C Array collection object
Copyright (C) 1993,1994 Free Software Foundation, Inc.
Copyright (C) 1993,1994, 1995 Free Software Foundation, Inc.
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
Date: May 1993
@ -78,23 +78,23 @@
withName:"Array Capacity"];
}
+ _newCollectionWithCoder: (Coder*)coder
- _initCollectionWithCoder: (Coder*)coder
{
char *encoding;
Array *n = [super _newCollectionWithCoder:coder];
[super _initCollectionWithCoder:coder];
[coder decodeValueOfSimpleType:@encode(char*)
at:&encoding
withName:NULL];
n->_comparison_function = elt_get_comparison_function(encoding);
_comparison_function = elt_get_comparison_function(encoding);
[coder decodeValueOfSimpleType:@encode(unsigned)
at:&(n->_grow_factor)
at:&_grow_factor
withName:NULL];
n->_count = 0;
_count = 0;
[coder decodeValueOfSimpleType:@encode(unsigned)
at:&(n->_capacity)
at:&_capacity
withName:NULL];
OBJC_MALLOC(n->_contents_array, elt, n->_capacity);
return n;
OBJC_MALLOC(_contents_array, elt, _capacity);
return self;
}
- _writeInit: (TypedStream*)aStream

View file

@ -1,5 +1,5 @@
/* Implementation for Objective-C BinaryTree collection object
Copyright (C) 1993,1994 Free Software Foundation, Inc.
Copyright (C) 1993,1994, 1995 Free Software Foundation, Inc.
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
Date: May 1993
@ -53,13 +53,12 @@ static id nilBinaryTreeNode;
/* Archiving must mimic the above designated initializer */
+ _newCollectionWithCoder: (Coder*)aCoder
- _initCollectionWithCoder: aCoder
{
BinaryTree *n;
n = [super _newCollectionWithCoder:aCoder];
n->_count = 0;
n->_contents_root = [self nilNode];
return n;
[super _initCollectionWithCoder:aCoder];
_count = 0;
_contents_root = [self nilNode];
return self;
}
- (void) _encodeContentsWithCoder: (Coder*)aCoder

View file

@ -1,5 +1,5 @@
/* Implementation for Objective-C BinaryTreeNode object
Copyright (C) 1993,1994 Free Software Foundation, Inc.
Copyright (C) 1993,1994, 1995 Free Software Foundation, Inc.
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
Date: May 1993
@ -38,21 +38,21 @@
return self;
}
- (void) encodeWithCoder: (Coder*)aCoder
- (void) encodeWithCoder: aCoder
{
[super encodeWithCoder:aCoder];
[super encodeWithCoder:(id)aCoder];
[aCoder encodeObjectReference:_right withName:"Right BinaryTree Node"];
[aCoder encodeObjectReference:_left withName:"Left BinaryTree Node"];
[aCoder encodeObjectReference:_parent withName:"Parent BinaryTree Node"];
}
+ newWithCoder: (Coder*)aCoder
- initWithCoder: aCoder
{
BinaryTreeNode *n = [super newWithCoder:aCoder];
[aCoder decodeObjectAt:&(n->_right) withName:NULL];
[aCoder decodeObjectAt:&(n->_left) withName:NULL];
[aCoder decodeObjectAt:&(n->_parent) withName:NULL];
return n;
[super initWithCoder:aCoder];
[aCoder decodeObjectAt:&_right withName:NULL];
[aCoder decodeObjectAt:&_left withName:NULL];
[aCoder decodeObjectAt:&_parent withName:NULL];
return self;
}
- leftNode

View file

@ -1,5 +1,5 @@
/* Implementation for GNU Objective-C CString object
Copyright (C) 1993,1994 Free Software Foundation, Inc.
Copyright (C) 1993,1994, 1995 Free Software Foundation, Inc.
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
Date: July 1994
@ -52,13 +52,13 @@
withName:"Concrete String content_chars"];
}
+ newWithCoder: aCoder
- initWithCoder: aCoder
{
CString *n = [super newWithCoder:aCoder];
[aCoder decodeValueOfType:@encode(char*) at:&(n->_contents_chars)
[super initWithCoder:aCoder];
[aCoder decodeValueOfType:@encode(char*) at:&_contents_chars
withName:NULL];
n->_count = strlen(n->_contents_chars);
return n;
_count = strlen(_contents_chars);
return self;
}
/* Empty copy must empty an allocCopy'ed version of self */

View file

@ -1,5 +1,5 @@
/* Implementation for Objective-C CircularArray collection object
Copyright (C) 1993,1994 Free Software Foundation, Inc.
Copyright (C) 1993,1994, 1995 Free Software Foundation, Inc.
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
Date: May 1993
@ -44,11 +44,11 @@
/* Archiving must mimic the above designated initializer */
+ _newCollectionWithCoder: (Coder*)coder
- _initCollectionWithCoder: coder
{
CircularArray *n = [super newWithCoder:coder];
n->_start_index = 0;
return n;
[super _initCollectionWithCoder:coder];
_start_index = 0;
return self;
}
- _readInit: (TypedStream*)aStream

View file

@ -1,5 +1,5 @@
/* Implementation for Objective-C Collection object
Copyright (C) 1993,1994 Free Software Foundation, Inc.
Copyright (C) 1993,1994, 1995 Free Software Foundation, Inc.
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
Date: May 1993
@ -1218,17 +1218,17 @@ for info about latest version.",
return licenseString;
}
- (void) encodeWithCoder: (Coder*)aCoder
- (void) encodeWithCoder: aCoder
{
[self _encodeCollectionWithCoder:aCoder];
[self _encodeContentsWithCoder:aCoder];
}
+ newWithCoder: (Coder*)aCoder
- initWithCoder: aCoder
{
id newCollection = [self _newCollectionWithCoder:aCoder];
[newCollection _decodeContentsWithCoder:aCoder];
return newCollection;
[self _initCollectionWithCoder:aCoder];
[self _decodeContentsWithCoder:aCoder];
return self;
}
@end
@ -1236,17 +1236,17 @@ for info about latest version.",
@implementation Collection (ArchivingHelpers)
- (void) _encodeCollectionWithCoder: (Coder*) aCoder
- (void) _encodeCollectionWithCoder: aCoder
{
[super encodeWithCoder:aCoder];
// there are no instance vars;
return;
}
+ _newCollectionWithCoder: (Coder*) aCoder
- _initCollectionWithCoder: aCoder
{
// there are no instance vars;
return [super newWithCoder:aCoder];
return [super initWithCoder:aCoder];
}
- _writeInit: (TypedStream*)aStream

View file

@ -1202,12 +1202,12 @@ static int messagesReceivedCount;
return self;
}
- (void) encodeWithCoder: (Coder*)anEncoder
- (void) encodeWithCoder: anEncoder
{
[self shouldNotImplement:_cmd];
}
+ newWithCoder: (Coder*)aDecoder;
+ newWithCoder: aDecoder;
{
[self shouldNotImplement:_cmd];
return self;

View file

@ -1,5 +1,5 @@
/* Implementation of Objective-C "collection of delegates" object
Copyright (C) 1993,1994 Free Software Foundation, Inc.
Copyright (C) 1993,1994, 1995 Free Software Foundation, Inc.
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
Date: May 1993
@ -51,7 +51,7 @@
/* Archiving must mimic the above designated initializer */
- (void) encodeWithCoder: (Coder*)anEncoder
- (void) encodeWithCoder: anEncoder
{
[anEncoder encodeValueOfSimpleType:@encode(unsigned char)
at:&_send_behavior
@ -60,9 +60,11 @@
withName:"DelegatePool Collection of Delegates"];
}
+ newWithCoder: (Coder*)aDecoder
+ newWithCoder: aDecoder
{
DelegatePool *n = class_create_instance(self);
/* xxx Should be:
DelegatePool *n = NSAllocateObject(self, 0, [aDecoder objectZone]); */
DelegatePool *n = (id) NSAllocateObject(self, 0, NS_NOZONE);
[aDecoder decodeValueOfSimpleType:@encode(unsigned char)
at:&(n->_send_behavior)
withName:NULL];

View file

@ -1,5 +1,5 @@
/* Implementation for Objective-C Dictionary collection object
Copyright (C) 1993,1994 Free Software Foundation, Inc.
Copyright (C) 1993,1994, 1995 Free Software Foundation, Inc.
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
Date: May 1993
@ -63,12 +63,12 @@
/* Archiving must mimic the above designated initializer */
- (void) encodeWithCoder: (Coder*)anEncoder
- (void) encodeWithCoder: anEncoder
{
[self notImplemented:_cmd];
}
+ newWithCoder: (Coder*)aDecoder
+ newWithCoder: aDecoder
{
[self notImplemented:_cmd];
return self;

View file

@ -1,5 +1,5 @@
/* Implementation for Objective-C EltNodeCollector collection object
Copyright (C) 1993,1994 Free Software Foundation, Inc.
Copyright (C) 1993,1994, 1995 Free Software Foundation, Inc.
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
Date: May 1993
@ -91,7 +91,7 @@
/* Archiving must mimic the above designated initializer */
- (void) _encodeCollectionWithCoder: (Coder*)aCoder
- (void) _encodeCollectionWithCoder: aCoder
{
const char *encoding = [self contentType];
@ -102,17 +102,16 @@
withName:"EltNodeCollector Content Node Class"];
}
+ _newCollectionWithCoder: (Coder*) aCoder
- _initCollectionWithCoder: aCoder
{
EltNodeCollector *n;
char *encoding;
n = [super _newCollectionWithCoder:aCoder];
[super _initCollectionWithCoder:aCoder];
[aCoder decodeValueOfType:@encode(char*) at:&encoding withName:NULL];
n->_comparison_function = elt_get_comparison_function(encoding);
[aCoder decodeValueOfType:"#" at:&(n->_node_class) withName:NULL];
n->_contents_collector = nil;
return n;
_comparison_function = elt_get_comparison_function(encoding);
[aCoder decodeValueOfType:"#" at:&_node_class withName:NULL];
_contents_collector = nil;
return self;
}
- (void) _encodeContentsWithCoder: (Coder*)aCoder

View file

@ -1,5 +1,5 @@
/* Implementation for Objective-C GapArray collection object
Copyright (C) 1993,1994 Free Software Foundation, Inc.
Copyright (C) 1993,1994, 1995 Free Software Foundation, Inc.
Written by: Kresten Krab Thorup <krab@iesd.auc.dk>
Dept. of Mathematics and Computer Science, Aalborg U., Denmark
@ -47,12 +47,12 @@
/* Archiving must mimic the above designated initializer */
- (void) encodeWithCoder: (Coder*)anEncoder
- (void) encodeWithCoder: anEncoder
{
[self notImplemented:_cmd];
}
+ newWithCoder: (Coder*)aDecoder
+ newWithCoder: aDecoder
{
[self notImplemented:_cmd];
return self;

View file

@ -1,5 +1,5 @@
/* Implementation for Objective-C LinkedList collection object
Copyright (C) 1993,1994 Free Software Foundation, Inc.
Copyright (C) 1993,1994, 1995 Free Software Foundation, Inc.
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
Date: May 1993
@ -44,16 +44,15 @@
/* Archiving must mimic the above designated initializer */
+ _newCollectionWithCoder: (Coder*)aCoder
- _initCollectionWithCoder: aCoder
{
LinkedList *n;
n = [super _newCollectionWithCoder:aCoder];
n->_count = 0;
n->_first_link = nil;
return n;
[super _initCollectionWithCoder:aCoder];
_count = 0;
_first_link = nil;
return self;
}
- (void) _encodeContentsWithCoder: (Coder*)aCoder
- (void) _encodeContentsWithCoder: aCoder
{
[aCoder startEncodingInterconnectedObjects];
[super _encodeContentsWithCoder:aCoder];

View file

@ -1,5 +1,5 @@
/* Implementation for Objective-C LinkedListNode object
Copyright (C) 1993,1994 Free Software Foundation, Inc.
Copyright (C) 1993,1994, 1995 Free Software Foundation, Inc.
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
Date: May 1993
@ -39,19 +39,19 @@
return self;
}
- (void) encodeWithCoder: (Coder*)aCoder
- (void) encodeWithCoder: aCoder
{
[super encodeWithCoder:aCoder];
[aCoder encodeObjectReference:_next withName:"Next LinkedList Node"];
[aCoder encodeObjectReference:_prev withName:"Prev LinkedList Node"];
}
+ newWithCoder: (Coder*)aCoder
- initWithCoder: aCoder
{
LinkedListNode *n = [super newWithCoder:aCoder];
[aCoder decodeObjectAt:&(n->_next) withName:NULL];
[aCoder decodeObjectAt:&(n->_prev) withName:NULL];
return n;
[super initWithCoder:aCoder];
[aCoder decodeObjectAt:&_next withName:NULL];
[aCoder decodeObjectAt:&_prev withName:NULL];
return self;
}
- (id <LinkedListComprising>) nextLink

View file

@ -1,5 +1,5 @@
/* Implementation for Objective-C MappedCollector collection object
Copyright (C) 1993,1994 Free Software Foundation, Inc.
Copyright (C) 1993,1994, 1995 Free Software Foundation, Inc.
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
Date: May 1993
@ -42,12 +42,12 @@
/* Archiving must mimic the above designated initializer */
- (void) encodeWithCoder: (Coder*)anEncoder
- (void) encodeWithCoder: anEncoder
{
[self notImplemented:_cmd];
}
+ newWithCoder: (Coder*)aDecoder
+ newWithCoder: aDecoder
{
[self notImplemented:_cmd];
return self;

View file

@ -1,5 +1,5 @@
/* Implementation of GNU Objective C memory stream
Copyright (C) 1994 Free Software Foundation, Inc.
Copyright (C) 1994, 1995 Free Software Foundation, Inc.
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
Date: July 1994
@ -99,12 +99,12 @@ static BOOL debug_memory_stream = YES;
return [self initWithSize: DEFAULT_MEMORY_STREAM_SIZE];
}
- (void) encodeWithCoder: (Coder*)anEncoder
- (void) encodeWithCoder: anEncoder
{
[self notImplemented:_cmd];
}
+ newWithCoder: (Coder*)aDecoder
+ newWithCoder: aDecoder
{
[self notImplemented:_cmd];
return self;

View file

@ -117,17 +117,17 @@ stringDecrementCountAndFillHoleAt(MutableCStringStruct *self,
withName:"String content_chars"];
}
+ newWithCoder: aCoder
- initWithCoder: aCoder
{
MutableCString *n;
unsigned cap;
[aCoder decodeValueOfType:@encode(unsigned) at:&cap withName:NULL];
n = [[MutableCString alloc] initWithCapacity:cap];
[aCoder decodeValueOfType:@encode(char*) at:&(n->_contents_chars)
[self initWithCapacity:cap];
[aCoder decodeValueOfType:@encode(char*) at:_contents_chars
withName:NULL];
n->_count = strlen(n->_contents_chars);
n->_capacity = cap;
_count = strlen(_contents_chars);
_capacity = cap;
return n;
}

View file

@ -1,7 +1,8 @@
/* NSCoder - coder obejct for serialization and persistance.
/* NSCoder - coder object for serialization and persistance.
Copyright (C) 1995 Free Software Foundation, Inc.
Written by: Adam Fedor <fedor@boulder.colorado.edu>
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
From skeleton by: Adam Fedor <fedor@boulder.colorado.edu>
Date: Mar 1995
This file is part of the GNU Objective C Class Library.
@ -21,143 +22,184 @@
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <objects/stdobjects.h>
#include <foundation/NSCoder.h>
#include <foundation/NSConcreteCoder.h>
#include <objects/NSCoder.h>
@implementation NSCoder
// Encoding Data
- (void)encodeArrayOfObjCType:(const char *)types
count:(unsigned)count
at:(const void *)array
- (void) encodeArrayOfObjCType: (const char*)type
count: (unsigned)count
at: (const void*)array
{
int i, size = objc_sizeof_type(type);
const char *where = array;
[self encodeValueOfObjCType:@encode(unsigned)
at:&count];
for (i = 0; i < count; i++, where += size)
[self encodeValueOfObjCType:type
at:where];
}
- (void) encodeBycopyObject: (id)anObject;
{
[self encodeObject:anObject];
}
- (void) encodeConditionalObject: (id)anObject;
{
[self encodeObject:anObject];
}
- (void) encodeDataObject: (NSData*)data;
{
[self notImplemented:_cmd];
}
- (void)encodeBycopyObject:(id)anObject;
- (void) encodeObject: (id)anObject;
{
[self notImplemented:_cmd];
}
- (void)encodeConditionalObject:(id)anObject;
- (void) encodePropertyList: (id)plist;
{
[self notImplemented:_cmd];
}
- (void)encodeDataObject:(NSData *)data;
- (void) encodePoint: (NSPoint)point;
{
[self encodeValueOfObjCType:@encode(NSPoint)
at:&point];
}
- (void) encodeRect: (NSRect)rect;
{
[self encodeValueOfObjCType:@encode(NSRect)
at:&rect];
}
- (void) encodeRootObject: (id)rootObject;
{
[self encodeObject:rootObject];
}
- (void) encodeSize: (NSSize)size;
{
[self encodeValueOfObjCType:@encode(NSSize)
at:&size];
}
- (void) encodeValueOfObjCType: (const char*)type
at: (const void*)address;
{
[self notImplemented:_cmd];
}
- (void)encodeObject:(id)anObject;
- (void) encodeValuesOfObjCTypes: (const char*)types,...;
{
[self notImplemented:_cmd];
}
- (void)encodePropertyList:(id)plist;
{
[self notImplemented:_cmd];
}
- (void)encodePoint:(NSPoint)point;
{
[self notImplemented:_cmd];
}
- (void)encodeRect:(NSRect)rect;
{
[self notImplemented:_cmd];
}
- (void)encodeRootObject:(id)rootObject;
{
[self notImplemented:_cmd];
}
- (void)encodeSize:(NSSize)size;
{
[self notImplemented:_cmd];
}
- (void)encodeValueOfObjCType:(const char *)type
at:(const void *)address;
{
[self notImplemented:_cmd];
}
- (void)encodeValuesOfObjCTypes:(const char *)types,...;
{
[self notImplemented:_cmd];
va_list ap;
va_start(ap, types);
while (*types)
{
[self encodeValueOfObjCType:types
at:va_arg(ap, void*)];
types = objc_skip_typespec(types);
}
va_end(ap);
}
// Decoding Data
- (void)decodeArrayOfObjCType:(const char *)types
count:(unsigned)count
at:(void *)address;
- (void) decodeArrayOfObjCType: (const char*)type
count: (unsigned)count
at: (void*)address;
{
[self notImplemented:_cmd];
unsigned encoded_count;
int i, size = objc_sizeof_type(type);
char *where = address;
[self decodeValueOfObjCType:@encode(unsigned)
at:&encoded_count];
assert(encoded_count == count); /* xxx fix this */
for (i = 0; i < count; i++, where += size)
[self decodeValueOfObjCType:type
at:where];
}
- (NSData *)decodeDataObject;
- (NSData*) decodeDataObject;
{
[self notImplemented:_cmd];
return nil;
}
- (id)decodeObject;
- (id) decodeObject;
{
[self notImplemented:_cmd];
return nil;
}
- (id)decodePropertyList
- (id) decodePropertyList
{
[self notImplemented:_cmd];
return nil;
}
- (NSPoint)decodePoint
- (NSPoint) decodePoint
{
NSPoint point;
[self notImplemented:_cmd];
[self decodeValueOfObjCType:@encode(NSPoint)
at:&point];
return point;
}
- (NSRect)decodeRect
- (NSRect) decodeRect
{
NSRect rect;
[self notImplemented:_cmd];
[self decodeValueOfObjCType:@encode(NSRect)
at:&rect];
return rect;
}
- (NSSize)decodeSize
- (NSSize) decodeSize
{
NSSize size;
[self notImplemented:_cmd];
[self decodeValueOfObjCType:@encode(NSSize)
at:&size];
return size;
}
- (void)decodeValueOfObjCType:(const char *)type
at:(void *)address
- (void) decodeValueOfObjCType: (const char*)type
at: (void*)address
{
[self notImplemented:_cmd];
}
- (void)decodeValuesOfObjCTypes:(const char *)types,...;
- (void) decodeValuesOfObjCTypes: (const char*)types,...;
{
[self notImplemented:_cmd];
va_list ap;
va_start(ap, types);
while (*types)
{
[self decodeValueOfObjCType:types
at:va_arg(ap, void*)];
types = objc_skip_typespec(types);
}
va_end(ap);
}
// Managing Zones
- (NSZone *)objectZone;
- (NSZone*) objectZone;
{
[self notImplemented:_cmd];
return (NSZone *)0;
return (NSZone*)0;
}
- (void)setObjectZone:(NSZone *)zone;
- (void) setObjectZone: (NSZone*)zone;
{
[self notImplemented:_cmd];
}
@ -165,13 +207,13 @@
// Getting a Version
- (unsigned int)systemVersion;
- (unsigned int) systemVersion;
{
[self notImplemented:_cmd];
return 0;
}
- (unsigned int)versionForClassName:(NSString *)className;
- (unsigned int) versionForClassName: (NSString*)className;
{
[self notImplemented:_cmd];
return 0;

View file

@ -55,13 +55,13 @@
withName:"Concrete String content_chars"];
}
+ newWithCoder: aCoder
- initWithCoder: aCoder
{
NSCString *n = [super newWithCoder:aCoder];
[aCoder decodeValueOfType:@encode(char*) at:&(n->_contents_chars)
[super initWithCoder:aCoder];
[aCoder decodeValueOfType:@encode(char*) at:&_contents_chars
withName:NULL];
n->_count = strlen(n->_contents_chars);
return n;
_count = strlen(_contents_chars);
return self;
}
/* Empty copy must empty an allocCopy'ed version of self */
@ -245,18 +245,17 @@ stringDecrementCountAndFillHoleAt(NSMutableCStringStruct *self,
withName:"String content_chars"];
}
+ newWithCoder: aCoder
- initWithCoder: aCoder
{
NSMutableCString *n;
unsigned cap;
[aCoder decodeValueOfType:@encode(unsigned) at:&cap withName:NULL];
n = [[NSMutableCString alloc] initWithCapacity:cap];
[aCoder decodeValueOfType:@encode(char*) at:&(n->_contents_chars)
[self initWithCapacity:cap];
[aCoder decodeValueOfType:@encode(char*) at:&_contents_chars
withName:NULL];
n->_count = strlen(n->_contents_chars);
n->_capacity = cap;
return n;
_count = strlen(_contents_chars);
_capacity = cap;
return self;
}
/* For IndexedCollecting protocol */

View file

@ -408,14 +408,14 @@ BOOL NSDecrementExtraRefCountWasZero(id anObject)
return NSZoneFromPtr(self);
}
#if 0 /* waiting until I resolve type conflict with GNU Coding method */
- (void)encodeWithCoder:(NSCoder *)aCoder
#if 1 /* waiting until I resolve type conflict with GNU Coding method */
- (void) encodeWithCoder: (NSCoder*)aCoder
{
return;
}
#endif
- initWithCoder:(NSCoder *)aDecoder
- initWithCoder: (NSCoder*)aDecoder
{
return self;
}

View file

@ -666,6 +666,18 @@
return [[NSMutableCString allocWithZone:zone] initWithString:self];
}
/* NSCoding Protocol */
- (void) encodeWithCoder: anEncoder
{
[super encodeWithCoder:anEncoder];
}
- initWithCoder: aDecoder
{
return [super initWithCoder:aDecoder];
}
@end
@implementation NSString (NSCStringAccess)

View file

@ -1,5 +1,5 @@
/* Implementation of abstract superclass port for use with Connection
Copyright (C) 1994 Free Software Foundation, Inc.
Copyright (C) 1994, 1995 Free Software Foundation, Inc.
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
Date: July 1994
@ -97,9 +97,4 @@
[super encodeWithCoder:anEncoder];
}
+ newWithCoder: (Coder*)aDecoder;
{
return [super newWithCoder:aDecoder];
}
@end

View file

@ -1,5 +1,5 @@
/* Implementation for Objective-C RBTreeNode objects
Copyright (C) 1993,1994 Free Software Foundation, Inc.
Copyright (C) 1993,1994, 1995 Free Software Foundation, Inc.
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
Date: May 1993
@ -38,17 +38,17 @@
return self;
}
- (void) encodeWithCoder: (Coder*)aCoder
- (void) encodeWithCoder: aCoder
{
[super encodeWithCoder:aCoder];
[aCoder encodeValueOfType:@encode(BOOL) at:&_red withName:"RBTreeNode isRed"];
}
+ newWithCoder: (Coder*)aCoder
- initWithCoder: aCoder
{
RBTreeNode *n = [super newWithCoder:aCoder];
[aCoder decodeValueOfType:@encode(BOOL) at:&(n->_red) withName:NULL];
return n;
[self initWithCoder:aCoder];
[aCoder decodeValueOfType:@encode(BOOL) at:&_red withName:NULL];
return self;
}
- write: (TypedStream*)aStream

View file

@ -1,5 +1,5 @@
/* Implementation additive congruential pseudo-random num generating
Copyright (C) 1994 Free Software Foundation, Inc.
Copyright (C) 1994, 1995 Free Software Foundation, Inc.
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
Date: July 1994
@ -45,12 +45,12 @@
return self;
}
- (void) encodeWithCoder: (Coder*)anEncoder
- (void) encodeWithCoder: anEncoder
{
[self notImplemented:_cmd];
}
+ newWithCoder: (Coder*)aDecoder
- initWithCoder: aDecoder
{
[self notImplemented:_cmd];
return self;

View file

@ -21,7 +21,7 @@
*/
/*
* Copyright (c) 1983 Regents of the University of California.
* Copyright (c) 1983, 1995 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
@ -428,12 +428,12 @@ static long int *end_ptr = &randtbl[sizeof(randtbl) / sizeof(randtbl[0])];
}
}
- (void) encodeWithCoder: (Coder*)anEncoder
- (void) encodeWithCoder: anEncoder
{
[self notImplemented:_cmd];
}
+ newWithCoder: (Coder*)aDecoder
- initWithCoder: aDecoder
{
[self notImplemented:_cmd];
return self;

View file

@ -1,5 +1,5 @@
/* Implementation Objective-C object providing randoms in uniform distribution
Copyright (C) 1994 Free Software Foundation, Inc.
Copyright (C) 1994, 1995 Free Software Foundation, Inc.
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
Date: July 1994
@ -277,12 +277,12 @@ static id defaultRNG = nil;
return [self randomDouble];
}
- (void) encodeWithCoder: (Coder*)anEncoder
- (void) encodeWithCoder: anEncoder
{
[self notImplemented:_cmd];
}
+ newWithCoder: (Coder*)aDecoder
- initWithCoder: aDecoder
{
[self notImplemented:_cmd];
return self;

View file

@ -1,5 +1,5 @@
/* Implementation for Objective-C Set collection object
Copyright (C) 1993,1994 Free Software Foundation, Inc.
Copyright (C) 1993,1994, 1995 Free Software Foundation, Inc.
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
Date: May 1993
@ -75,24 +75,23 @@
return;
}
+ _newCollectionWithCoder: (Coder*) aCoder
- _initCollectionWithCoder: aCoder
{
Set *newColl;
char *encoding;
unsigned size;
newColl = [super _newCollectionWithCoder:aCoder];
[super _initCollectionWithCoder:aCoder];
[aCoder decodeValueOfSimpleType:@encode(char*)
at:&encoding
withName:NULL];
[aCoder decodeValueOfSimpleType:@encode(unsigned)
at:&size
withName:NULL];
newColl->_contents_hash =
_contents_hash =
coll_hash_new(size,
elt_get_hash_function(encoding),
elt_get_comparison_function(encoding));
return newColl;
return self;
}
- _writeInit: (TypedStream*)aStream

View file

@ -1,5 +1,5 @@
/* Implementation of GNU Objective C byte stream
Copyright (C) 1994 Free Software Foundation, Inc.
Copyright (C) 1994, 1995 Free Software Foundation, Inc.
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
Date: July 1994
@ -138,12 +138,12 @@
}
#endif
- (void) encodeWithCoder: (Coder*)anEncoder
- (void) encodeWithCoder: anEncoder
{
[self notImplemented:_cmd];
}
+ newWithCoder: (Coder*)aDecoder
+ newWithCoder: aDecoder
{
[self notImplemented:_cmd];
return self;

View file

@ -1,5 +1,5 @@
/* Implementation of GNU Objective-C text coder object for use serializing
Copyright (C) 1994 Free Software Foundation, Inc.
Copyright (C) 1994, 1995 Free Software Foundation, Inc.
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
Date: July 1994
@ -274,12 +274,12 @@ if (debug_textcoder) \
}
}
- (void) encodeWithCoder: (Coder*)anEncoder
- (void) encodeWithCoder: anEncoder
{
[self notImplemented:_cmd];
}
+ newWithCoder: (Coder*)aDecoder
+ newWithCoder: aDecoder
{
[self notImplemented:_cmd];
return self;

View file

@ -1,5 +1,5 @@
/* Implementation of Objective-C Time object
Copyright (C) 1993,1994 Free Software Foundation, Inc.
Copyright (C) 1993,1994, 1995 Free Software Foundation, Inc.
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
Date: May 1993
@ -359,12 +359,12 @@ id monthNames;
return diff;
}
- (void) encodeWithCoder: (Coder*)anEncoder
- (void) encodeWithCoder: anEncoder
{
[self notImplemented:_cmd];
}
+ newWithCoder: (Coder*)aDecoder
+ newWithCoder: aDecoder
{
[self notImplemented:_cmd];
return self;