diff options
author | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2017-06-21 17:32:41 +0300 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2017-06-26 16:32:21 +0300 |
commit | 6beccef517250ecb24361caf5b71da6ce4f93c97 (patch) | |
tree | 30f1a1ce6a21ffbca2f099756a27e72bb575d275 /include/mbgl | |
parent | 54c3ccc37d4534f699437f9c1854d8f5a857069e (diff) | |
download | qtlocation-mapboxgl-6beccef517250ecb24361caf5b71da6ce4f93c97.tar.gz |
[core] Introduce the ResourceTransform
Wrapper for transforming URLs on the OnlineFileSource.
Diffstat (limited to 'include/mbgl')
-rw-r--r-- | include/mbgl/storage/resource_transform.hpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/mbgl/storage/resource_transform.hpp b/include/mbgl/storage/resource_transform.hpp new file mode 100644 index 0000000000..738c497176 --- /dev/null +++ b/include/mbgl/storage/resource_transform.hpp @@ -0,0 +1,26 @@ +#pragma once + +#include <mbgl/actor/actor_ref.hpp> +#include <mbgl/storage/resource.hpp> + +#include <functional> +#include <string> + +namespace mbgl { + +class Mailbox; + +class ResourceTransform { +public: + using TransformCallback = std::function<std::string(Resource::Kind kind, const std::string&& url)>; + using FinishedCallback = std::function<void(const std::string&&)>; + + ResourceTransform(ActorRef<ResourceTransform>, TransformCallback&&); + + void transform(Resource::Kind, const std::string&& url, FinishedCallback&&); + +private: + TransformCallback transformCallback; +}; + +} // namespace mbgl |