23 #import <AvailabilityMacros.h>
24 #import <Foundation/Foundation.h>
29 #define STRINGIZE2(id) # id
30 #define STRINGIZE(id) STRINGIZE2(id)
33 #ifdef BUNDLE_IDENTIFIER
42 NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
47 NSBundle *bundle = [NSBundle bundleWithIdentifier: [NSString stringWithUTF8String: BUNDLE_ID_STR]];
55 NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
58 NSBundle *bundle = [NSBundle bundleWithIdentifier: [NSString stringWithUTF8String: BUNDLE_ID_STR]];
61 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
65 NSString *pathStr = [[bundle bundleURL] path];
67 NSString *pathStr = [bundle bundlePath];
71 path = std::string([pathStr UTF8String]);
81 NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
84 NSBundle *bundle = [NSBundle bundleWithIdentifier: [NSString stringWithUTF8String: BUNDLE_ID_STR]];
87 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
91 NSString *pathStr = [[bundle resourceURL] path];
93 NSString *pathStr = [bundle resourcePath];
97 path = std::string([pathStr UTF8String]);
107 NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
110 NSBundle *bundle = [NSBundle bundleWithIdentifier: [NSString stringWithUTF8String: BUNDLE_ID_STR]];
113 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
117 NSString *pathStr = [[bundle privateFrameworksURL] path];
119 NSString *pathStr = [bundle privateFrameworksPath];
123 path = std::string([pathStr UTF8String]);
bool osx_IsAppBundleValid()
Check if app is running in a valid bundle.
static const char * BUNDLE_ID_STR
C++ interface to Cocoa implementation for getting bundle information.
std::string osx_GetBundleFrameworksPath()
Get the system path to the bundle's Frameworks directory.
std::string osx_GetBundleResourcesPath()
Get the system path to the bundle's Resources directory.
std::string osx_GetBundlePath()
Get the system path to the bundle itself.