Enforce Offline tile limit when merging sideloaded databases

This commit is contained in:
Asheem Mamoowala
2018-08-21 17:41:22 -07:00
parent eb72fe580b
commit d4f4136414
3 changed files with 68 additions and 9 deletions

View File

@@ -106,12 +106,18 @@ public:
* executed on the database thread; it is the responsibility of the SDK bindings
* to re-execute a user-provided callback on the main thread.
*
* The secondary database may need to be upgraded to the latest schema. This is done
* in-place and requires write-access to `sideDatabasePath`; it is the
* responsibility of the SDK bindings to ensure that this path is writeable.
*
* 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.
* Invokes the callback with a `MapboxOfflineTileCountExceededException` error if
* the merge operation would result in the offline tile count limit being exceeded.
*
* Merged 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>)>);