diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2017-02-16 18:28:07 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2017-02-20 14:36:27 +0100 |
commit | e2d8a83664a2705edc762ac00dcaf7eead2ae6fd (patch) | |
tree | 93b0bfdb9d6f93ddcee9c8699976ea7cee110c40 /include | |
parent | 8669f933fdaf957253d7ec6b7453b95e93adc1b1 (diff) | |
download | qtlocation-mapboxgl-e2d8a83664a2705edc762ac00dcaf7eead2ae6fd.tar.gz |
[core] add ability to transform URLs before they're requested from the Internet
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/storage/default_file_source.hpp | 2 | ||||
-rw-r--r-- | include/mbgl/storage/online_file_source.hpp | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/include/mbgl/storage/default_file_source.hpp b/include/mbgl/storage/default_file_source.hpp index 1ff440e4e5..a15ee9a29b 100644 --- a/include/mbgl/storage/default_file_source.hpp +++ b/include/mbgl/storage/default_file_source.hpp @@ -36,6 +36,8 @@ public: void setAccessToken(const std::string&); std::string getAccessToken() const; + void setResourceTransform(std::function<std::string(Resource::Kind, std::string&&)>); + std::unique_ptr<AsyncRequest> request(const Resource&, Callback) override; /* diff --git a/include/mbgl/storage/online_file_source.hpp b/include/mbgl/storage/online_file_source.hpp index f432a8886e..51cfc5a2a1 100644 --- a/include/mbgl/storage/online_file_source.hpp +++ b/include/mbgl/storage/online_file_source.hpp @@ -16,6 +16,10 @@ public: void setAccessToken(const std::string& t) { accessToken = t; } std::string getAccessToken() const { return accessToken; } + using ResourceTransform = + std::function<std::unique_ptr<AsyncRequest>(Resource::Kind, std::string&&, std::function<void(std::string&&)>)>; + void setResourceTransform(ResourceTransform&& cb); + std::unique_ptr<AsyncRequest> request(const Resource&, Callback) override; private: |