Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct String
- {
- using CppType = std::string;
- using JniType = jstring;
- using Boxed = String;
- static CppType toCpp(JNIEnv* jniEnv, JniType j)
- {
- assert(j != nullptr);
- return jniUTF8FromString(jniEnv, j);
- }
- static LocalRef<JniType> fromCpp(JNIEnv* jniEnv, const CppType& c)
- {
- return {jniEnv, jniStringFromUTF8(jniEnv, c)};
- }
- };
Add Comment
Please, Sign In to add comment