forked from mathk/gst-objc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gst-string.m
44 lines (38 loc) · 871 Bytes
/
gst-string.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
#import "gst-string.h"
@implementation StString
- (NSUInteger)length
{
return strlen (gst_proxy->OOPToString (stString));
}
- (unichar)characterAtIndex: (NSUInteger)index
{
char * string = gst_proxy->OOPToString (stString);
unichar returnValue = (unichar)string[index];
return returnValue;
}
- (void)getCharacters: (unichar *)buffer range: (NSRange)aRange
{
char * string = gst_proxy->OOPToString (stString);
int currentLocation;
for (currentLocation = aRange.location; currentLocation < aRange.location+aRange.length; currentLocation++)
{
unsigned short u = string[currentLocation];
if (u == 0)
break;
buffer[currentLocation - aRange.location] = u;
}
}
- (BOOL) isStProxy
{
return YES;
}
- (OOP)getStObject
{
return stString;
}
- (StString*)initWithSmalltalk: (OOP)stValue
{
stString = stValue;
return self;
}
@end