diff options
author | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2019-06-10 14:55:11 +0300 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2019-06-13 22:28:16 +0300 |
commit | 5b4bb1398b3bab12d1493660f7ae1d7fadfa5ea0 (patch) | |
tree | cac7d0d43606d123dd467ae4c86ca505bc18212e /include/mbgl | |
parent | 32e0b7beec8ee1229cc6b1b1a4b857a459547b55 (diff) | |
download | qtlocation-mapboxgl-5b4bb1398b3bab12d1493660f7ae1d7fadfa5ea0.tar.gz |
[core] Surface cache management APIs
These APIs need to be on the DefaultFileSource in order to
be visible for the SDKs bindings.
Diffstat (limited to 'include/mbgl')
-rw-r--r-- | include/mbgl/storage/default_file_source.hpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/mbgl/storage/default_file_source.hpp b/include/mbgl/storage/default_file_source.hpp index 2a1e32baed..130f4f1022 100644 --- a/include/mbgl/storage/default_file_source.hpp +++ b/include/mbgl/storage/default_file_source.hpp @@ -145,6 +145,14 @@ public: void deleteOfflineRegion(OfflineRegion&&, std::function<void (std::exception_ptr)>); /* + * Invalidate all the tiles from an offline region forcing Mapbox GL to revalidate + * the tiles with the server before using. This is more efficient than deleting the + * offline region and downloading it again because if the data on the cache matches + * the server, no new data gets transmitted. + */ + void invalidateOfflineRegion(OfflineRegion&, std::function<void (std::exception_ptr)>); + + /* * Changing or bypassing this limit without permission from Mapbox is prohibited * by the Mapbox Terms of Service. */ @@ -186,6 +194,26 @@ public: */ void resetCache(std::function<void (std::exception_ptr)>); + /* + * Forces revalidation of tiles in the ambient cache. + * + * Forces Mapbox GL Native to revalidate tiles stored in the ambient + * cache with the tile server before using them, making sure they + * are the latest version. This is more efficient than cleaning the + * cache because if the tile is considered valid after the server + * lookup, it will not get downloaded again. + */ + void invalidateTileCache(std::function<void (std::exception_ptr)>); + + /* + * Erase tiles from the ambient cache, freeing storage space. + * + * Erases the tile cache, freeing resources. This operation can be + * potentially slow because it will trigger a VACUUM on SQLite, + * forcing the database to move pages on the filesystem. + */ + void clearTileCache(std::function<void (std::exception_ptr)>); + // For testing only. void setOnlineStatus(bool); |