23 #import <AvailabilityMacros.h>
24 #import <Foundation/Foundation.h>
32 NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
35 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
37 NSArray* paths = [[NSFileManager defaultManager] URLsForDirectory:directory inDomains:NSUserDomainMask];
39 NSArray* paths = NSSearchPathForDirectoriesInDomains(directory, NSUserDomainMask,
true);
41 if ([paths count] > 0)
43 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
47 NSString* pathStr = [[paths objectAtIndex:0] path];
49 NSString* pathStr = [paths objectAtIndex:0];
52 result = std::string([pathStr UTF8String]);
std::string osx_GetCachesPath()
Get the user's Caches path (typically ~/Library/Caches)
std::string osx_GetAppSupportPath()
Get the user's Application Support path (typically ~/Library/Application Support) ...
static std::string getUserDirectoryPath(NSSearchPathDirectory directory)
C++ interface to Cocoa implementation for retrieving standard OS X paths.