From cc26ef17d52367a768a134140c6c95cb2b880733 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Fri, 24 May 2019 17:47:27 +0300 Subject: [core] Introduce usage tag for resources Make the distinction if a resource is being requested for offline usage or if it will be used immediately. Fixes #14746 --- include/mbgl/storage/resource.hpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/mbgl/storage') diff --git a/include/mbgl/storage/resource.hpp b/include/mbgl/storage/resource.hpp index 97b9fbcaf0..d828877e10 100644 --- a/include/mbgl/storage/resource.hpp +++ b/include/mbgl/storage/resource.hpp @@ -29,6 +29,11 @@ public: Low }; + enum class Usage : bool { + Online, + Offline + }; + struct TileData { std::string urlTemplate; uint8_t pixelRatio; @@ -60,6 +65,7 @@ public: } void setPriority(Priority p) { priority = p; } + void setUsage(Usage u) { usage = u; } bool hasLoadingMethod(LoadingMethod method); @@ -83,6 +89,7 @@ public: Kind kind; LoadingMethod loadingMethod; + Usage usage{ Usage::Online }; Priority priority; std::string url; -- cgit v1.2.1