blob: 27b614e8cddfc3f3d82e0b75fc8c9d3c04cb9b18 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#include "collection.hpp"
#include "constant.hpp"
namespace mbgl {
namespace android {
namespace conversion {
std::vector<std::string> toVector(JNIEnv& env, jni::Array<jni::String> array) {
std::size_t len = array.Length(env);
std::vector<std::string> vector;
vector.reserve(len);
for (std::size_t i = 0; i < len; i++) {
jni::String jstr = array.Get(env, i);
vector.push_back(*convert<std::string, jni::String>(env, jstr));
jni::DeleteLocalRef(env, jstr);
}
return vector;
}
}
}
}
|