Move methods to Additions for use with gdl2 on MacOSX

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@15723 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fedor 2003-01-26 19:38:42 +00:00
parent 114911c687
commit 938106220c
16 changed files with 173 additions and 125 deletions

View file

@ -4262,29 +4262,6 @@ handle_printf_atsign (FILE *stream,
* The methods in this category are not available in MacOS-X
*/
@implementation NSString (GNUstep)
/**
* Returns a string formed by removing the prefix string from the
* receiver. Raises an exception if the prefix is not present.
*/
- (NSString*) stringByDeletingPrefix: (NSString*)prefix
{
NSCAssert2([self hasPrefix: prefix],
@"'%@' does not have the prefix '%@'", self, prefix);
return [self substringFromIndex: [prefix length]];
}
/**
* Returns a string formed by removing the suffix string from the
* receiver. Raises an exception if the suffix is not present.
*/
- (NSString*) stringByDeletingSuffix: (NSString*)suffix
{
NSCAssert2([self hasSuffix: suffix],
@"'%@' does not have the suffix '%@'", self, suffix);
return [self substringToIndex: ([self length] - [suffix length])];
}
/**
* Returns a string formed by removing leading white space from the
* receiver.
@ -4419,28 +4396,6 @@ handle_printf_atsign (FILE *stream,
@implementation NSMutableString (GNUstep)
@class NSImmutableString;
@class GSImmutableString;
/**
* Removes the specified suffix from the string. Raises an exception
* if the suffix is not present.
*/
- (void) deleteSuffix: (NSString*)suffix
{
NSCAssert2([self hasSuffix: suffix],
@"'%@' does not have the suffix '%@'", self, suffix);
[self deleteCharactersInRange:
NSMakeRange([self length] - [suffix length], [suffix length])];
}
/**
* Removes the specified prefix from the string. Raises an exception
* if the prefix is not present.
*/
- (void) deletePrefix: (NSString*)prefix
{
NSCAssert2([self hasPrefix: prefix],
@"'%@' does not have the prefix '%@'", self, prefix);
[self deleteCharactersInRange: NSMakeRange(0, [prefix length])];
}
/**
* Returns a proxy to the receiver which will allow access to the