diff --git a/core/pen/include/os.h b/core/pen/include/os.h index 42cc15c9..43c3cbe9 100644 --- a/core/pen/include/os.h +++ b/core/pen/include/os.h @@ -42,6 +42,7 @@ namespace pen const Str os_path_for_resource(const c8* filename); const user_info& os_get_user_info(); Str os_get_persistent_data_directory(); + Str os_get_cache_data_directory(); void os_create_directory(const Str& dir); void os_open_url(const Str& url); void os_ignore_slient(); diff --git a/core/pen/source/ios/os.mm b/core/pen/source/ios/os.mm index e6afa246..ef1e0086 100644 --- a/core/pen/source/ios/os.mm +++ b/core/pen/source/ios/os.mm @@ -393,6 +393,14 @@ Str os_get_persistent_data_directory() } } + Str os_get_cache_data_directory() + { + @autoreleasepool { + NSString* dir = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0]; + return dir.UTF8String; + } + } + void os_create_directory(const Str& dir) { @autoreleasepool {