
#import "MyStringSegment.h"

@implementation MyStringSegment

- initWith:(const char *)s ofType:(MyStringType)t
{
    string = [[NXData alloc] initWithSize:strlen(s)+1];
    strcpy([string data],s);
    typ = t;
    return [super init];
}

- free
{
    [string free];
    typ = FREE;
    return [super free];
}

- copy
{
    id new = [super copy];
    string = [string copy];  // string auch verdoppeln
    return new;
}
    
- (MyStringType)typ
{
    return typ;
}

- (char *)string
{
    return (char *)[string data];
}

@end
