2008-03-13 01:43:33 +00:00
|
|
|
//
|
|
|
|
// FilePlaylistEntry.m
|
|
|
|
// Cog
|
|
|
|
//
|
|
|
|
// Created by Vincent Spader on 3/12/08.
|
|
|
|
// Copyright 2008 __MyCompanyName__. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import "FilePlaylistEntry.h"
|
|
|
|
|
|
|
|
|
|
|
|
@implementation FilePlaylistEntry
|
|
|
|
|
2008-03-15 04:45:37 +00:00
|
|
|
@synthesize fragment;
|
|
|
|
|
2008-03-13 01:43:33 +00:00
|
|
|
- (void)setURL:(NSURL *)url
|
|
|
|
{
|
|
|
|
FSPathMakeRef((UInt8 *)[[url path] fileSystemRepresentation], &fileRef, NULL);
|
2008-03-15 04:45:37 +00:00
|
|
|
self.fragment = [url fragment];
|
2008-03-13 01:43:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSURL *)URL
|
|
|
|
{
|
|
|
|
UInt8 path[PATH_MAX];
|
|
|
|
|
|
|
|
OSStatus status = FSRefMakePath(&fileRef, (UInt8*)path, sizeof(path));
|
|
|
|
if (status != noErr)
|
|
|
|
return nil;
|
|
|
|
|
2008-03-24 12:31:55 +00:00
|
|
|
NSString *after = @"";
|
|
|
|
if (self.fragment != nil) {
|
|
|
|
after = [@"#" stringByAppendingString:self.fragment];
|
|
|
|
}
|
|
|
|
return [NSURL URLWithString:[[[NSURL fileURLWithPath: [NSString stringWithUTF8String:(const char *)path]] absoluteString] stringByAppendingString:after]];
|
2008-03-13 01:43:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|