mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
Changes from Jeremy Bettis. See ChangeLog Jan 21 17:09:09
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2290 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a5b4b7b405
commit
1b0b2e5f30
4 changed files with 45 additions and 3 deletions
19
ChangeLog
19
ChangeLog
|
@ -1,5 +1,24 @@
|
||||||
Sat May 3 12:28:48 1997 Andrew McCallum <mccallum@jprc.com>
|
Sat May 3 12:28:48 1997 Andrew McCallum <mccallum@jprc.com>
|
||||||
|
|
||||||
|
* src/Makefile.in (GNUSTEP_HEADERS): Added include/NSHost.h.
|
||||||
|
(GNUSTEP_MFILES): Added NSHost.m.
|
||||||
|
|
||||||
|
* src/NSCharacterSet.m ([NSCharacterSet +_bitmapForSet:number:]):
|
||||||
|
Use NSBundle's pathForResource:ofType:inDirectory method properly.
|
||||||
|
(Reported by Stevo Crvenkovski <stevoc@lotus.mpt.com.mk>.)
|
||||||
|
|
||||||
|
Tue Jan 21 17:09:09 CST 1997 Jeremy Bettis <Jeremy@hksys.com>
|
||||||
|
|
||||||
|
* src/NSGCString.m: Add -appendString:.
|
||||||
|
|
||||||
|
* src/include/NSString.h: Add +string.
|
||||||
|
|
||||||
|
* src/NSString.m: (handle_printf_atsign) Take the description of
|
||||||
|
the object before the cStringNoCopy.
|
||||||
|
([NSString +allocWithZone:],[NSMutableString +allocWithZone:])
|
||||||
|
Only return the concrete class if [self class] == NSString to
|
||||||
|
allow subclassing.
|
||||||
|
|
||||||
Tue Mar 4 10:51:22 1997 Andrew McCallum <mccallum@jprc.com>
|
Tue Mar 4 10:51:22 1997 Andrew McCallum <mccallum@jprc.com>
|
||||||
|
|
||||||
* src/NSConnection.m: New file.
|
* src/NSConnection.m: New file.
|
||||||
|
|
|
@ -61,6 +61,7 @@ typedef enum _NSStringEncoding
|
||||||
@protocol NSString <NSCoding, NSCopying, NSMutableCopying>
|
@protocol NSString <NSCoding, NSCopying, NSMutableCopying>
|
||||||
|
|
||||||
// Creating Temporary Strings
|
// Creating Temporary Strings
|
||||||
|
+ (NSString*) string;
|
||||||
+ (NSString*) stringWithCharacters: (const unichar*)chars
|
+ (NSString*) stringWithCharacters: (const unichar*)chars
|
||||||
length: (unsigned int)length;
|
length: (unsigned int)length;
|
||||||
+ (NSString*) stringWithCString: (const char*)byteString
|
+ (NSString*) stringWithCString: (const char*)byteString
|
||||||
|
|
|
@ -222,6 +222,19 @@ stringDecrementCountAndFillHoleAt(NSGMutableCStringStruct *self,
|
||||||
_contents_chars[_count] = '\0';
|
_contents_chars[_count] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) appendString: (NSString*)aString
|
||||||
|
{
|
||||||
|
unsigned c = [aString cStringLength];
|
||||||
|
if (_count + c >= _capacity)
|
||||||
|
{
|
||||||
|
_capacity = MAX(_capacity*2, _count+c);
|
||||||
|
OBJC_REALLOC(_contents_chars, char, _capacity);
|
||||||
|
}
|
||||||
|
memcpy(_contents_chars + _count, [aString cStringNoCopy], c);
|
||||||
|
_count += c;
|
||||||
|
_contents_chars[_count] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
/* xxx This method may be removed in future. */
|
/* xxx This method may be removed in future. */
|
||||||
- (void) setCString: (const char *)byteString length: (unsigned)length
|
- (void) setCString: (const char *)byteString length: (unsigned)length
|
||||||
{
|
{
|
||||||
|
|
|
@ -156,7 +156,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
#endif
|
#endif
|
||||||
len = fprintf(stream, "%*s",
|
len = fprintf(stream, "%*s",
|
||||||
(info->left ? - info->width : info->width),
|
(info->left ? - info->width : info->width),
|
||||||
[string_object cStringNoCopy]);
|
[[string_object description] cStringNoCopy]);
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
#endif /* HAVE_REGISTER_PRINTF_FUNCTION */
|
#endif /* HAVE_REGISTER_PRINTF_FUNCTION */
|
||||||
|
@ -186,7 +186,9 @@ handle_printf_atsign (FILE *stream,
|
||||||
|
|
||||||
+ allocWithZone: (NSZone*)z
|
+ allocWithZone: (NSZone*)z
|
||||||
{
|
{
|
||||||
return NSAllocateObject ([self _concreteClass], 0, z);
|
if ([self class] == [NSString class])
|
||||||
|
return NSAllocateObject ([self _concreteClass], 0, z);
|
||||||
|
return [super allocWithZone:z];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Creating Temporary Strings
|
// Creating Temporary Strings
|
||||||
|
@ -197,6 +199,11 @@ handle_printf_atsign (FILE *stream,
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ (NSString*) string
|
||||||
|
{
|
||||||
|
return [[[self alloc] init] autorelease];
|
||||||
|
}
|
||||||
|
|
||||||
+ (NSString*) stringWithCString: (const char*) byteString
|
+ (NSString*) stringWithCString: (const char*) byteString
|
||||||
{
|
{
|
||||||
return [[[self alloc] initWithCString:byteString]
|
return [[[self alloc] initWithCString:byteString]
|
||||||
|
@ -1419,7 +1426,9 @@ handle_printf_atsign (FILE *stream,
|
||||||
|
|
||||||
+ allocWithZone: (NSZone*)z
|
+ allocWithZone: (NSZone*)z
|
||||||
{
|
{
|
||||||
return NSAllocateObject([self _mutableConcreteClass], 0, z);
|
if ([self class] == [NSMutableString class])
|
||||||
|
return NSAllocateObject([self _mutableConcreteClass], 0, z);
|
||||||
|
return [super allocWithZone:z];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* xxx This method may be removed in future. */
|
/* xxx This method may be removed in future. */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue