From ff640132de0fe855314a8fd86adae3a2fb33237b Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 4 Dec 2014 17:03:23 -0800 Subject: Move setAccessToken to CachingHTTPFileSource --- include/mbgl/map/map.hpp | 3 --- include/mbgl/storage/caching_http_file_source.hpp | 11 ++++++++--- include/mbgl/storage/file_source.hpp | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index 23bd211af9..45ec16ffd5 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -78,8 +78,6 @@ public: void setStyleURL(const std::string &url); void setStyleJSON(std::string newStyleJSON, const std::string &base = ""); std::string getStyleJSON() const; - void setAccessToken(std::string accessToken); - std::string getAccessToken() const; // Transition void cancelTransitions(); @@ -187,7 +185,6 @@ private: std::string styleURL; std::string styleJSON = ""; - std::string accessToken = ""; bool debug = false; timestamp animationTime = 0; diff --git a/include/mbgl/storage/caching_http_file_source.hpp b/include/mbgl/storage/caching_http_file_source.hpp index f566acf49e..6d7d852d2a 100644 --- a/include/mbgl/storage/caching_http_file_source.hpp +++ b/include/mbgl/storage/caching_http_file_source.hpp @@ -23,9 +23,11 @@ public: bool hasLoop(); void clearLoop(); - // Stores and retrieves the base path/URL for relative requests - void setBase(const std::string &value); - const std::string &getBase() const; + // Set the base path/URL for relative requests + void setBase(std::string); + + // Set the Mapbox API access token + void setAccessToken(std::string); std::unique_ptr request(ResourceType type, const std::string &url); @@ -37,6 +39,9 @@ public: private: std::thread::id thread_id; + // Mapbox API access token. + std::string accessToken; + // Path to the cache database. std::string path; diff --git a/include/mbgl/storage/file_source.hpp b/include/mbgl/storage/file_source.hpp index 69a0060f6a..23a1462ae8 100644 --- a/include/mbgl/storage/file_source.hpp +++ b/include/mbgl/storage/file_source.hpp @@ -21,7 +21,7 @@ public: virtual bool hasLoop() = 0; virtual void clearLoop() = 0; - virtual void setBase(const std::string &value) = 0; + virtual void setBase(std::string) = 0; virtual std::unique_ptr request(ResourceType type, const std::string &url) = 0; virtual void prepare(std::function fn) = 0; }; -- cgit v1.2.1