mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
([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:
parent
0320e52de8
commit
716944318c
1 changed files with 16 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
|||
/* 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>
|
||||
Date: July 1994
|
||||
|
@ -103,11 +103,20 @@ id CStreamSignatureMismatchException = @"CStreamSignatureMismatchException";
|
|||
return self;
|
||||
}
|
||||
|
||||
- initForReadingFromStream: (id <Streaming>) s
|
||||
withFormatVersion: (int)version
|
||||
/* This is the designated initializer for reading. */
|
||||
- _initForReadingFromPostSignatureStream: (id <Streaming>)s
|
||||
withFormatVersion: (int)version
|
||||
{
|
||||
[self _initWithStream: s
|
||||
formatVersion: version];
|
||||
return self;
|
||||
}
|
||||
|
||||
- initForReadingFromStream: (id <Streaming>) s
|
||||
withFormatVersion: (int)version
|
||||
{
|
||||
[self notImplemented: _cmd];
|
||||
/* xxx Why this condition? -mccallum */
|
||||
if ([stream streamPosition] != 0)
|
||||
{
|
||||
char name[128]; /* max class name length. */
|
||||
|
@ -121,6 +130,8 @@ id CStreamSignatureMismatchException = @"CStreamSignatureMismatchException";
|
|||
[NSException raise: CStreamSignatureMismatchException
|
||||
format: @"CStream found a mismatched signature"];
|
||||
}
|
||||
[self _initForReadingFromPostSignatureStream: s
|
||||
withFormatVersion: version];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
@ -135,8 +146,8 @@ id CStreamSignatureMismatchException = @"CStreamSignatureMismatchException";
|
|||
getClassname: name
|
||||
formatVersion: &version];
|
||||
new_cstream = [[objc_lookup_class(name) alloc]
|
||||
_initWithStream: s
|
||||
formatVersion: version];
|
||||
_initForReadingFromPostSignatureStream: s
|
||||
withFormatVersion: version];
|
||||
return [new_cstream autorelease];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue