diff options
author | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2018-08-21 14:11:44 -0700 |
---|---|---|
committer | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2018-08-24 09:42:36 -0700 |
commit | a3ac610a384648cfe6a2074b4704879e663e9466 (patch) | |
tree | ad6b69a08a842783aa54d9a2c1cdb4cdedac2729 /include/mbgl | |
parent | 43f7b8fe0c6a9d2dcb7f6281dd441384c4409e90 (diff) | |
download | qtlocation-mapboxgl-a3ac610a384648cfe6a2074b4704879e663e9466.tar.gz |
[core] Add DefaultFileSource::mergeRegions API and CLI support in the mbgl-offline tool.
Diffstat (limited to 'include/mbgl')
-rw-r--r-- | include/mbgl/storage/default_file_source.hpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/mbgl/storage/default_file_source.hpp b/include/mbgl/storage/default_file_source.hpp index e048d82af2..942749fc00 100644 --- a/include/mbgl/storage/default_file_source.hpp +++ b/include/mbgl/storage/default_file_source.hpp @@ -100,6 +100,23 @@ public: std::function<void (expected<OfflineRegionStatus, std::exception_ptr>)>) const; /* + * Merge offline regions from a secondary database into the main offline database. + * + * When the database merge is completed, the provided callback will be + * executed on the database thread; it is the responsibility of the SDK bindings + * to re-execute a user-provided callback on the main thread. + * + * Only resources and tiles that belong to a region will be copied over. Identical + * regions will be flattened into a single new region in the main database. + * + * Note that the resulting new regions may not be in a completed status if the + * secondary database does not contain all the tiles or resources required by the + * region definition. + */ + void mergeOfflineRegions(const std::string& sideDatabasePath, + std::function<void (expected<OfflineRegions, std::exception_ptr>)>); + + /* * Remove an offline region from the database and perform any resources evictions * necessary as a result. * |