mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-05-12 06:02:39 +00:00
Android: Convert some files to LF
I wonder why lint didn't catch this...
This commit is contained in:
parent
0dbe8fb2ea
commit
c89828b22e
7 changed files with 616 additions and 616 deletions
Source/Android/jni/AndroidCommon
|
@ -1,39 +1,39 @@
|
|||
// Copyright 2018 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "jni/AndroidCommon/AndroidCommon.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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());
|
||||
}
|
||||
|
||||
std::vector<std::string> JStringArrayToVector(JNIEnv* env, jobjectArray array)
|
||||
{
|
||||
const jsize size = env->GetArrayLength(array);
|
||||
std::vector<std::string> result;
|
||||
result.reserve(size);
|
||||
|
||||
for (jsize i = 0; i < size; ++i)
|
||||
result.push_back(GetJString(env, (jstring)env->GetObjectArrayElement(array, i)));
|
||||
|
||||
return result;
|
||||
}
|
||||
// Copyright 2018 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "jni/AndroidCommon/AndroidCommon.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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());
|
||||
}
|
||||
|
||||
std::vector<std::string> JStringArrayToVector(JNIEnv* env, jobjectArray array)
|
||||
{
|
||||
const jsize size = env->GetArrayLength(array);
|
||||
std::vector<std::string> result;
|
||||
result.reserve(size);
|
||||
|
||||
for (jsize i = 0; i < size; ++i)
|
||||
result.push_back(GetJString(env, (jstring)env->GetObjectArrayElement(array, i)));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue