[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.
This commit is contained in:
@@ -5,7 +5,7 @@ namespace style {
|
||||
namespace conversion {
|
||||
|
||||
template <>
|
||||
optional<GeoJSON> convertGeoJSON(const v8::Local<v8::Value>&, Error& error) {
|
||||
optional<GeoJSON> Converter<GeoJSON>::operator()(const v8::Local<v8::Value>&, Error& error) const {
|
||||
error = { "not implemented" };
|
||||
return {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user