This is FileName.m in view mode; [Download] [Up]
#import "FileName.h"
#include <string.h>
#include <libc.h>
@implementation StringStorage (FileName)
- (const char *) basename
{
char *ptr = rindex((char *)dataPtr,'/');
return ((ptr && ptr[1])? (const char *)(ptr + 1) : (const char *)dataPtr);
}
- mktemp
{
static char extraChar = 'a';
static short calls = 0;
if(calls > 25)
{
calls = 0;
extraChar++;
if(extraChar > 'z')
return nil;
}
[self appendCharValue: extraChar];
[self appendStringValue: "XXXXXX"];
mktemp((char *)[self stringValue]);
calls++;
return self;
}
@end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.