这篇教程C++ CFBundleGetBundleWithIdentifier函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CFBundleGetBundleWithIdentifier函数的典型用法代码示例。如果您正苦于以下问题:C++ CFBundleGetBundleWithIdentifier函数的具体用法?C++ CFBundleGetBundleWithIdentifier怎么用?C++ CFBundleGetBundleWithIdentifier使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CFBundleGetBundleWithIdentifier函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: CFBundleGetBundleWithIdentifiervoid HeadlessView::loadExtensions() { if (extensionsLoaded) { return; }#ifdef MBGL_USE_CGL gl::InitializeExtensions([](const char * name) { static CFBundleRef framework = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengl")); if (!framework) { throw std::runtime_error("Failed to load OpenGL framework."); } CFStringRef str = CFStringCreateWithCString(kCFAllocatorDefault, name, kCFStringEncodingASCII); void* symbol = CFBundleGetFunctionPointerForName(framework, str); CFRelease(str); return reinterpret_cast<gl::glProc>(symbol); });#endif#ifdef MBGL_USE_GLX gl::InitializeExtensions([](const char * name) { return glXGetProcAddress(reinterpret_cast<const GLubyte *>(name)); });#endif extensionsLoaded = true;}
开发者ID:Dyziorek,项目名称:mapbox-gl-native,代码行数:28,
示例2: GetHIToolboxVersionlong GetHIToolboxVersion(void){ CFBundleRef bundle; CFStringRef versStr = nil; static unsigned long version = 0; if (version != 0) return version; bundle = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.HIToolbox")); if (bundle) versStr = (CFStringRef) CFBundleGetValueForInfoDictionaryKey(bundle, CFSTR("CFBundleShortVersionString")); if (versStr && (CFGetTypeID(versStr) == CFStringGetTypeID())) { int major = 0, minor = 0, bugfix = 0; char sz[20]; CFStringGetCString(versStr, sz, sizeof(sz), kCFStringEncodingUTF8); sscanf(sz, "%d.%d.%d", &major, &minor, &bugfix); version = (major << 8) + (minor << 4) + bugfix; } return version;}
开发者ID:alesegdia,项目名称:snes-sdk,代码行数:26,
示例3: _intlizestatic_inline const char *_intlize(const char *msg, int base, char *str, size_t len){ char domain[12 +20]; CFStringRef cfstring = CFStringCreateWithCString(kCFAllocatorSystemDefault, msg, kCFStringEncodingUTF8); CFStringRef cfdomain; CFBundleRef OpenAFSBundle = CFBundleGetBundleWithIdentifier(CFSTR("org.openafs.filesystems.afs")); if (!str) { CFRelease(cfstring); return msg; } snprintf(domain, sizeof(domain), "heim_com_err%d", base); cfdomain = CFStringCreateWithCString(kCFAllocatorSystemDefault, domain, kCFStringEncodingUTF8); if (OpenAFSBundle != NULL) { CFStringRef cflocal; cflocal = CFBundleCopyLocalizedString(OpenAFSBundle, cfstring, cfstring, cfdomain); CFStringGetCString(cflocal, str, len, kCFStringEncodingUTF8); CFRelease(cflocal); } else { CFStringGetCString(cfstring, str, len, kCFStringEncodingUTF8); } CFRelease(cfstring); CFRelease(cfdomain); return str;}
开发者ID:jblaine,项目名称:openafs,代码行数:33,
|