summaryrefslogtreecommitdiffstats
path: root/embedding/ios/GeckoEmbed/js/dirs.m
diff options
context:
space:
mode:
Diffstat (limited to 'embedding/ios/GeckoEmbed/js/dirs.m')
-rw-r--r--embedding/ios/GeckoEmbed/js/dirs.m12
1 files changed, 12 insertions, 0 deletions
diff --git a/embedding/ios/GeckoEmbed/js/dirs.m b/embedding/ios/GeckoEmbed/js/dirs.m
new file mode 100644
index 000000000..dc74df976
--- /dev/null
+++ b/embedding/ios/GeckoEmbed/js/dirs.m
@@ -0,0 +1,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;
+}