Use string object types instead of C-string types in method arguments.

Use -subclassReponsibility instead of -notImplemented.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@761 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
mccallum 1996-01-23 21:04:49 +00:00
parent 4f6afefeb3
commit f7e2857640

View file

@ -1,8 +1,8 @@
/* Implementation of GNU Objective C byte stream /* Implementation of GNU Objective C byte stream
Copyright (C) 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu> Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
Date: July 1994 Created: July 1994
This file is part of the GNU Objective C Class Library. This file is part of the GNU Objective C Class Library.
@ -25,9 +25,11 @@
#include <objects/Stream.h> #include <objects/Stream.h>
#include <objects/Coder.h> #include <objects/Coder.h>
#include <objects/Coder.h> #include <objects/Coder.h>
#include <objects/NSString.h>
@implementation Stream @implementation Stream
/* This is the designated initializer. */
- init - init
{ {
return [super init]; return [super init];
@ -45,39 +47,38 @@
- (int) writeBytes: (const void*)b length: (int)l - (int) writeBytes: (const void*)b length: (int)l
{ {
[self notImplemented:_cmd]; [self subclassResponsibility:_cmd];
return 0; return 0;
} }
- (int) readBytes: (void*)b length: (int)l - (int) readBytes: (void*)b length: (int)l
{ {
[self notImplemented:_cmd]; [self subclassResponsibility:_cmd];
return 0; return 0;
} }
- (int) writeFormat: (const char *)format, ... - (int) writeFormat: (id <String>)format, ...
{ {
[self notImplemented:_cmd]; [self subclassResponsibility:_cmd];
return 0; return 0;
} }
- (int) readFormat: (const char *)format, ... - (int) readFormat: (id <String>)format, ...
{ {
[self notImplemented:_cmd]; [self subclassResponsibility:_cmd];
return 0; return 0;
} }
- (void) writeLine: (const char *)l - (void) writeLine: (id <String>)l
{ {
[self writeFormat:"%s\n", l]; [self writeFormat:"%s\n", l];
} }
/* This malloc's the buffer pointed to by the return value */ - (id <String>) readLine
- (char *) readLine
{ {
char *l; char *l;
[self readFormat:"%a[^\n]\n", &l]; [self readFormat:"%a[^\n]\n", &l];
return l; return [NSString stringWithCStringNoCopy:l];
} }
- (void) rewindStream - (void) rewindStream
@ -87,40 +88,40 @@
- (void) flushStream - (void) flushStream
{ {
[self notImplemented:_cmd]; [self subclassResponsibility:_cmd];
} }
- (void) setStreamPosition: (unsigned)i - (void) setStreamPosition: (unsigned)i
{ {
[self notImplemented:_cmd]; [self subclassResponsibility:_cmd];
} }
- (unsigned) streamPosition - (unsigned) streamPosition
{ {
[self notImplemented:_cmd]; [self subclassResponsibility:_cmd];
return 0; return 0;
} }
- (BOOL) isAtEof - (BOOL) isAtEof
{ {
[self notImplemented:_cmd]; [self subclassResponsibility:_cmd];
return YES; return YES;
} }
- (BOOL) isWritable - (BOOL) isWritable
{ {
[self notImplemented:_cmd]; [self subclassResponsibility:_cmd];
return NO; return NO;
} }
- (void) encodeWithCoder: anEncoder - (void) encodeWithCoder: anEncoder
{ {
[self notImplemented:_cmd]; [self subclassResponsibility:_cmd];
} }
- initWithCoder: aDecoder - initWithCoder: aDecoder
{ {
[self notImplemented:_cmd]; [self subclassResponsibility:_cmd];
return self; return self;
} }