1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Merge pull request #104556 from Ivorforce/string-extend-instead-of-parse

Use `append_` instead of `parse_` for `String` methods.
This commit is contained in:
Thaddeus Crews
2025-03-29 10:16:33 -05:00
62 changed files with 245 additions and 274 deletions

View File

@@ -1677,7 +1677,7 @@ String EditorExportPlatformAndroid::_parse_string(const uint8_t *p_bytes, bool p
}
str8.write[len] = 0;
String str;
str.parse_utf8((const char *)str8.ptr(), len);
str.append_utf8((const char *)str8.ptr(), len);
return str;
} else {
String str;

View File

@@ -203,7 +203,7 @@ String FileAccessFilesystemJAndroid::get_line() const {
if (elem == '\n' || elem == '\0') {
// Found the end of the line
const_cast<FileAccessFilesystemJAndroid *>(this)->seek(start_position + line_buffer_position + 1);
if (result.parse_utf8((const char *)line_buffer.ptr(), line_buffer_position, true)) {
if (result.append_utf8((const char *)line_buffer.ptr(), line_buffer_position, true)) {
return String();
}
return result;
@@ -211,7 +211,7 @@ String FileAccessFilesystemJAndroid::get_line() const {
}
}
if (result.parse_utf8((const char *)line_buffer.ptr(), line_buffer_position, true)) {
if (result.append_utf8((const char *)line_buffer.ptr(), line_buffer_position, true)) {
return String();
}
return result;

View File

@@ -90,7 +90,7 @@ static inline String jstring_to_string(jstring source, JNIEnv *env = nullptr) {
}
const char *const source_utf8 = env->GetStringUTFChars(source, nullptr);
if (source_utf8) {
result.parse_utf8(source_utf8);
result.append_utf8(source_utf8);
env->ReleaseStringUTFChars(source, source_utf8);
}
}