Thanks for the link, but I'm already doing that in a similar way. But that is exactly the problem I mean, you need Cocoa, .mm files and so on, and I think this is a small (and limited) field of objectives where SFML should provide a few helper functions to minimize the need for platform specific code (and what application using SFML doesn't need data files?).
Oh, and no, the Bundle is not read-only, but configuration files shouldn't be stored in there so that the user can delete and reinstall applications and their settings are remembered. But I'm not exactly sure about bundles installed to /Applications that are used by non-admin users. They should be read-only again, but again, not sure there.
And I have something better, at least for OS X:
std::string cfstringToStdString(const CFStringRef cfstr) {
CFIndex bufferLength = 1 + CFStringGetMaximumSizeForEncoding(CFStringGetLength(cfstr), kCFStringEncodingUTF8);
char* buffer = new char[bufferLength];
CFStringGetCString(cfstr, buffer, bufferLength, kCFStringEncodingUTF8);
std::string result = buffer;
delete[] buffer;
return result;
}
std::string getDataPath() {
NSArray* allPaths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, TRUE);
CFStringRef path = (CFStringRef)[allPaths objectAtIndex:0];
return cfstringToStdString(path);
}
That should be the official way to do it.
[edit]
Just to be clear, that snipped needs #import <Cocoa/Cocoa.h> and compilation as an Objective-C(++) file.