Changes from Stevo Crvenkovski. See ChangeLog Mar 23 22:14:21

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2302 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Andrew McCallum 1997-05-03 18:05:21 +00:00
parent 60836e9864
commit 6690dfea9b
5 changed files with 875 additions and 330 deletions

View file

@ -31,6 +31,9 @@
#include <gnustep/base/behavior.h>
/* memcpy(), strlen(), strcmp() are gcc builtin's */
#include <gnustep/base//Unicode.h>
@implementation NSGCString
/* This is the designated initializer for this class. */
@ -111,13 +114,19 @@
return _count;
}
- (unsigned int) length
{
return _count;
}
- (unichar) characterAtIndex: (unsigned int)index
{
/* xxx This should raise an NSException. */
CHECK_INDEX_RANGE_ERROR(index, _count);
return (unichar) _contents_chars[index];
return chartouni(_contents_chars[index]);
}
- (NSString*) substringFromRange: (NSRange)aRange
{
if (aRange.location > _count)
@ -128,6 +137,7 @@
length: aRange.length];
}
// FOR IndexedCollection SUPPORT;
- objectAtIndex: (unsigned)index
@ -136,6 +146,16 @@
return [NSNumber numberWithChar: _contents_chars[index]];
}
- (int) _baseLength
{
return _count;
}
- (id) initWithString: (NSString*)string
{
return [self initWithCString:[string cStringNoCopy]];
}
@end