diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2014-12-17 14:59:05 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2014-12-17 14:59:05 +0100 |
commit | b5e9998b15d8a51bdca9cdb2d0981f69629f532a (patch) | |
tree | 365a26903cd4df16fbcfe3d6f9553d1ce62b2c1a /platform/darwin | |
parent | 936e09651424f111ac2ac64e2e60e2d13b082ebf (diff) | |
download | qtlocation-mapboxgl-b5e9998b15d8a51bdca9cdb2d0981f69629f532a.tar.gz |
change file:// to asset:// to indicate that they aren't arbitrary files
refs #579
Diffstat (limited to 'platform/darwin')
-rw-r--r-- | platform/darwin/application_root.mm | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/platform/darwin/application_root.mm b/platform/darwin/application_root.mm new file mode 100644 index 0000000000..19b872c54d --- /dev/null +++ b/platform/darwin/application_root.mm @@ -0,0 +1,18 @@ +#import <Foundation/Foundation.h> + +#include <mbgl/platform/platform.hpp> + +namespace mbgl { +namespace platform { + +// Returns the path to the default shader cache on this system. +std::string applicationRoot() { + static const std::string root = []() -> std::string { + NSString *path = [[[NSBundle mainBundle] resourceURL] path]; + return {[path cStringUsingEncoding : NSUTF8StringEncoding], + [path lengthOfBytesUsingEncoding:NSUTF8StringEncoding]}; + }(); + return root; +} +} +} |