You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Use append_ instead of parse_ for String methods.
This commit is contained in:
@@ -1121,7 +1121,7 @@ Error GDScript::load_source_code(const String &p_path) {
|
||||
w[len] = 0;
|
||||
|
||||
String s;
|
||||
if (s.parse_utf8((const char *)w, len) != OK) {
|
||||
if (s.append_utf8((const char *)w, len) != OK) {
|
||||
ERR_FAIL_V_MSG(ERR_INVALID_DATA, "Script '" + p_path + "' contains invalid unicode (UTF-8), so it was not loaded. Please ensure that scripts are saved in valid UTF-8 unicode.");
|
||||
}
|
||||
|
||||
|
||||
@@ -275,7 +275,7 @@ String GDScriptCache::get_source_code(const String &p_path) {
|
||||
source_file.write[len] = 0;
|
||||
|
||||
String source;
|
||||
if (source.parse_utf8((const char *)source_file.ptr(), len) != OK) {
|
||||
if (source.append_utf8((const char *)source_file.ptr(), len) != OK) {
|
||||
ERR_FAIL_V_MSG("", "Script '" + p_path + "' contains invalid unicode (UTF-8), so it was not loaded. Please ensure that scripts are saved in valid UTF-8 unicode.");
|
||||
}
|
||||
return source;
|
||||
|
||||
@@ -61,7 +61,7 @@ Error GDScriptLanguageProtocol::LSPeer::handle_data() {
|
||||
if (l > 3 && r[l] == '\n' && r[l - 1] == '\r' && r[l - 2] == '\n' && r[l - 3] == '\r') {
|
||||
r[l - 3] = '\0'; // Null terminate to read string
|
||||
String header;
|
||||
header.parse_utf8(r);
|
||||
header.append_utf8(r);
|
||||
content_length = header.substr(16).to_int();
|
||||
has_header = true;
|
||||
req_pos = 0;
|
||||
@@ -88,7 +88,7 @@ Error GDScriptLanguageProtocol::LSPeer::handle_data() {
|
||||
|
||||
// Parse data
|
||||
String msg;
|
||||
msg.parse_utf8((const char *)req_buf, req_pos);
|
||||
msg.append_utf8((const char *)req_buf, req_pos);
|
||||
|
||||
// Reset to read again
|
||||
req_pos = 0;
|
||||
|
||||
@@ -102,7 +102,7 @@ protected:
|
||||
}
|
||||
|
||||
String source;
|
||||
source.parse_utf8(reinterpret_cast<const char *>(file.ptr()), file.size());
|
||||
source.append_utf8(reinterpret_cast<const char *>(file.ptr()), file.size());
|
||||
GDScriptTokenizerBuffer::CompressMode compress_mode = script_mode == EditorExportPreset::MODE_SCRIPT_BINARY_TOKENS_COMPRESSED ? GDScriptTokenizerBuffer::COMPRESS_ZSTD : GDScriptTokenizerBuffer::COMPRESS_NONE;
|
||||
file = GDScriptTokenizerBuffer::parse_code_string(source, compress_mode);
|
||||
if (file.is_empty()) {
|
||||
|
||||
@@ -310,7 +310,7 @@ void test(TestType p_type) {
|
||||
buf.write[flen] = 0;
|
||||
|
||||
String code;
|
||||
code.parse_utf8((const char *)&buf[0]);
|
||||
code.append_utf8((const char *)&buf[0]);
|
||||
|
||||
Vector<String> lines;
|
||||
int last = 0;
|
||||
|
||||
Reference in New Issue
Block a user