#pragma once #include #include #include #include #include namespace jni { using String = Object; inline std::u16string MakeAnything(ThingToMake, JNIEnv& env, const String& string) { NullCheck(env, string.get()); std::u16string result(jni::GetStringLength(env, *string), char16_t()); jni::GetStringRegion(env, *string, 0, result); return result; } inline std::string MakeAnything(ThingToMake, JNIEnv& env, const String& string) { return convertUTF16ToUTF8(Make(env, string)); } inline Local MakeAnything(ThingToMake, JNIEnv& env, const std::u16string& string) { return Local(env, &NewString(env, string)); } inline Local MakeAnything(ThingToMake, JNIEnv& env, const std::string& string) { return Make(env, convertUTF8ToUTF16(string)); } }