It's fun to reduce one problem to an already-solved problem.
I was working to remove all uses of the NSFileManager and replace them with faster CF file manager calls.  I have one last function to fix, and even that is done (sans debugging) except that it relies on being able to determine if a file exists at a path held in a CFStringRef.  I have a function
bool MyClass::fileExistsAtPath(NSString *filePath)
{
   return [[NSFileManager defaultManager] fileExistsAtPath:filePath];
}
but I want it to be
bool MyClass::fileExistsAtPath(CFStringRef path)
{
   return ???;
}
I have been searching the documentation, and I thought I could use a CFURL for this, but so far, I don't see any API that will tell me whether the url is valid.
 
No comments:
Post a Comment