Update-Installer/src/StandardDirs.mm
Robert Knight 50faf07f00 Write log file to correct directory on Mac
* Move class to get the app data directory to a new StandardDirs class.
 * Setup an auto-release pool at the start/end of main() to catch objects
   allocated outside of the updater dialog.
2011-08-30 12:34:37 +01:00

18 lines
458 B
Text

#include <Foundation/Foundation.h>
#include "StandardDirs.h"
std::string StandardDirs::applicationSupportFolderPath()
{
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory,
NSUserDomainMask,
true /* expand tildes */);
for (unsigned int i=0; i < [paths count]; i++)
{
NSString* path = [paths objectAtIndex:i];
return std::string([path UTF8String]);
}
return std::string();
}