([CString -initWithCStringNoCopy:freeWhenDone:]): New method.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@757 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Andrew McCallum 1996-01-23 20:59:27 +00:00
parent 456af2488a
commit b6e25349a0

View file

@ -1,5 +1,5 @@
/* Implementation for GNU Objective-C CString object
Copyright (C) 1993,1994, 1995 Free Software Foundation, Inc.
Copyright (C) 1993,1994, 1995, 1996 Free Software Foundation, Inc.
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
Date: July 1994
@ -28,7 +28,7 @@
@implementation CString
/* This is the designated initializer for this class */
/* These next two methods are the two designated initializers for this class */
- initWithCString: (const char*)aCharPtr range: (IndexRange)aRange
{
[super initWithType:@encode(char)];
@ -40,6 +40,15 @@
return self;
}
- initWithCStringNoCopy: (const char*)aCharPtr freeWhenDone: (BOOL)f
{
[super initWithType:@encode(char)];
_count = strlen(aCharPtr);
_contents_chars = aCharPtr;
_free_contents = f;
return self;
}
- (void) dealloc
{
if (_free_contents)