summaryrefslogtreecommitdiff
path: root/deps/geojson/0.4.2/include/mapbox/geojson/rapidjson.hpp
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2017-10-18 13:11:31 -0700
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2017-10-18 14:58:29 -0700
commit90a7cf87a32f6787e57e3852ac9d3015d8112621 (patch)
tree9f4d18736ee976b0071b54dd0610b8ac0a22a14f /deps/geojson/0.4.2/include/mapbox/geojson/rapidjson.hpp
parent1c633072fcea7ad153ab6f8ec40dd72d83541ead (diff)
downloadqtlocation-mapboxgl-90a7cf87a32f6787e57e3852ac9d3015d8112621.tar.gz
Bump Mapbox GL Native
mapbox-gl-native @ 10f7af19ce1ec61f37459f9cd75e2a0c89a0c790
Diffstat (limited to 'deps/geojson/0.4.2/include/mapbox/geojson/rapidjson.hpp')
-rw-r--r--deps/geojson/0.4.2/include/mapbox/geojson/rapidjson.hpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/deps/geojson/0.4.2/include/mapbox/geojson/rapidjson.hpp b/deps/geojson/0.4.2/include/mapbox/geojson/rapidjson.hpp
new file mode 100644
index 0000000000..360eefd010
--- /dev/null
+++ b/deps/geojson/0.4.2/include/mapbox/geojson/rapidjson.hpp
@@ -0,0 +1,32 @@
+#pragma once
+
+#include <rapidjson/document.h>
+#include <mapbox/geojson.hpp>
+
+namespace mapbox {
+namespace geojson {
+
+// Use the CrtAllocator, because the MemoryPoolAllocator is broken on ARM
+// https://github.com/miloyip/rapidjson/issues/200, 301, 388
+using rapidjson_allocator = rapidjson::CrtAllocator;
+using rapidjson_document = rapidjson::GenericDocument<rapidjson::UTF8<>, rapidjson_allocator>;
+using rapidjson_value = rapidjson::GenericValue<rapidjson::UTF8<>, rapidjson_allocator>;
+
+// Convert inputs of known types. Instantiations are provided for geometry, feature, and
+// feature_collection.
+template <typename T>
+T convert(const rapidjson_value &);
+
+// Convert any GeoJSON type.
+geojson convert(const rapidjson_value &);
+
+// Convert back to rapidjson value. Instantiations are provided for geometry, feature, and
+// feature_collection.
+template <typename T>
+rapidjson_value convert(const T &, rapidjson_allocator&);
+
+// Convert any GeoJSON type.
+rapidjson_value convert(const geojson &, rapidjson_allocator&);
+
+} // namespace geojson
+} // namespace mapbox