summaryrefslogtreecommitdiff
path: root/src/mbgl/util/mapbox.hpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-05-05 16:31:03 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-05-08 13:48:57 -0700
commitbaaae99a03202641ae5b8024e57b691fe61a6688 (patch)
tree459045e56197696aa1312594f1e452b03931775d /src/mbgl/util/mapbox.hpp
parente34d8b5c802186008e49364668e4a7bd5668d0fd (diff)
downloadqtlocation-mapboxgl-baaae99a03202641ae5b8024e57b691fe61a6688.tar.gz
[core, android] Factor JSON string conversions
This adds a `convertJSON` template, to be used like: Error error optional<Foo> foo = convertJSON<Foo>(string, error); Internally, it parses the string with RapidJSON and then calls `convert<Foo>(parsed, error)`. While here, rationalize GeoJSON converters and fix error handling for Tileset conversion in OfflineDownload.
Diffstat (limited to 'src/mbgl/util/mapbox.hpp')
-rw-r--r--src/mbgl/util/mapbox.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mbgl/util/mapbox.hpp b/src/mbgl/util/mapbox.hpp
index 72f4e0a567..f3dfdd0b01 100644
--- a/src/mbgl/util/mapbox.hpp
+++ b/src/mbgl/util/mapbox.hpp
@@ -4,6 +4,9 @@
#include <mbgl/style/types.hpp>
namespace mbgl {
+
+class Tileset;
+
namespace util {
namespace mapbox {
@@ -18,6 +21,9 @@ std::string normalizeTileURL(const std::string& baseURL, const std::string& url,
// Return a "mapbox://tiles/..." URL (suitable for normalizeTileURL) for the given Mapbox tile URL.
std::string canonicalizeTileURL(const std::string& url, SourceType, uint16_t tileSize);
+// Replace URL templates with "mapbox://tiles/..." URLs (suitable for normalizeTileURL).
+void canonicalizeTileset(Tileset&, const std::string& url, SourceType, uint16_t tileSize);
+
extern const uint64_t DEFAULT_OFFLINE_TILE_COUNT_LIMIT;
} // namespace mapbox