8#ifndef SkOSFile_ios_DEFINED
9#define SkOSFile_ios_DEFINED
13#ifdef SK_BUILD_FOR_IOS
14#import <CoreFoundation/CoreFoundation.h>
18static bool ios_get_path_in_bundle(
const char path[],
SkString*
result) {
20 CFBundleRef mainBundle = CFBundleGetMainBundle();
24 sk_cfp<CFURLRef> pathURL(CFURLCreateFromFileSystemRepresentation(
nullptr,
28 sk_cfp<CFStringRef> pathRef(CFURLCopyFileSystemPath(pathURL.get(), kCFURLPOSIXPathStyle));
31 sk_cfp<CFURLRef> fileURL(CFBundleCopyResourceURL(mainBundle, pathRef.get(),
32 nullptr, CFSTR(
"data")));
41 sk_cfp<CFStringRef> filePath(CFURLCopyFileSystemPath(fileURL.get(), kCFURLPOSIXPathStyle));
44 CFStringEncoding encodingMethod = CFStringGetSystemEncoding();
47 result->set(CFStringGetCStringPtr(filePath.get(), encodingMethod));