MCPcopy Create free account
hub / github.com/antvis/F2Native / JavaStringToString

Function JavaStringToString

core/android/JNIUtil.cpp:84–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84std::string JavaStringToString(JNIEnv *env, jstring str) {
85 if(env == nullptr || str == nullptr) {
86 return "";
87 }
88
89 std::string u8_string;
90 const char *rawString = env->GetStringUTFChars(str, 0);
91 if(rawString == nullptr) {
92 u8_string = "";
93 } else {
94 u8_string = rawString;
95 }
96 env->ReleaseStringUTFChars(str, rawString);
97 ASSERT_NO_EXCEPTION();
98 return u8_string;
99}
100
101bool HasException(JNIEnv *env) { return env->ExceptionCheck() != JNI_FALSE; }
102

Callers 15

ExecuteMethod · 0.85
JavaMapStringIntToMapFunction · 0.85
CreateNativeChartFunction · 0.85
SetChartCanvasFunction · 0.85
SetChartSourceFunction · 0.85
SetChartScaleFunction · 0.85
SetChartAxisFunction · 0.85
SetChartCoordFunction · 0.85
SetChartAnimateFunction · 0.85
SetChartInteractionFunction · 0.85
SetChartToolTipFunction · 0.85
SetChartLegendFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected