([CStream -_initForReadingFromPostSignatureStream:

withFormatVersion:]): New method.
([CStream +cStreamReadingFromStream:s]): Use it.
([CStream -initForReadingFromStream:swithFormatVersion:]): Likewise.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2046 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
mccallum 1997-01-12 18:49:08 +00:00
parent 0320e52de8
commit 716944318c

View file

@ -1,5 +1,5 @@
/* Implementation of GNU Objective-C class for streaming C types and indentatn /* Implementation of GNU Objective-C class for streaming C types and indentatn
Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
Written by: Andrew Kachites McCallum <mccallum@gnu.ai.mit.edu> Written by: Andrew Kachites McCallum <mccallum@gnu.ai.mit.edu>
Date: July 1994 Date: July 1994
@ -103,11 +103,20 @@ id CStreamSignatureMismatchException = @"CStreamSignatureMismatchException";
return self; return self;
} }
- initForReadingFromStream: (id <Streaming>) s /* This is the designated initializer for reading. */
withFormatVersion: (int)version - _initForReadingFromPostSignatureStream: (id <Streaming>)s
withFormatVersion: (int)version
{ {
[self _initWithStream: s [self _initWithStream: s
formatVersion: version]; formatVersion: version];
return self;
}
- initForReadingFromStream: (id <Streaming>) s
withFormatVersion: (int)version
{
[self notImplemented: _cmd];
/* xxx Why this condition? -mccallum */
if ([stream streamPosition] != 0) if ([stream streamPosition] != 0)
{ {
char name[128]; /* max class name length. */ char name[128]; /* max class name length. */
@ -121,6 +130,8 @@ id CStreamSignatureMismatchException = @"CStreamSignatureMismatchException";
[NSException raise: CStreamSignatureMismatchException [NSException raise: CStreamSignatureMismatchException
format: @"CStream found a mismatched signature"]; format: @"CStream found a mismatched signature"];
} }
[self _initForReadingFromPostSignatureStream: s
withFormatVersion: version];
} }
return self; return self;
} }
@ -135,8 +146,8 @@ id CStreamSignatureMismatchException = @"CStreamSignatureMismatchException";
getClassname: name getClassname: name
formatVersion: &version]; formatVersion: &version];
new_cstream = [[objc_lookup_class(name) alloc] new_cstream = [[objc_lookup_class(name) alloc]
_initWithStream: s _initForReadingFromPostSignatureStream: s
formatVersion: version]; withFormatVersion: version];
return [new_cstream autorelease]; return [new_cstream autorelease];
} }