summaryrefslogtreecommitdiff
path: root/platform/android/src
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2018-08-17 17:04:20 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2018-08-21 09:26:44 -0700
commit1584d8f70adc86e5ddd5a80b4ad9f4b7741f4678 (patch)
tree0bf0270c75ab1af5f3d675d1ea9cd0cd34c0e45f /platform/android/src
parent2ff1ac309727a5f34cfa9472dc5802d5b5c3113c (diff)
downloadqtlocation-mapboxgl-1584d8f70adc86e5ddd5a80b4ad9f4b7741f4678.tar.gz
[android] Remove unused
Diffstat (limited to 'platform/android/src')
-rw-r--r--platform/android/src/conversion/collection.cpp14
-rw-r--r--platform/android/src/conversion/collection.hpp13
-rw-r--r--platform/android/src/conversion/constant.cpp16
-rw-r--r--platform/android/src/conversion/constant.hpp21
-rw-r--r--platform/android/src/style/conversion/latlngquad.hpp24
5 files changed, 0 insertions, 88 deletions
diff --git a/platform/android/src/conversion/collection.cpp b/platform/android/src/conversion/collection.cpp
index 14d817ea88..27b614e8cd 100644
--- a/platform/android/src/conversion/collection.cpp
+++ b/platform/android/src/conversion/collection.cpp
@@ -5,20 +5,6 @@ namespace mbgl {
namespace android {
namespace conversion {
-std::vector<std::string> toVector(JNIEnv& env, jni::jarray<jni::jobject>& array) {
- std::vector<std::string> vector;
- std::size_t len = jni::GetArrayLength(env, array);
- vector.reserve(len);
-
- for (std::size_t i = 0; i < len; i++) {
- jni::jstring* jstr = reinterpret_cast<jni::jstring*>(jni::GetObjectArrayElement(env, array, i));
- vector.push_back(*convert<std::string, jni::String>(env, jni::String(jstr)));
- jni::DeleteLocalRef(env, jstr);
- }
-
- return vector;
-}
-
std::vector<std::string> toVector(JNIEnv& env, jni::Array<jni::String> array) {
std::size_t len = array.Length(env);
std::vector<std::string> vector;
diff --git a/platform/android/src/conversion/collection.hpp b/platform/android/src/conversion/collection.hpp
index 973897b212..bb8941c984 100644
--- a/platform/android/src/conversion/collection.hpp
+++ b/platform/android/src/conversion/collection.hpp
@@ -10,19 +10,6 @@ namespace mbgl {
namespace android {
namespace conversion {
-/**
- * Convert jarray -> ArrayList
- */
-template <class T>
-jni::jobject* toArrayList(JNIEnv& env, jni::jarray<T>& array) {
- static jni::jclass* javaClass = jni::NewGlobalRef(env, &jni::FindClass(env, "java/util/Arrays")).release();
- static jni::jmethodID* asList = &jni::GetStaticMethodID(env, *javaClass, "asList", "([Ljava/lang/Object;)Ljava/util/List;");
- return reinterpret_cast<jni::jobject*>(jni::CallStaticMethod<jni::jobject*>(env, *javaClass, *asList, array));
-}
-
-// Java -> C++
-
-std::vector<std::string> toVector(JNIEnv& env, jni::jarray<jni::jobject>& array);
std::vector<std::string> toVector(JNIEnv& env, jni::Array<jni::String> array);
}
diff --git a/platform/android/src/conversion/constant.cpp b/platform/android/src/conversion/constant.cpp
index cce0796ce5..16e8b32943 100644
--- a/platform/android/src/conversion/constant.cpp
+++ b/platform/android/src/conversion/constant.cpp
@@ -12,38 +12,22 @@ Result<jni::jobject*> Converter<jni::jobject*, bool>::operator()(jni::JNIEnv& en
return {&jni::NewObject(env, *javaClass, *constructor, (jboolean) value)};
}
-Result<jni::jboolean> Converter<jni::jboolean, bool>::operator()(jni::JNIEnv&, const bool& value) const {
- return {(jni::jboolean) value};
-}
-
Result<jni::jobject*> Converter<jni::jobject*, float>::operator()(jni::JNIEnv& env, const float& value) const {
static jni::jclass* javaClass = jni::NewGlobalRef(env, &jni::FindClass(env, "java/lang/Float")).release();
static jni::jmethodID* constructor = &jni::GetMethodID(env, *javaClass, "<init>", "(F)V");
return {&jni::NewObject(env, *javaClass, *constructor, (jfloat) value)};
}
-Result<jni::jfloat> Converter<jni::jfloat, float>::operator()(jni::JNIEnv&, const float& value) const {
- return {(jni::jfloat) value};
-}
-
Result<jni::jobject*> Converter<jni::jobject*, double>::operator()(jni::JNIEnv& env, const double& value) const {
static jni::jclass* javaClass = jni::NewGlobalRef(env, &jni::FindClass(env, "java/lang/Double")).release();
static jni::jmethodID* constructor = &jni::GetMethodID(env, *javaClass, "<init>", "(D)V");
return {&jni::NewObject(env, *javaClass, *constructor, (jfloat) value)};
}
-Result<jni::jdouble> Converter<jni::jdouble, float>::operator()(jni::JNIEnv&, const double& value) const {
- return {(jni::jdouble) value};
-}
-
Result<jni::jobject*> Converter<jni::jobject*, std::string>::operator()(jni::JNIEnv& env, const std::string& value) const {
return {jni::Make<jni::String>(env, value).Get()};
}
-Result<jni::jstring*> Converter<jni::jstring*, std::string>::operator()(jni::JNIEnv& env, const std::string& value) const {
- return {jni::Make<jni::String>(env, value).Get()};
-}
-
Result<jni::jobject*> Converter<jni::jobject*, Color>::operator()(jni::JNIEnv& env, const Color& value) const {
std::stringstream sstream;
sstream << "rgba(" << value.r << ", " << value.g << ", " << value.b << ", " << value.a << ")";
diff --git a/platform/android/src/conversion/constant.hpp b/platform/android/src/conversion/constant.hpp
index 52395cb9ee..a067547955 100644
--- a/platform/android/src/conversion/constant.hpp
+++ b/platform/android/src/conversion/constant.hpp
@@ -19,31 +19,15 @@ struct Converter<jni::jobject*, bool> {
};
template <>
-struct Converter<jni::jboolean, bool> {
- Result<jni::jboolean> operator()(jni::JNIEnv&, const bool& value) const;
-};
-
-template <>
struct Converter<jni::jobject*, float> {
Result<jni::jobject*> operator()(jni::JNIEnv& env, const float& value) const;
};
template <>
-struct Converter<jni::jfloat, float> {
- Result<jni::jfloat> operator()(jni::JNIEnv&, const float& value) const;
-};
-
-
-template <>
struct Converter<jni::jobject*, double> {
Result<jni::jobject*> operator()(jni::JNIEnv& env, const double& value) const;
};
-template <>
-struct Converter<jni::jdouble, float> {
- Result<jni::jdouble> operator()(jni::JNIEnv&, const double& value) const;
-};
-
/**
* All integrals. java is limited to 64 bit signed, so...
* TODO: use BigDecimal for > 64 / unsigned?
@@ -65,11 +49,6 @@ struct Converter<jni::jobject*, std::string> {
};
template <>
-struct Converter<jni::jstring*, std::string> {
- Result<jni::jstring*> operator()(jni::JNIEnv& env, const std::string& value) const;
-};
-
-template <>
struct Converter<jni::jobject*, Color> {
Result<jni::jobject*> operator()(jni::JNIEnv& env, const Color& value) const;
};
diff --git a/platform/android/src/style/conversion/latlngquad.hpp b/platform/android/src/style/conversion/latlngquad.hpp
deleted file mode 100644
index 9588336855..0000000000
--- a/platform/android/src/style/conversion/latlngquad.hpp
+++ /dev/null
@@ -1,24 +0,0 @@
-#pragma once
-
-#include <mapbox/geojson.hpp>
-#include <mbgl/style/conversion/geojson.hpp>
-#include <mbgl/style/conversion_impl.hpp>
-#include <jni/jni.hpp>
-
-namespace mbgl {
-namespace style {
-namespace conversion {
-
-template <>
-optional<std::array<LatLng, 4>> Converter<std::array<LatLng, 4>>::operator()(const mbgl::android::Value& value, Error& error) const {
- if (value.isNull() || !value.isArray()) {
- error = { "value cannot be converted to LatLng array" };
- return {};
- }
-
- return convert<GeoJSON>(value.toString(), error);
-}
-
-} // namespace conversion
-} // namespace style
-} // namespace mbgl