FreeRDP
shell_ios.m
1 
21 #import <Foundation/Foundation.h>
22 
23 #include <winpr/config.h>
24 
25 #include "shell_ios.h"
26 
27 static NSString *ios_get_directory_for_search_path(NSSearchPathDirectory searchPath)
28 {
29  return [NSSearchPathForDirectoriesInDomains(searchPath, NSUserDomainMask, YES) lastObject];
30 }
31 
32 char *ios_get_home(void)
33 {
34  NSString *path = ios_get_directory_for_search_path(NSDocumentDirectory);
35  return strdup([path UTF8String]);
36 }
37 
38 char *ios_get_temp(void)
39 {
40  NSString *tmp_path = NSTemporaryDirectory();
41  return strdup([tmp_path UTF8String]);
42 }
43 
44 char *ios_get_data(void)
45 {
46  NSString *path = ios_get_directory_for_search_path(NSApplicationSupportDirectory);
47  return strdup([path UTF8String]);
48 }
49 
50 char *ios_get_cache(void)
51 {
52  NSString *path = ios_get_directory_for_search_path(NSCachesDirectory);
53  return strdup([path UTF8String]);
54 }