summaryrefslogtreecommitdiffstats
path: root/embedding/ios/GeckoEmbed/js/dirs.m
blob: dc74df97635b0a4ff81dc73b741a8a75f06f5f52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#import <Foundation/Foundation.h>

bool GetDocumentsDirectory(char* dir)
{
    NSSearchPathDirectory directory = NSDocumentDirectory;
    NSArray* paths = NSSearchPathForDirectoriesInDomains(directory, NSUserDomainMask, YES);
    if ([paths count] == 0) {
        return false;
    }
    strcpy(dir, [[paths objectAtIndex:0] UTF8String]);
    return true;
}