From f7e2857640065458e1b64ebdcefd0f6a2435ba7b Mon Sep 17 00:00:00 2001 From: mccallum Date: Tue, 23 Jan 1996 21:04:49 +0000 Subject: [PATCH] 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 --- Source/Stream.m | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/Source/Stream.m b/Source/Stream.m index 0b51b52bb..fc48d4cfc 100644 --- a/Source/Stream.m +++ b/Source/Stream.m @@ -1,8 +1,8 @@ /* 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 - Date: July 1994 + Created: July 1994 This file is part of the GNU Objective C Class Library. @@ -25,9 +25,11 @@ #include #include #include +#include @implementation Stream +/* This is the designated initializer. */ - init { return [super init]; @@ -45,39 +47,38 @@ - (int) writeBytes: (const void*)b length: (int)l { - [self notImplemented:_cmd]; + [self subclassResponsibility:_cmd]; return 0; } - (int) readBytes: (void*)b length: (int)l { - [self notImplemented:_cmd]; + [self subclassResponsibility:_cmd]; return 0; } -- (int) writeFormat: (const char *)format, ... +- (int) writeFormat: (id )format, ... { - [self notImplemented:_cmd]; + [self subclassResponsibility:_cmd]; return 0; } -- (int) readFormat: (const char *)format, ... +- (int) readFormat: (id )format, ... { - [self notImplemented:_cmd]; + [self subclassResponsibility:_cmd]; return 0; } -- (void) writeLine: (const char *)l +- (void) writeLine: (id )l { [self writeFormat:"%s\n", l]; } -/* This malloc's the buffer pointed to by the return value */ -- (char *) readLine +- (id ) readLine { char *l; [self readFormat:"%a[^\n]\n", &l]; - return l; + return [NSString stringWithCStringNoCopy:l]; } - (void) rewindStream @@ -87,40 +88,40 @@ - (void) flushStream { - [self notImplemented:_cmd]; + [self subclassResponsibility:_cmd]; } - (void) setStreamPosition: (unsigned)i { - [self notImplemented:_cmd]; + [self subclassResponsibility:_cmd]; } - (unsigned) streamPosition { - [self notImplemented:_cmd]; + [self subclassResponsibility:_cmd]; return 0; } - (BOOL) isAtEof { - [self notImplemented:_cmd]; + [self subclassResponsibility:_cmd]; return YES; } - (BOOL) isWritable { - [self notImplemented:_cmd]; + [self subclassResponsibility:_cmd]; return NO; } - (void) encodeWithCoder: anEncoder { - [self notImplemented:_cmd]; + [self subclassResponsibility:_cmd]; } - initWithCoder: aDecoder { - [self notImplemented:_cmd]; + [self subclassResponsibility:_cmd]; return self; }