Files
MapLibreParticleLab/include/mbgl/style/conversion/geojson.hpp
John Firebaugh baaae99a03 [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.
2017-05-08 13:48:57 -07:00

24 lines
578 B
C++

#pragma once
#include <mbgl/style/conversion.hpp>
#include <mbgl/util/geojson.hpp>
namespace mbgl {
namespace style {
namespace conversion {
template <>
struct Converter<GeoJSON> {
public:
optional<GeoJSON> operator()(const std::string&, Error&) const;
// This is explicitly specialized in the .cpp file for JSValue. It may also be explicitly
// specialized for SDK-specific types (e.g. mbgl::android::Value).
template <class V>
optional<GeoJSON> operator()(const V&, Error&) const;
};
} // namespace conversion
} // namespace style
} // namespace mbgl