MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / getFileNameFromURI

Function getFileNameFromURI

src/AndroidJNICalls.cpp:67–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65 bool cursorChanged = false;
66
67 std::string getFileNameFromURI(const std::string& uri) {
68 JNIEnv* env = static_cast<JNIEnv*>(SDL_GetAndroidJNIEnv());
69 std::string strToRet = "";
70 jni_local_frame(env, 16, [&] {
71 jobject activity = (jobject) SDL_GetAndroidActivity();
72 jclass clazz = env->GetObjectClass(activity);
73 jmethodID method_id = env->GetStaticMethodID(clazz, "getFileNameFromUriString",
74 "(Ljava/lang/String;)Ljava/lang/String;");
75 jobject obj = env->CallStaticObjectMethod(clazz, method_id, string2jstring(env, uri));
76 if(obj == nullptr)
77 return;
78 strToRet = jstring2string(env, static_cast<jstring>(obj));
79 });
80 return strToRet;
81 }
82
83 void shareInternalFiles(const std::vector<std::string>& filePaths, const std::string& mimeType) {
84 if(filePaths.empty())

Callers 2

add_resource_fileMethod · 0.85

Calls 3

jni_local_frameFunction · 0.85
string2jstringFunction · 0.85
jstring2stringFunction · 0.85

Tested by

no test coverage detected