forked from pmougin/F-Script
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathFSNSMutableString.m
44 lines (33 loc) · 1.14 KB
/
FSNSMutableString.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* FSNSMutableString.m Copyright (c) 2000 Philippe Mougin. */
/* This software is open source. See the license. */
#import <Foundation/Foundation.h>
#import "FSNSMutableString.h"
#import "Number_fscript.h"
#import "FScriptFunctions.h"
#import "FSNSStringPrivate.h"
@implementation NSMutableString (FSNSMutableString)
- (NSString *) clone
{
return [[self mutableCopy] autorelease];
}
- (void)insert:(NSString *)str at:(NSNumber *)index
{
double ind;
FSVerifClassArgsNoNil(@"insert:at:",2,str,[NSString class],index,[NSNumber class]);
ind = [index doubleValue];
if (ind < 0)
FSExecError(@"argument 2 of method \"insert:at:\" must be a number "
@"greater or equal to 0");
if (ind > [self length])
FSExecError(@"argument 2 of method \"insert:at:\" must be a number "
@"less or equal to the length of the string");
if (ind != (NSInteger)ind)
FSExecError(@"argument 2 of method \"insert:at:\" must be an integer");
[self insertString:str atIndex:(NSUInteger)ind];
}
- (void)setValue:(id)operand
{
VERIF_OP_NSSTRING(@"setValue:")
[self setString:operand];
}
@end