diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2014-09-24 17:08:44 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2014-09-24 17:08:44 +0200 |
commit | 1209744b38da0252731812d4cc5371be960fb3c3 (patch) | |
tree | 7e845b30550d6ca72f1580cb51490139f0e8ca18 /common | |
parent | 992d9ff051ecd45f83160930c43c9d5a2da04048 (diff) | |
download | qtlocation-mapboxgl-1209744b38da0252731812d4cc5371be960fb3c3.tar.gz |
use the default cache location on ios to avoid writing to unwritable file system locations
Diffstat (limited to 'common')
-rw-r--r-- | common/ios.mm | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/common/ios.mm b/common/ios.mm new file mode 100644 index 0000000000..1076343e24 --- /dev/null +++ b/common/ios.mm @@ -0,0 +1,19 @@ +#import <Foundation/Foundation.h> + +#include <mbgl/platform/platform.hpp> + +namespace mbgl { +namespace platform { + +// Returns the path to the default cache database on this system. +std::string defaultCacheDatabase() { + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); + NSString *libraryDirectory = [paths objectAtIndex:0]; + return [[libraryDirectory stringByAppendingPathComponent:@"cache.db"] UTF8String]; +} + +} +} + + +// Returns the path to the default cache database on this system. |