summaryrefslogtreecommitdiff
path: root/Source/Android/jni/AndroidCommon/AndroidCommon.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2018-06-08 13:59:45 +0200
committerGitHub <noreply@github.com>2018-06-08 13:59:45 +0200
commitca3d68cee581435217fe737390a9fed833ac3338 (patch)
tree2cf04a27469dd2955e4b1dc2facd7b64ee00fb66 /Source/Android/jni/AndroidCommon/AndroidCommon.cpp
parentd23c3e9524e9f5aa312fae5d320f5866bb721a8a (diff)
parentf0f8ca21723470c859b58291144b7913dfae3906 (diff)
Merge pull request #7076 from JosJuice/android-gamelist-uicommon
Use UICommon's game list code on Android
Diffstat (limited to 'Source/Android/jni/AndroidCommon/AndroidCommon.cpp')
-rw-r--r--Source/Android/jni/AndroidCommon/AndroidCommon.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/Source/Android/jni/AndroidCommon/AndroidCommon.cpp b/Source/Android/jni/AndroidCommon/AndroidCommon.cpp
new file mode 100644
index 0000000000..350ea5483e
--- /dev/null
+++ b/Source/Android/jni/AndroidCommon/AndroidCommon.cpp
@@ -0,0 +1,26 @@
+// Copyright 2018 Dolphin Emulator Project
+// Licensed under GPLv2+
+// Refer to the license.txt file included.
+
+#include "jni/AndroidCommon/AndroidCommon.h"
+
+#include <string>
+
+#include <jni.h>
+
+std::string GetJString(JNIEnv* env, jstring jstr)
+{
+ std::string result = "";
+ if (!jstr)
+ return result;
+
+ const char* s = env->GetStringUTFChars(jstr, nullptr);
+ result = s;
+ env->ReleaseStringUTFChars(jstr, s);
+ return result;
+}
+
+jstring ToJString(JNIEnv* env, const std::string& str)
+{
+ return env->NewStringUTF(str.c_str());
+}