Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (24 sloc) 0.723 kB
//
// NSString+FSRef.m
// BuildCleaner
//
// Created by Dave DeLong on 8/13/09.
// Copyright 2009 Home. All rights reserved.
//
#import "NSString+FSRef.h"
@implementation NSString (FSRef)
- (FSRef) fsref {
FSRef output;
// convert the NSString to a C-string
const char *filePathAsCString = [self UTF8String];
CFURLRef url = CFURLCreateWithBytes(
kCFAllocatorDefault, // CFAllocatorRef
(const UInt8 *)filePathAsCString, // the bytes
strlen(filePathAsCString), // the length
kCFStringEncodingUTF8, // encoding
NULL); // CFURLRef baseURL
CFURLGetFSRef(url, &output);
CFRelease(url);
return output;
}
@end
Jump to Line
Something went wrong with that request. Please try again.