Browse Source

Rename File::get_len() get_length()

Marcel Admiraal 4 years ago
parent
commit
da5d7db610
59 changed files with 101 additions and 101 deletions
  1. 4 4
      core/core_bind.cpp
  2. 1 1
      core/core_bind.h
  3. 1 1
      core/io/file_access_compressed.cpp
  4. 1 1
      core/io/file_access_compressed.h
  5. 11 11
      core/io/file_access_encrypted.cpp
  6. 1 1
      core/io/file_access_encrypted.h
  7. 1 1
      core/io/file_access_memory.cpp
  8. 1 1
      core/io/file_access_memory.h
  9. 1 1
      core/io/file_access_network.cpp
  10. 1 1
      core/io/file_access_network.h
  11. 1 1
      core/io/file_access_pack.cpp
  12. 1 1
      core/io/file_access_pack.h
  13. 3 3
      core/io/file_access_zip.cpp
  14. 1 1
      core/io/file_access_zip.h
  15. 1 1
      core/io/pck_packer.cpp
  16. 1 1
      core/io/xml_parser.cpp
  17. 1 1
      core/io/zip_io.cpp
  18. 2 2
      core/os/file_access.cpp
  19. 1 1
      core/os/file_access.h
  20. 4 4
      doc/classes/File.xml
  21. 1 1
      drivers/png/image_loader_png.cpp
  22. 1 1
      drivers/unix/file_access_unix.cpp
  23. 1 1
      drivers/unix/file_access_unix.h
  24. 1 1
      drivers/windows/file_access_windows.cpp
  25. 1 1
      drivers/windows/file_access_windows.h
  26. 1 1
      editor/fileserver/editor_file_server.cpp
  27. 1 1
      editor/import/resource_importer_image.cpp
  28. 1 1
      modules/bmp/image_loader_bmp.cpp
  29. 1 1
      modules/fbx/editor_scene_importer_fbx.cpp
  30. 1 1
      modules/gdnative/pluginscript/pluginscript_script.cpp
  31. 1 1
      modules/gdnative/videodecoder/video_stream_gdnative.cpp
  32. 1 1
      modules/gdscript/gdscript.cpp
  33. 1 1
      modules/gdscript/gdscript_cache.cpp
  34. 2 2
      modules/gdscript/tests/test_gdscript.cpp
  35. 1 1
      modules/gltf/gltf_document.cpp
  36. 1 1
      modules/jpg/image_loader_jpegd.cpp
  37. 2 2
      modules/mbedtls/crypto_mbedtls.cpp
  38. 1 1
      modules/minimp3/resource_importer_mp3.cpp
  39. 1 1
      modules/mono/utils/string_utils.cpp
  40. 1 1
      modules/stb_vorbis/resource_importer_ogg_vorbis.cpp
  41. 1 1
      modules/svg/image_loader_svg.cpp
  42. 1 1
      modules/text_server_adv/dynamic_font_adv.cpp
  43. 1 1
      modules/text_server_adv/text_server_adv.cpp
  44. 1 1
      modules/text_server_fb/dynamic_font_fb.cpp
  45. 1 1
      modules/tga/image_loader_tga.cpp
  46. 1 1
      modules/tinyexr/image_loader_tinyexr.cpp
  47. 1 1
      modules/webm/video_stream_webm.cpp
  48. 1 1
      modules/webp/image_loader_webp.cpp
  49. 1 1
      platform/android/file_access_android.cpp
  50. 1 1
      platform/android/file_access_android.h
  51. 2 2
      platform/javascript/api/javascript_tools_editor_plugin.cpp
  52. 4 4
      platform/javascript/export/export.cpp
  53. 1 1
      platform/osx/display_server_osx.mm
  54. 3 3
      platform/osx/export/export.cpp
  55. 3 3
      platform/uwp/export/export.cpp
  56. 1 1
      scene/resources/text_file.cpp
  57. 10 10
      tests/test_image.h
  58. 2 2
      tests/test_math.cpp
  59. 4 4
      tests/test_pck_packer.h

+ 4 - 4
core/core_bind.cpp

@@ -1272,9 +1272,9 @@ uint64_t _File::get_position() const {
 	return f->get_position();
 	return f->get_position();
 }
 }
 
 
-uint64_t _File::get_len() const {
+uint64_t _File::get_length() const {
 	ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use.");
 	ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use.");
-	return f->get_len();
+	return f->get_length();
 }
 }
 
 
 bool _File::eof_reached() const {
 bool _File::eof_reached() const {
@@ -1536,7 +1536,7 @@ void _File::_bind_methods() {
 	ClassDB::bind_method(D_METHOD("seek", "position"), &_File::seek);
 	ClassDB::bind_method(D_METHOD("seek", "position"), &_File::seek);
 	ClassDB::bind_method(D_METHOD("seek_end", "position"), &_File::seek_end, DEFVAL(0));
 	ClassDB::bind_method(D_METHOD("seek_end", "position"), &_File::seek_end, DEFVAL(0));
 	ClassDB::bind_method(D_METHOD("get_position"), &_File::get_position);
 	ClassDB::bind_method(D_METHOD("get_position"), &_File::get_position);
-	ClassDB::bind_method(D_METHOD("get_len"), &_File::get_len);
+	ClassDB::bind_method(D_METHOD("get_length"), &_File::get_length);
 	ClassDB::bind_method(D_METHOD("eof_reached"), &_File::eof_reached);
 	ClassDB::bind_method(D_METHOD("eof_reached"), &_File::eof_reached);
 	ClassDB::bind_method(D_METHOD("get_8"), &_File::get_8);
 	ClassDB::bind_method(D_METHOD("get_8"), &_File::get_8);
 	ClassDB::bind_method(D_METHOD("get_16"), &_File::get_16);
 	ClassDB::bind_method(D_METHOD("get_16"), &_File::get_16);
@@ -1545,7 +1545,7 @@ void _File::_bind_methods() {
 	ClassDB::bind_method(D_METHOD("get_float"), &_File::get_float);
 	ClassDB::bind_method(D_METHOD("get_float"), &_File::get_float);
 	ClassDB::bind_method(D_METHOD("get_double"), &_File::get_double);
 	ClassDB::bind_method(D_METHOD("get_double"), &_File::get_double);
 	ClassDB::bind_method(D_METHOD("get_real"), &_File::get_real);
 	ClassDB::bind_method(D_METHOD("get_real"), &_File::get_real);
-	ClassDB::bind_method(D_METHOD("get_buffer", "len"), &_File::get_buffer);
+	ClassDB::bind_method(D_METHOD("get_buffer", "length"), &_File::get_buffer);
 	ClassDB::bind_method(D_METHOD("get_line"), &_File::get_line);
 	ClassDB::bind_method(D_METHOD("get_line"), &_File::get_line);
 	ClassDB::bind_method(D_METHOD("get_csv_line", "delim"), &_File::get_csv_line, DEFVAL(","));
 	ClassDB::bind_method(D_METHOD("get_csv_line", "delim"), &_File::get_csv_line, DEFVAL(","));
 	ClassDB::bind_method(D_METHOD("get_as_text"), &_File::get_as_text);
 	ClassDB::bind_method(D_METHOD("get_as_text"), &_File::get_as_text);

+ 1 - 1
core/core_bind.h

@@ -391,7 +391,7 @@ public:
 	void seek(int64_t p_position); // Seek to a given position.
 	void seek(int64_t p_position); // Seek to a given position.
 	void seek_end(int64_t p_position = 0); // Seek from the end of file.
 	void seek_end(int64_t p_position = 0); // Seek from the end of file.
 	uint64_t get_position() const; // Get position in the file.
 	uint64_t get_position() const; // Get position in the file.
-	uint64_t get_len() const; // Get size of the file.
+	uint64_t get_length() const; // Get size of the file.
 
 
 	bool eof_reached() const; // Reading passed EOF.
 	bool eof_reached() const; // Reading passed EOF.
 
 

+ 1 - 1
core/io/file_access_compressed.cpp

@@ -237,7 +237,7 @@ uint64_t FileAccessCompressed::get_position() const {
 	}
 	}
 }
 }
 
 
-uint64_t FileAccessCompressed::get_len() const {
+uint64_t FileAccessCompressed::get_length() const {
 	ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use.");
 	ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use.");
 	if (writing) {
 	if (writing) {
 		return write_max;
 		return write_max;

+ 1 - 1
core/io/file_access_compressed.h

@@ -75,7 +75,7 @@ public:
 	virtual void seek(uint64_t p_position); ///< seek to a given position
 	virtual void seek(uint64_t p_position); ///< seek to a given position
 	virtual void seek_end(int64_t p_position = 0); ///< seek from the end of file
 	virtual void seek_end(int64_t p_position = 0); ///< seek from the end of file
 	virtual uint64_t get_position() const; ///< get position in the file
 	virtual uint64_t get_position() const; ///< get position in the file
-	virtual uint64_t get_len() const; ///< get size of the file
+	virtual uint64_t get_length() const; ///< get size of the file
 
 
 	virtual bool eof_reached() const; ///< reading passed EOF
 	virtual bool eof_reached() const; ///< reading passed EOF
 
 

+ 11 - 11
core/io/file_access_encrypted.cpp

@@ -69,7 +69,7 @@ Error FileAccessEncrypted::open_and_parse(FileAccess *p_base, const Vector<uint8
 		}
 		}
 
 
 		base = p_base->get_position();
 		base = p_base->get_position();
-		ERR_FAIL_COND_V(p_base->get_len() < base + length, ERR_FILE_CORRUPT);
+		ERR_FAIL_COND_V(p_base->get_length() < base + length, ERR_FILE_CORRUPT);
 		uint64_t ds = length;
 		uint64_t ds = length;
 		if (ds % 16) {
 		if (ds % 16) {
 			ds += 16 - (ds % 16);
 			ds += 16 - (ds % 16);
@@ -199,8 +199,8 @@ String FileAccessEncrypted::get_path_absolute() const {
 }
 }
 
 
 void FileAccessEncrypted::seek(uint64_t p_position) {
 void FileAccessEncrypted::seek(uint64_t p_position) {
-	if (p_position > get_len()) {
-		p_position = get_len();
+	if (p_position > get_length()) {
+		p_position = get_length();
 	}
 	}
 
 
 	pos = p_position;
 	pos = p_position;
@@ -208,14 +208,14 @@ void FileAccessEncrypted::seek(uint64_t p_position) {
 }
 }
 
 
 void FileAccessEncrypted::seek_end(int64_t p_position) {
 void FileAccessEncrypted::seek_end(int64_t p_position) {
-	seek(get_len() + p_position);
+	seek(get_length() + p_position);
 }
 }
 
 
 uint64_t FileAccessEncrypted::get_position() const {
 uint64_t FileAccessEncrypted::get_position() const {
 	return pos;
 	return pos;
 }
 }
 
 
-uint64_t FileAccessEncrypted::get_len() const {
+uint64_t FileAccessEncrypted::get_length() const {
 	return data.size();
 	return data.size();
 }
 }
 
 
@@ -225,7 +225,7 @@ bool FileAccessEncrypted::eof_reached() const {
 
 
 uint8_t FileAccessEncrypted::get_8() const {
 uint8_t FileAccessEncrypted::get_8() const {
 	ERR_FAIL_COND_V_MSG(writing, 0, "File has not been opened in read mode.");
 	ERR_FAIL_COND_V_MSG(writing, 0, "File has not been opened in read mode.");
-	if (pos >= get_len()) {
+	if (pos >= get_length()) {
 		eofed = true;
 		eofed = true;
 		return 0;
 		return 0;
 	}
 	}
@@ -239,7 +239,7 @@ uint64_t FileAccessEncrypted::get_buffer(uint8_t *p_dst, uint64_t p_length) cons
 	ERR_FAIL_COND_V(!p_dst && p_length > 0, -1);
 	ERR_FAIL_COND_V(!p_dst && p_length > 0, -1);
 	ERR_FAIL_COND_V_MSG(writing, -1, "File has not been opened in read mode.");
 	ERR_FAIL_COND_V_MSG(writing, -1, "File has not been opened in read mode.");
 
 
-	uint64_t to_copy = MIN(p_length, get_len() - pos);
+	uint64_t to_copy = MIN(p_length, get_length() - pos);
 	for (uint64_t i = 0; i < to_copy; i++) {
 	for (uint64_t i = 0; i < to_copy; i++) {
 		p_dst[i] = data[pos++];
 		p_dst[i] = data[pos++];
 	}
 	}
@@ -258,11 +258,11 @@ Error FileAccessEncrypted::get_error() const {
 void FileAccessEncrypted::store_buffer(const uint8_t *p_src, uint64_t p_length) {
 void FileAccessEncrypted::store_buffer(const uint8_t *p_src, uint64_t p_length) {
 	ERR_FAIL_COND_MSG(!writing, "File has not been opened in write mode.");
 	ERR_FAIL_COND_MSG(!writing, "File has not been opened in write mode.");
 
 
-	if (pos < get_len()) {
+	if (pos < get_length()) {
 		for (uint64_t i = 0; i < p_length; i++) {
 		for (uint64_t i = 0; i < p_length; i++) {
 			store_8(p_src[i]);
 			store_8(p_src[i]);
 		}
 		}
-	} else if (pos == get_len()) {
+	} else if (pos == get_length()) {
 		data.resize(pos + p_length);
 		data.resize(pos + p_length);
 		for (uint64_t i = 0; i < p_length; i++) {
 		for (uint64_t i = 0; i < p_length; i++) {
 			data.write[pos + i] = p_src[i];
 			data.write[pos + i] = p_src[i];
@@ -280,10 +280,10 @@ void FileAccessEncrypted::flush() {
 void FileAccessEncrypted::store_8(uint8_t p_dest) {
 void FileAccessEncrypted::store_8(uint8_t p_dest) {
 	ERR_FAIL_COND_MSG(!writing, "File has not been opened in write mode.");
 	ERR_FAIL_COND_MSG(!writing, "File has not been opened in write mode.");
 
 
-	if (pos < get_len()) {
+	if (pos < get_length()) {
 		data.write[pos] = p_dest;
 		data.write[pos] = p_dest;
 		pos++;
 		pos++;
-	} else if (pos == get_len()) {
+	} else if (pos == get_length()) {
 		data.push_back(p_dest);
 		data.push_back(p_dest);
 		pos++;
 		pos++;
 	}
 	}

+ 1 - 1
core/io/file_access_encrypted.h

@@ -71,7 +71,7 @@ public:
 	virtual void seek(uint64_t p_position); ///< seek to a given position
 	virtual void seek(uint64_t p_position); ///< seek to a given position
 	virtual void seek_end(int64_t p_position = 0); ///< seek from the end of file
 	virtual void seek_end(int64_t p_position = 0); ///< seek from the end of file
 	virtual uint64_t get_position() const; ///< get position in the file
 	virtual uint64_t get_position() const; ///< get position in the file
-	virtual uint64_t get_len() const; ///< get size of the file
+	virtual uint64_t get_length() const; ///< get size of the file
 
 
 	virtual bool eof_reached() const; ///< reading passed EOF
 	virtual bool eof_reached() const; ///< reading passed EOF
 
 

+ 1 - 1
core/io/file_access_memory.cpp

@@ -117,7 +117,7 @@ uint64_t FileAccessMemory::get_position() const {
 	return pos;
 	return pos;
 }
 }
 
 
-uint64_t FileAccessMemory::get_len() const {
+uint64_t FileAccessMemory::get_length() const {
 	ERR_FAIL_COND_V(!data, 0);
 	ERR_FAIL_COND_V(!data, 0);
 	return length;
 	return length;
 }
 }

+ 1 - 1
core/io/file_access_memory.h

@@ -52,7 +52,7 @@ public:
 	virtual void seek(uint64_t p_position); ///< seek to a given position
 	virtual void seek(uint64_t p_position); ///< seek to a given position
 	virtual void seek_end(int64_t p_position); ///< seek from the end of file
 	virtual void seek_end(int64_t p_position); ///< seek from the end of file
 	virtual uint64_t get_position() const; ///< get position in the file
 	virtual uint64_t get_position() const; ///< get position in the file
-	virtual uint64_t get_len() const; ///< get size of the file
+	virtual uint64_t get_length() const; ///< get size of the file
 
 
 	virtual bool eof_reached() const; ///< reading passed EOF
 	virtual bool eof_reached() const; ///< reading passed EOF
 
 

+ 1 - 1
core/io/file_access_network.cpp

@@ -328,7 +328,7 @@ uint64_t FileAccessNetwork::get_position() const {
 	return pos;
 	return pos;
 }
 }
 
 
-uint64_t FileAccessNetwork::get_len() const {
+uint64_t FileAccessNetwork::get_length() const {
 	ERR_FAIL_COND_V_MSG(!opened, 0, "File must be opened before use.");
 	ERR_FAIL_COND_V_MSG(!opened, 0, "File must be opened before use.");
 	return total_size;
 	return total_size;
 }
 }

+ 1 - 1
core/io/file_access_network.h

@@ -137,7 +137,7 @@ public:
 	virtual void seek(uint64_t p_position); ///< seek to a given position
 	virtual void seek(uint64_t p_position); ///< seek to a given position
 	virtual void seek_end(int64_t p_position = 0); ///< seek from the end of file
 	virtual void seek_end(int64_t p_position = 0); ///< seek from the end of file
 	virtual uint64_t get_position() const; ///< get position in the file
 	virtual uint64_t get_position() const; ///< get position in the file
-	virtual uint64_t get_len() const; ///< get size of the file
+	virtual uint64_t get_length() const; ///< get size of the file
 
 
 	virtual bool eof_reached() const; ///< reading passed EOF
 	virtual bool eof_reached() const; ///< reading passed EOF
 
 

+ 1 - 1
core/io/file_access_pack.cpp

@@ -279,7 +279,7 @@ uint64_t FileAccessPack::get_position() const {
 	return pos;
 	return pos;
 }
 }
 
 
-uint64_t FileAccessPack::get_len() const {
+uint64_t FileAccessPack::get_length() const {
 	return pf.size;
 	return pf.size;
 }
 }
 
 

+ 1 - 1
core/io/file_access_pack.h

@@ -163,7 +163,7 @@ public:
 	virtual void seek(uint64_t p_position);
 	virtual void seek(uint64_t p_position);
 	virtual void seek_end(int64_t p_position = 0);
 	virtual void seek_end(int64_t p_position = 0);
 	virtual uint64_t get_position() const;
 	virtual uint64_t get_position() const;
-	virtual uint64_t get_len() const;
+	virtual uint64_t get_length() const;
 
 
 	virtual bool eof_reached() const;
 	virtual bool eof_reached() const;
 
 

+ 3 - 3
core/io/file_access_zip.cpp

@@ -73,7 +73,7 @@ static long godot_seek(voidpf opaque, voidpf stream, uLong offset, int origin) {
 			pos = f->get_position() + offset;
 			pos = f->get_position() + offset;
 			break;
 			break;
 		case ZLIB_FILEFUNC_SEEK_END:
 		case ZLIB_FILEFUNC_SEEK_END:
-			pos = f->get_len() + offset;
+			pos = f->get_length() + offset;
 			break;
 			break;
 		default:
 		default:
 			break;
 			break;
@@ -270,7 +270,7 @@ void FileAccessZip::seek(uint64_t p_position) {
 
 
 void FileAccessZip::seek_end(int64_t p_position) {
 void FileAccessZip::seek_end(int64_t p_position) {
 	ERR_FAIL_COND(!zfile);
 	ERR_FAIL_COND(!zfile);
-	unzSeekCurrentFile(zfile, get_len() + p_position);
+	unzSeekCurrentFile(zfile, get_length() + p_position);
 }
 }
 
 
 uint64_t FileAccessZip::get_position() const {
 uint64_t FileAccessZip::get_position() const {
@@ -278,7 +278,7 @@ uint64_t FileAccessZip::get_position() const {
 	return unztell(zfile);
 	return unztell(zfile);
 }
 }
 
 
-uint64_t FileAccessZip::get_len() const {
+uint64_t FileAccessZip::get_length() const {
 	ERR_FAIL_COND_V(!zfile, 0);
 	ERR_FAIL_COND_V(!zfile, 0);
 	return file_info.uncompressed_size;
 	return file_info.uncompressed_size;
 }
 }

+ 1 - 1
core/io/file_access_zip.h

@@ -90,7 +90,7 @@ public:
 	virtual void seek(uint64_t p_position); ///< seek to a given position
 	virtual void seek(uint64_t p_position); ///< seek to a given position
 	virtual void seek_end(int64_t p_position = 0); ///< seek from the end of file
 	virtual void seek_end(int64_t p_position = 0); ///< seek from the end of file
 	virtual uint64_t get_position() const; ///< get position in the file
 	virtual uint64_t get_position() const; ///< get position in the file
-	virtual uint64_t get_len() const; ///< get size of the file
+	virtual uint64_t get_length() const; ///< get size of the file
 
 
 	virtual bool eof_reached() const; ///< reading passed EOF
 	virtual bool eof_reached() const; ///< reading passed EOF
 
 

+ 1 - 1
core/io/pck_packer.cpp

@@ -120,7 +120,7 @@ Error PCKPacker::add_file(const String &p_file, const String &p_src, bool p_encr
 	pf.path = p_file;
 	pf.path = p_file;
 	pf.src_path = p_src;
 	pf.src_path = p_src;
 	pf.ofs = ofs;
 	pf.ofs = ofs;
-	pf.size = f->get_len();
+	pf.size = f->get_length();
 
 
 	Vector<uint8_t> data = FileAccess::get_file_as_array(p_src);
 	Vector<uint8_t> data = FileAccess::get_file_as_array(p_src);
 	{
 	{

+ 1 - 1
core/io/xml_parser.cpp

@@ -476,7 +476,7 @@ Error XMLParser::open(const String &p_path) {
 
 
 	ERR_FAIL_COND_V_MSG(err != OK, err, "Cannot open file '" + p_path + "'.");
 	ERR_FAIL_COND_V_MSG(err != OK, err, "Cannot open file '" + p_path + "'.");
 
 
-	length = file->get_len();
+	length = file->get_length();
 	ERR_FAIL_COND_V(length < 1, ERR_FILE_CORRUPT);
 	ERR_FAIL_COND_V(length < 1, ERR_FILE_CORRUPT);
 
 
 	if (data) {
 	if (data) {

+ 1 - 1
core/io/zip_io.cpp

@@ -74,7 +74,7 @@ long zipio_seek(voidpf opaque, voidpf stream, uLong offset, int origin) {
 			pos = f->get_position() + offset;
 			pos = f->get_position() + offset;
 			break;
 			break;
 		case ZLIB_FILEFUNC_SEEK_END:
 		case ZLIB_FILEFUNC_SEEK_END:
-			pos = f->get_len() + offset;
+			pos = f->get_length() + offset;
 			break;
 			break;
 		default:
 		default:
 			break;
 			break;

+ 2 - 2
core/os/file_access.cpp

@@ -380,7 +380,7 @@ uint64_t FileAccess::get_buffer(uint8_t *p_dst, uint64_t p_length) const {
 
 
 String FileAccess::get_as_utf8_string() const {
 String FileAccess::get_as_utf8_string() const {
 	Vector<uint8_t> sourcef;
 	Vector<uint8_t> sourcef;
-	uint64_t len = get_len();
+	uint64_t len = get_length();
 	sourcef.resize(len + 1);
 	sourcef.resize(len + 1);
 
 
 	uint8_t *w = sourcef.ptrw();
 	uint8_t *w = sourcef.ptrw();
@@ -565,7 +565,7 @@ Vector<uint8_t> FileAccess::get_file_as_array(const String &p_path, Error *r_err
 		ERR_FAIL_V_MSG(Vector<uint8_t>(), "Can't open file from path '" + String(p_path) + "'.");
 		ERR_FAIL_V_MSG(Vector<uint8_t>(), "Can't open file from path '" + String(p_path) + "'.");
 	}
 	}
 	Vector<uint8_t> data;
 	Vector<uint8_t> data;
-	data.resize(f->get_len());
+	data.resize(f->get_length());
 	f->get_buffer(data.ptrw(), data.size());
 	f->get_buffer(data.ptrw(), data.size());
 	memdelete(f);
 	memdelete(f);
 	return data;
 	return data;

+ 1 - 1
core/os/file_access.h

@@ -96,7 +96,7 @@ public:
 	virtual void seek(uint64_t p_position) = 0; ///< seek to a given position
 	virtual void seek(uint64_t p_position) = 0; ///< seek to a given position
 	virtual void seek_end(int64_t p_position = 0) = 0; ///< seek from the end of file with negative offset
 	virtual void seek_end(int64_t p_position = 0) = 0; ///< seek from the end of file with negative offset
 	virtual uint64_t get_position() const = 0; ///< get position in the file
 	virtual uint64_t get_position() const = 0; ///< get position in the file
-	virtual uint64_t get_len() const = 0; ///< get size of the file
+	virtual uint64_t get_length() const = 0; ///< get size of the file
 
 
 	virtual bool eof_reached() const = 0; ///< reading passed EOF
 	virtual bool eof_reached() const = 0; ///< reading passed EOF
 
 

+ 4 - 4
doc/classes/File.xml

@@ -61,7 +61,7 @@
 			</return>
 			</return>
 			<description>
 			<description>
 				Returns [code]true[/code] if the file cursor has read past the end of the file.
 				Returns [code]true[/code] if the file cursor has read past the end of the file.
-				[b]Note:[/b] This function will still return [code]false[/code] while at the end of the file and only activates when reading past it. This can be confusing but it conforms to how low-level file access works in all operating systems. There is always [method get_len] and [method get_position] to implement a custom logic.
+				[b]Note:[/b] This function will still return [code]false[/code] while at the end of the file and only activates when reading past it. This can be confusing but it conforms to how low-level file access works in all operating systems. There is always [method get_length] and [method get_position] to implement a custom logic.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="file_exists" qualifiers="const">
 		<method name="file_exists" qualifiers="const">
@@ -121,10 +121,10 @@
 		<method name="get_buffer" qualifiers="const">
 		<method name="get_buffer" qualifiers="const">
 			<return type="PackedByteArray">
 			<return type="PackedByteArray">
 			</return>
 			</return>
-			<argument index="0" name="len" type="int">
+			<argument index="0" name="length" type="int">
 			</argument>
 			</argument>
 			<description>
 			<description>
-				Returns next [code]len[/code] bytes of the file as a [PackedByteArray].
+				Returns next [code]length[/code] bytes of the file as a [PackedByteArray].
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="get_csv_line" qualifiers="const">
 		<method name="get_csv_line" qualifiers="const">
@@ -158,7 +158,7 @@
 				Returns the next 32 bits from the file as a floating-point number.
 				Returns the next 32 bits from the file as a floating-point number.
 			</description>
 			</description>
 		</method>
 		</method>
-		<method name="get_len" qualifiers="const">
+		<method name="get_length" qualifiers="const">
 			<return type="int">
 			<return type="int">
 			</return>
 			</return>
 			<description>
 			<description>

+ 1 - 1
drivers/png/image_loader_png.cpp

@@ -37,7 +37,7 @@
 #include <string.h>
 #include <string.h>
 
 
 Error ImageLoaderPNG::load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear, float p_scale) {
 Error ImageLoaderPNG::load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear, float p_scale) {
-	const uint64_t buffer_size = f->get_len();
+	const uint64_t buffer_size = f->get_length();
 	Vector<uint8_t> file_buffer;
 	Vector<uint8_t> file_buffer;
 	Error err = file_buffer.resize(buffer_size);
 	Error err = file_buffer.resize(buffer_size);
 	if (err) {
 	if (err) {

+ 1 - 1
drivers/unix/file_access_unix.cpp

@@ -212,7 +212,7 @@ uint64_t FileAccessUnix::get_position() const {
 	return pos;
 	return pos;
 }
 }
 
 
-uint64_t FileAccessUnix::get_len() const {
+uint64_t FileAccessUnix::get_length() const {
 	ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use.");
 	ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use.");
 
 
 	int64_t pos = ftello(f);
 	int64_t pos = ftello(f);

+ 1 - 1
drivers/unix/file_access_unix.h

@@ -64,7 +64,7 @@ public:
 	virtual void seek(uint64_t p_position); ///< seek to a given position
 	virtual void seek(uint64_t p_position); ///< seek to a given position
 	virtual void seek_end(int64_t p_position = 0); ///< seek from the end of file
 	virtual void seek_end(int64_t p_position = 0); ///< seek from the end of file
 	virtual uint64_t get_position() const; ///< get position in the file
 	virtual uint64_t get_position() const; ///< get position in the file
-	virtual uint64_t get_len() const; ///< get size of the file
+	virtual uint64_t get_length() const; ///< get size of the file
 
 
 	virtual bool eof_reached() const; ///< reading passed EOF
 	virtual bool eof_reached() const; ///< reading passed EOF
 
 

+ 1 - 1
drivers/windows/file_access_windows.cpp

@@ -219,7 +219,7 @@ uint64_t FileAccessWindows::get_position() const {
 	return aux_position;
 	return aux_position;
 }
 }
 
 
-uint64_t FileAccessWindows::get_len() const {
+uint64_t FileAccessWindows::get_length() const {
 	ERR_FAIL_COND_V(!f, 0);
 	ERR_FAIL_COND_V(!f, 0);
 
 
 	uint64_t pos = get_position();
 	uint64_t pos = get_position();

+ 1 - 1
drivers/windows/file_access_windows.h

@@ -59,7 +59,7 @@ public:
 	virtual void seek(uint64_t p_position); ///< seek to a given position
 	virtual void seek(uint64_t p_position); ///< seek to a given position
 	virtual void seek_end(int64_t p_position = 0); ///< seek from the end of file
 	virtual void seek_end(int64_t p_position = 0); ///< seek from the end of file
 	virtual uint64_t get_position() const; ///< get position in the file
 	virtual uint64_t get_position() const; ///< get position in the file
-	virtual uint64_t get_len() const; ///< get size of the file
+	virtual uint64_t get_length() const; ///< get size of the file
 
 
 	virtual bool eof_reached() const; ///< reading passed EOF
 	virtual bool eof_reached() const; ///< reading passed EOF
 
 

+ 1 - 1
editor/fileserver/editor_file_server.cpp

@@ -200,7 +200,7 @@ void EditorFileServer::_subthread_start(void *s) {
 				cd->connection->put_data(buf4, 4);
 				cd->connection->put_data(buf4, 4);
 				encode_uint32(OK, buf4);
 				encode_uint32(OK, buf4);
 				cd->connection->put_data(buf4, 4);
 				cd->connection->put_data(buf4, 4);
-				encode_uint64(fa->get_len(), buf4);
+				encode_uint64(fa->get_length(), buf4);
 				cd->connection->put_data(buf4, 8);
 				cd->connection->put_data(buf4, 8);
 
 
 				cd->files[id] = fa;
 				cd->files[id] = fa;

+ 1 - 1
editor/import/resource_importer_image.cpp

@@ -75,7 +75,7 @@ Error ResourceImporterImage::import(const String &p_source_file, const String &p
 
 
 	ERR_FAIL_COND_V_MSG(!f, ERR_CANT_OPEN, "Cannot open file from path '" + p_source_file + "'.");
 	ERR_FAIL_COND_V_MSG(!f, ERR_CANT_OPEN, "Cannot open file from path '" + p_source_file + "'.");
 
 
-	uint64_t len = f->get_len();
+	uint64_t len = f->get_length();
 
 
 	Vector<uint8_t> data;
 	Vector<uint8_t> data;
 	data.resize(len);
 	data.resize(len);

+ 1 - 1
modules/bmp/image_loader_bmp.cpp

@@ -205,7 +205,7 @@ Error ImageLoaderBMP::load_image(Ref<Image> p_image, FileAccess *f,
 
 
 	// A valid bmp file should always at least have a
 	// A valid bmp file should always at least have a
 	// file header and a minimal info header
 	// file header and a minimal info header
-	if (f->get_len() > BITMAP_FILE_HEADER_SIZE + BITMAP_INFO_HEADER_MIN_SIZE) {
+	if (f->get_length() > BITMAP_FILE_HEADER_SIZE + BITMAP_INFO_HEADER_MIN_SIZE) {
 		// File Header
 		// File Header
 		bmp_header.bmp_file_header.bmp_signature = f->get_16();
 		bmp_header.bmp_file_header.bmp_signature = f->get_16();
 		if (bmp_header.bmp_file_header.bmp_signature == BITMAP_SIGNATURE) {
 		if (bmp_header.bmp_file_header.bmp_signature == BITMAP_SIGNATURE) {

+ 1 - 1
modules/fbx/editor_scene_importer_fbx.cpp

@@ -102,7 +102,7 @@ Node3D *EditorSceneImporterFBX::import_scene(const String &p_path, uint32_t p_fl
 		FBXDocParser::TokenList tokens;
 		FBXDocParser::TokenList tokens;
 
 
 		bool is_binary = false;
 		bool is_binary = false;
-		data.resize(f->get_len());
+		data.resize(f->get_length());
 
 
 		ERR_FAIL_COND_V(data.size() < 64, nullptr);
 		ERR_FAIL_COND_V(data.size() < 64, nullptr);
 
 

+ 1 - 1
modules/gdnative/pluginscript/pluginscript_script.cpp

@@ -441,7 +441,7 @@ Error PluginScript::load_source_code(const String &p_path) {
 	FileAccess *f = FileAccess::open(p_path, FileAccess::READ, &err);
 	FileAccess *f = FileAccess::open(p_path, FileAccess::READ, &err);
 	ERR_FAIL_COND_V_MSG(err, err, "Cannot open file '" + p_path + "'.");
 	ERR_FAIL_COND_V_MSG(err, err, "Cannot open file '" + p_path + "'.");
 
 
-	uint64_t len = f->get_len();
+	uint64_t len = f->get_length();
 	sourcef.resize(len + 1);
 	sourcef.resize(len + 1);
 	uint8_t *w = sourcef.ptrw();
 	uint8_t *w = sourcef.ptrw();
 	uint64_t r = f->get_buffer(w, len);
 	uint64_t r = f->get_buffer(w, len);

+ 1 - 1
modules/gdnative/videodecoder/video_stream_gdnative.cpp

@@ -58,7 +58,7 @@ int64_t GDAPI godot_videodecoder_file_seek(void *ptr, int64_t pos, int whence) {
 	FileAccess *file = reinterpret_cast<FileAccess *>(ptr);
 	FileAccess *file = reinterpret_cast<FileAccess *>(ptr);
 
 
 	if (file) {
 	if (file) {
-		int64_t len = file->get_len();
+		int64_t len = file->get_length();
 		switch (whence) {
 		switch (whence) {
 			case SEEK_SET: {
 			case SEEK_SET: {
 				if (pos > len) {
 				if (pos > len) {

+ 1 - 1
modules/gdscript/gdscript.cpp

@@ -1045,7 +1045,7 @@ Error GDScript::load_source_code(const String &p_path) {
 		ERR_FAIL_COND_V(err, err);
 		ERR_FAIL_COND_V(err, err);
 	}
 	}
 
 
-	uint64_t len = f->get_len();
+	uint64_t len = f->get_length();
 	sourcef.resize(len + 1);
 	sourcef.resize(len + 1);
 	uint8_t *w = sourcef.ptrw();
 	uint8_t *w = sourcef.ptrw();
 	uint64_t r = f->get_buffer(w, len);
 	uint64_t r = f->get_buffer(w, len);

+ 1 - 1
modules/gdscript/gdscript_cache.cpp

@@ -153,7 +153,7 @@ String GDScriptCache::get_source_code(const String &p_path) {
 		ERR_FAIL_COND_V(err, "");
 		ERR_FAIL_COND_V(err, "");
 	}
 	}
 
 
-	uint64_t len = f->get_len();
+	uint64_t len = f->get_length();
 	source_file.resize(len + 1);
 	source_file.resize(len + 1);
 	uint64_t r = f->get_buffer(source_file.ptrw(), len);
 	uint64_t r = f->get_buffer(source_file.ptrw(), len);
 	f->close();
 	f->close();

+ 2 - 2
modules/gdscript/tests/test_gdscript.cpp

@@ -215,8 +215,8 @@ void test(TestType p_type) {
 	init_language(fa->get_path_absolute().get_base_dir());
 	init_language(fa->get_path_absolute().get_base_dir());
 
 
 	Vector<uint8_t> buf;
 	Vector<uint8_t> buf;
-	uint64_t flen = fa->get_len();
-	buf.resize(fa->get_len() + 1);
+	uint64_t flen = fa->get_length();
+	buf.resize(flen + 1);
 	fa->get_buffer(buf.ptrw(), flen);
 	fa->get_buffer(buf.ptrw(), flen);
 	buf.write[flen] = 0;
 	buf.write[flen] = 0;
 
 

+ 1 - 1
modules/gltf/gltf_document.cpp

@@ -233,7 +233,7 @@ Error GLTFDocument::_parse_json(const String &p_path, Ref<GLTFState> state) {
 	}
 	}
 
 
 	Vector<uint8_t> array;
 	Vector<uint8_t> array;
-	array.resize(f->get_len());
+	array.resize(f->get_length());
 	f->get_buffer(array.ptrw(), array.size());
 	f->get_buffer(array.ptrw(), array.size());
 	String text;
 	String text;
 	text.parse_utf8((const char *)array.ptr(), array.size());
 	text.parse_utf8((const char *)array.ptr(), array.size());

+ 1 - 1
modules/jpg/image_loader_jpegd.cpp

@@ -105,7 +105,7 @@ Error jpeg_load_image_from_buffer(Image *p_image, const uint8_t *p_buffer, int p
 
 
 Error ImageLoaderJPG::load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear, float p_scale) {
 Error ImageLoaderJPG::load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear, float p_scale) {
 	Vector<uint8_t> src_image;
 	Vector<uint8_t> src_image;
-	uint64_t src_image_len = f->get_len();
+	uint64_t src_image_len = f->get_length();
 	ERR_FAIL_COND_V(src_image_len == 0, ERR_FILE_CORRUPT);
 	ERR_FAIL_COND_V(src_image_len == 0, ERR_FILE_CORRUPT);
 	src_image.resize(src_image_len);
 	src_image.resize(src_image_len);
 
 

+ 2 - 2
modules/mbedtls/crypto_mbedtls.cpp

@@ -58,7 +58,7 @@ Error CryptoKeyMbedTLS::load(String p_path, bool p_public_only) {
 	FileAccess *f = FileAccess::open(p_path, FileAccess::READ);
 	FileAccess *f = FileAccess::open(p_path, FileAccess::READ);
 	ERR_FAIL_COND_V_MSG(!f, ERR_INVALID_PARAMETER, "Cannot open CryptoKeyMbedTLS file '" + p_path + "'.");
 	ERR_FAIL_COND_V_MSG(!f, ERR_INVALID_PARAMETER, "Cannot open CryptoKeyMbedTLS file '" + p_path + "'.");
 
 
-	uint64_t flen = f->get_len();
+	uint64_t flen = f->get_length();
 	out.resize(flen + 1);
 	out.resize(flen + 1);
 	f->get_buffer(out.ptrw(), flen);
 	f->get_buffer(out.ptrw(), flen);
 	out.write[flen] = 0; // string terminator
 	out.write[flen] = 0; // string terminator
@@ -146,7 +146,7 @@ Error X509CertificateMbedTLS::load(String p_path) {
 	FileAccess *f = FileAccess::open(p_path, FileAccess::READ);
 	FileAccess *f = FileAccess::open(p_path, FileAccess::READ);
 	ERR_FAIL_COND_V_MSG(!f, ERR_INVALID_PARAMETER, "Cannot open X509CertificateMbedTLS file '" + p_path + "'.");
 	ERR_FAIL_COND_V_MSG(!f, ERR_INVALID_PARAMETER, "Cannot open X509CertificateMbedTLS file '" + p_path + "'.");
 
 
-	uint64_t flen = f->get_len();
+	uint64_t flen = f->get_length();
 	out.resize(flen + 1);
 	out.resize(flen + 1);
 	f->get_buffer(out.ptrw(), flen);
 	f->get_buffer(out.ptrw(), flen);
 	out.write[flen] = 0; // string terminator
 	out.write[flen] = 0; // string terminator

+ 1 - 1
modules/minimp3/resource_importer_mp3.cpp

@@ -79,7 +79,7 @@ Error ResourceImporterMP3::import(const String &p_source_file, const String &p_s
 
 
 	ERR_FAIL_COND_V(!f, ERR_CANT_OPEN);
 	ERR_FAIL_COND_V(!f, ERR_CANT_OPEN);
 
 
-	uint64_t len = f->get_len();
+	uint64_t len = f->get_length();
 
 
 	Vector<uint8_t> data;
 	Vector<uint8_t> data;
 	data.resize(len);
 	data.resize(len);

+ 1 - 1
modules/mono/utils/string_utils.cpp

@@ -170,7 +170,7 @@ Error read_all_file_utf8(const String &p_path, String &r_content) {
 	FileAccess *f = FileAccess::open(p_path, FileAccess::READ, &err);
 	FileAccess *f = FileAccess::open(p_path, FileAccess::READ, &err);
 	ERR_FAIL_COND_V_MSG(err != OK, err, "Cannot open file '" + p_path + "'.");
 	ERR_FAIL_COND_V_MSG(err != OK, err, "Cannot open file '" + p_path + "'.");
 
 
-	uint64_t len = f->get_len();
+	uint64_t len = f->get_length();
 	sourcef.resize(len + 1);
 	sourcef.resize(len + 1);
 	uint8_t *w = sourcef.ptrw();
 	uint8_t *w = sourcef.ptrw();
 	uint64_t r = f->get_buffer(w, len);
 	uint64_t r = f->get_buffer(w, len);

+ 1 - 1
modules/stb_vorbis/resource_importer_ogg_vorbis.cpp

@@ -79,7 +79,7 @@ Error ResourceImporterOGGVorbis::import(const String &p_source_file, const Strin
 
 
 	ERR_FAIL_COND_V_MSG(!f, ERR_CANT_OPEN, "Cannot open file '" + p_source_file + "'.");
 	ERR_FAIL_COND_V_MSG(!f, ERR_CANT_OPEN, "Cannot open file '" + p_source_file + "'.");
 
 
-	uint64_t len = f->get_len();
+	uint64_t len = f->get_length();
 
 
 	Vector<uint8_t> data;
 	Vector<uint8_t> data;
 	data.resize(len);
 	data.resize(len);

+ 1 - 1
modules/svg/image_loader_svg.cpp

@@ -140,7 +140,7 @@ Error ImageLoaderSVG::create_image_from_string(Ref<Image> p_image, const char *p
 }
 }
 
 
 Error ImageLoaderSVG::load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear, float p_scale) {
 Error ImageLoaderSVG::load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear, float p_scale) {
-	uint64_t size = f->get_len();
+	uint64_t size = f->get_length();
 	Vector<uint8_t> src_image;
 	Vector<uint8_t> src_image;
 	src_image.resize(size + 1);
 	src_image.resize(size + 1);
 	uint8_t *src_w = src_image.ptrw();
 	uint8_t *src_w = src_image.ptrw();

+ 1 - 1
modules/text_server_adv/dynamic_font_adv.cpp

@@ -66,7 +66,7 @@ DynamicFontDataAdvanced::DataAtSize *DynamicFontDataAdvanced::get_data_for_size(
 					ERR_FAIL_V_MSG(nullptr, "Cannot open font file '" + font_path + "'.");
 					ERR_FAIL_V_MSG(nullptr, "Cannot open font file '" + font_path + "'.");
 				}
 				}
 
 
-				uint64_t len = f->get_len();
+				uint64_t len = f->get_length();
 				font_mem_cache.resize(len);
 				font_mem_cache.resize(len);
 				f->get_buffer(font_mem_cache.ptrw(), len);
 				f->get_buffer(font_mem_cache.ptrw(), len);
 				font_mem = font_mem_cache.ptr();
 				font_mem = font_mem_cache.ptr();

+ 1 - 1
modules/text_server_adv/text_server_adv.cpp

@@ -181,7 +181,7 @@ bool TextServerAdvanced::load_support_data(const String &p_filename) {
 		UErrorCode err = U_ZERO_ERROR;
 		UErrorCode err = U_ZERO_ERROR;
 
 
 		// ICU data found.
 		// ICU data found.
-		uint64_t len = f->get_len();
+		uint64_t len = f->get_length();
 		icu_data = (uint8_t *)memalloc(len);
 		icu_data = (uint8_t *)memalloc(len);
 		f->get_buffer(icu_data, len);
 		f->get_buffer(icu_data, len);
 		f->close();
 		f->close();

+ 1 - 1
modules/text_server_fb/dynamic_font_fb.cpp

@@ -65,7 +65,7 @@ DynamicFontDataFallback::DataAtSize *DynamicFontDataFallback::get_data_for_size(
 					ERR_FAIL_V_MSG(nullptr, "Cannot open font file '" + font_path + "'.");
 					ERR_FAIL_V_MSG(nullptr, "Cannot open font file '" + font_path + "'.");
 				}
 				}
 
 
-				uint64_t len = f->get_len();
+				uint64_t len = f->get_length();
 				font_mem_cache.resize(len);
 				font_mem_cache.resize(len);
 				f->get_buffer(font_mem_cache.ptrw(), len);
 				f->get_buffer(font_mem_cache.ptrw(), len);
 				font_mem = font_mem_cache.ptr();
 				font_mem = font_mem_cache.ptr();

+ 1 - 1
modules/tga/image_loader_tga.cpp

@@ -226,7 +226,7 @@ Error ImageLoaderTGA::convert_to_image(Ref<Image> p_image, const uint8_t *p_buff
 
 
 Error ImageLoaderTGA::load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear, float p_scale) {
 Error ImageLoaderTGA::load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear, float p_scale) {
 	Vector<uint8_t> src_image;
 	Vector<uint8_t> src_image;
-	uint64_t src_image_len = f->get_len();
+	uint64_t src_image_len = f->get_length();
 	ERR_FAIL_COND_V(src_image_len == 0, ERR_FILE_CORRUPT);
 	ERR_FAIL_COND_V(src_image_len == 0, ERR_FILE_CORRUPT);
 	ERR_FAIL_COND_V(src_image_len < (int64_t)sizeof(tga_header_s), ERR_FILE_CORRUPT);
 	ERR_FAIL_COND_V(src_image_len < (int64_t)sizeof(tga_header_s), ERR_FILE_CORRUPT);
 	src_image.resize(src_image_len);
 	src_image.resize(src_image_len);

+ 1 - 1
modules/tinyexr/image_loader_tinyexr.cpp

@@ -37,7 +37,7 @@
 
 
 Error ImageLoaderTinyEXR::load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear, float p_scale) {
 Error ImageLoaderTinyEXR::load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear, float p_scale) {
 	Vector<uint8_t> src_image;
 	Vector<uint8_t> src_image;
-	uint64_t src_image_len = f->get_len();
+	uint64_t src_image_len = f->get_length();
 	ERR_FAIL_COND_V(src_image_len == 0, ERR_FILE_CORRUPT);
 	ERR_FAIL_COND_V(src_image_len == 0, ERR_FILE_CORRUPT);
 	src_image.resize(src_image_len);
 	src_image.resize(src_image_len);
 
 

+ 1 - 1
modules/webm/video_stream_webm.cpp

@@ -74,7 +74,7 @@ public:
 
 
 	virtual int Length(long long *total, long long *available) {
 	virtual int Length(long long *total, long long *available) {
 		if (file) {
 		if (file) {
-			const uint64_t len = file->get_len();
+			const uint64_t len = file->get_length();
 			if (total) {
 			if (total) {
 				*total = len;
 				*total = len;
 			}
 			}

+ 1 - 1
modules/webp/image_loader_webp.cpp

@@ -147,7 +147,7 @@ static Ref<Image> _webp_mem_loader_func(const uint8_t *p_png, int p_size) {
 
 
 Error ImageLoaderWEBP::load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear, float p_scale) {
 Error ImageLoaderWEBP::load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear, float p_scale) {
 	Vector<uint8_t> src_image;
 	Vector<uint8_t> src_image;
-	uint64_t src_image_len = f->get_len();
+	uint64_t src_image_len = f->get_length();
 	ERR_FAIL_COND_V(src_image_len == 0, ERR_FILE_CORRUPT);
 	ERR_FAIL_COND_V(src_image_len == 0, ERR_FILE_CORRUPT);
 	src_image.resize(src_image_len);
 	src_image.resize(src_image_len);
 
 

+ 1 - 1
platform/android/file_access_android.cpp

@@ -94,7 +94,7 @@ uint64_t FileAccessAndroid::get_position() const {
 	return pos;
 	return pos;
 }
 }
 
 
-uint64_t FileAccessAndroid::get_len() const {
+uint64_t FileAccessAndroid::get_length() const {
 	return len;
 	return len;
 }
 }
 
 

+ 1 - 1
platform/android/file_access_android.h

@@ -54,7 +54,7 @@ public:
 	virtual void seek(uint64_t p_position); ///< seek to a given position
 	virtual void seek(uint64_t p_position); ///< seek to a given position
 	virtual void seek_end(int64_t p_position = 0); ///< seek from the end of file
 	virtual void seek_end(int64_t p_position = 0); ///< seek from the end of file
 	virtual uint64_t get_position() const; ///< get position in the file
 	virtual uint64_t get_position() const; ///< get position in the file
-	virtual uint64_t get_len() const; ///< get size of the file
+	virtual uint64_t get_length() const; ///< get size of the file
 
 
 	virtual bool eof_reached() const; ///< reading passed EOF
 	virtual bool eof_reached() const; ///< reading passed EOF
 
 

+ 2 - 2
platform/javascript/api/javascript_tools_editor_plugin.cpp

@@ -72,7 +72,7 @@ void JavaScriptToolsEditorPlugin::_download_zip(Variant p_v) {
 	FileAccess *f = FileAccess::open("/tmp/project.zip", FileAccess::READ);
 	FileAccess *f = FileAccess::open("/tmp/project.zip", FileAccess::READ);
 	ERR_FAIL_COND_MSG(!f, "Unable to create zip file");
 	ERR_FAIL_COND_MSG(!f, "Unable to create zip file");
 	Vector<uint8_t> buf;
 	Vector<uint8_t> buf;
-	buf.resize(f->get_len());
+	buf.resize(f->get_length());
 	f->get_buffer(buf.ptrw(), buf.size());
 	f->get_buffer(buf.ptrw(), buf.size());
 	godot_js_os_download_buffer(buf.ptr(), buf.size(), "project.zip", "application/zip");
 	godot_js_os_download_buffer(buf.ptr(), buf.size(), "project.zip", "application/zip");
 }
 }
@@ -84,7 +84,7 @@ void JavaScriptToolsEditorPlugin::_zip_file(String p_path, String p_base_path, z
 		return;
 		return;
 	}
 	}
 	Vector<uint8_t> data;
 	Vector<uint8_t> data;
-	uint64_t len = f->get_len();
+	uint64_t len = f->get_length();
 	data.resize(len);
 	data.resize(len);
 	f->get_buffer(data.ptrw(), len);
 	f->get_buffer(data.ptrw(), len);
 	f->close();
 	f->close();

+ 4 - 4
platform/javascript/export/export.cpp

@@ -547,7 +547,7 @@ Error EditorExportPlatformJavaScript::_build_pwa(const Ref<EditorExportPreset> &
 			EditorNode::get_singleton()->show_warning(TTR("Could not read file:") + "\n" + sw_path);
 			EditorNode::get_singleton()->show_warning(TTR("Could not read file:") + "\n" + sw_path);
 			return ERR_FILE_CANT_READ;
 			return ERR_FILE_CANT_READ;
 		}
 		}
-		sw.resize(f->get_len());
+		sw.resize(f->get_length());
 		f->get_buffer(sw.ptrw(), sw.size());
 		f->get_buffer(sw.ptrw(), sw.size());
 		memdelete(f);
 		memdelete(f);
 		f = nullptr;
 		f = nullptr;
@@ -781,13 +781,13 @@ Error EditorExportPlatformJavaScript::export_project(const Ref<EditorExportPrese
 	FileAccess *f = nullptr;
 	FileAccess *f = nullptr;
 	f = FileAccess::open(pck_path, FileAccess::READ);
 	f = FileAccess::open(pck_path, FileAccess::READ);
 	if (f) {
 	if (f) {
-		file_sizes[pck_path.get_file()] = (uint64_t)f->get_len();
+		file_sizes[pck_path.get_file()] = (uint64_t)f->get_length();
 		memdelete(f);
 		memdelete(f);
 		f = nullptr;
 		f = nullptr;
 	}
 	}
 	f = FileAccess::open(base_path + ".wasm", FileAccess::READ);
 	f = FileAccess::open(base_path + ".wasm", FileAccess::READ);
 	if (f) {
 	if (f) {
-		file_sizes[base_name + ".wasm"] = (uint64_t)f->get_len();
+		file_sizes[base_name + ".wasm"] = (uint64_t)f->get_length();
 		memdelete(f);
 		memdelete(f);
 		f = nullptr;
 		f = nullptr;
 	}
 	}
@@ -800,7 +800,7 @@ Error EditorExportPlatformJavaScript::export_project(const Ref<EditorExportPrese
 		EditorNode::get_singleton()->show_warning(TTR("Could not read HTML shell:") + "\n" + html_path);
 		EditorNode::get_singleton()->show_warning(TTR("Could not read HTML shell:") + "\n" + html_path);
 		return ERR_FILE_CANT_READ;
 		return ERR_FILE_CANT_READ;
 	}
 	}
-	html.resize(f->get_len());
+	html.resize(f->get_length());
 	f->get_buffer(html.ptrw(), html.size());
 	f->get_buffer(html.ptrw(), html.size());
 	memdelete(f);
 	memdelete(f);
 	f = nullptr;
 	f = nullptr;

+ 1 - 1
platform/osx/display_server_osx.mm

@@ -3479,7 +3479,7 @@ void DisplayServerOSX::set_native_icon(const String &p_filename) {
 	ERR_FAIL_COND(!f);
 	ERR_FAIL_COND(!f);
 
 
 	Vector<uint8_t> data;
 	Vector<uint8_t> data;
-	uint64_t len = f->get_len();
+	uint64_t len = f->get_length();
 	data.resize(len);
 	data.resize(len);
 	f->get_buffer((uint8_t *)&data.write[0], len);
 	f->get_buffer((uint8_t *)&data.write[0], len);
 	memdelete(f);
 	memdelete(f);

+ 3 - 3
platform/osx/export/export.cpp

@@ -312,7 +312,7 @@ void EditorExportPlatformOSX::_make_icon(const Ref<Image> &p_icon, Vector<uint8_
 			}
 			}
 
 
 			int ofs = data.size();
 			int ofs = data.size();
-			uint64_t len = f->get_len();
+			uint64_t len = f->get_length();
 			data.resize(data.size() + len + 8);
 			data.resize(data.size() + len + 8);
 			f->get_buffer(&data.write[ofs + 8], len);
 			f->get_buffer(&data.write[ofs + 8], len);
 			memdelete(f);
 			memdelete(f);
@@ -689,8 +689,8 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
 				if (iconpath.get_extension() == "icns") {
 				if (iconpath.get_extension() == "icns") {
 					FileAccess *icon = FileAccess::open(iconpath, FileAccess::READ);
 					FileAccess *icon = FileAccess::open(iconpath, FileAccess::READ);
 					if (icon) {
 					if (icon) {
-						data.resize(icon->get_len());
-						icon->get_buffer(&data.write[0], icon->get_len());
+						data.resize(icon->get_length());
+						icon->get_buffer(&data.write[0], icon->get_length());
 						icon->close();
 						icon->close();
 						memdelete(icon);
 						memdelete(icon);
 					}
 					}

+ 3 - 3
platform/uwp/export/export.cpp

@@ -572,7 +572,7 @@ void AppxPackager::finish() {
 
 
 	FileAccess *blockmap_file = FileAccess::open(tmp_blockmap_file_path, FileAccess::READ);
 	FileAccess *blockmap_file = FileAccess::open(tmp_blockmap_file_path, FileAccess::READ);
 	Vector<uint8_t> blockmap_buffer;
 	Vector<uint8_t> blockmap_buffer;
-	blockmap_buffer.resize(blockmap_file->get_len());
+	blockmap_buffer.resize(blockmap_file->get_length());
 
 
 	blockmap_file->get_buffer(blockmap_buffer.ptrw(), blockmap_buffer.size());
 	blockmap_file->get_buffer(blockmap_buffer.ptrw(), blockmap_buffer.size());
 
 
@@ -590,7 +590,7 @@ void AppxPackager::finish() {
 
 
 	FileAccess *types_file = FileAccess::open(tmp_content_types_file_path, FileAccess::READ);
 	FileAccess *types_file = FileAccess::open(tmp_content_types_file_path, FileAccess::READ);
 	Vector<uint8_t> types_buffer;
 	Vector<uint8_t> types_buffer;
-	types_buffer.resize(types_file->get_len());
+	types_buffer.resize(types_file->get_length());
 
 
 	types_file->get_buffer(types_buffer.ptrw(), types_buffer.size());
 	types_file->get_buffer(types_buffer.ptrw(), types_buffer.size());
 
 
@@ -900,7 +900,7 @@ class EditorExportPlatformUWP : public EditorExportPlatform {
 			ERR_FAIL_V_MSG(data, err_string);
 			ERR_FAIL_V_MSG(data, err_string);
 		}
 		}
 
 
-		data.resize(f->get_len());
+		data.resize(f->get_length());
 		f->get_buffer(data.ptrw(), data.size());
 		f->get_buffer(data.ptrw(), data.size());
 
 
 		f->close();
 		f->close();

+ 1 - 1
scene/resources/text_file.cpp

@@ -55,7 +55,7 @@ Error TextFile::load_text(const String &p_path) {
 
 
 	ERR_FAIL_COND_V_MSG(err, err, "Cannot open TextFile '" + p_path + "'.");
 	ERR_FAIL_COND_V_MSG(err, err, "Cannot open TextFile '" + p_path + "'.");
 
 
-	uint64_t len = f->get_len();
+	uint64_t len = f->get_length();
 	sourcef.resize(len + 1);
 	sourcef.resize(len + 1);
 	uint8_t *w = sourcef.ptrw();
 	uint8_t *w = sourcef.ptrw();
 	uint64_t r = f->get_buffer(w, len);
 	uint64_t r = f->get_buffer(w, len);

+ 10 - 10
tests/test_image.h

@@ -101,8 +101,8 @@ TEST_CASE("[Image] Saving and loading") {
 	Ref<Image> image_bmp = memnew(Image());
 	Ref<Image> image_bmp = memnew(Image());
 	FileAccessRef f_bmp = FileAccess::open(TestUtils::get_data_path("images/icon.bmp"), FileAccess::READ, &err);
 	FileAccessRef f_bmp = FileAccess::open(TestUtils::get_data_path("images/icon.bmp"), FileAccess::READ, &err);
 	PackedByteArray data_bmp;
 	PackedByteArray data_bmp;
-	data_bmp.resize(f_bmp->get_len() + 1);
-	f_bmp->get_buffer(data_bmp.ptrw(), f_bmp->get_len());
+	data_bmp.resize(f_bmp->get_length() + 1);
+	f_bmp->get_buffer(data_bmp.ptrw(), f_bmp->get_length());
 	CHECK_MESSAGE(
 	CHECK_MESSAGE(
 			image_bmp->load_bmp_from_buffer(data_bmp) == OK,
 			image_bmp->load_bmp_from_buffer(data_bmp) == OK,
 			"The BMP image should load successfully.");
 			"The BMP image should load successfully.");
@@ -111,8 +111,8 @@ TEST_CASE("[Image] Saving and loading") {
 	Ref<Image> image_jpg = memnew(Image());
 	Ref<Image> image_jpg = memnew(Image());
 	FileAccessRef f_jpg = FileAccess::open(TestUtils::get_data_path("images/icon.jpg"), FileAccess::READ, &err);
 	FileAccessRef f_jpg = FileAccess::open(TestUtils::get_data_path("images/icon.jpg"), FileAccess::READ, &err);
 	PackedByteArray data_jpg;
 	PackedByteArray data_jpg;
-	data_jpg.resize(f_jpg->get_len() + 1);
-	f_jpg->get_buffer(data_jpg.ptrw(), f_jpg->get_len());
+	data_jpg.resize(f_jpg->get_length() + 1);
+	f_jpg->get_buffer(data_jpg.ptrw(), f_jpg->get_length());
 	CHECK_MESSAGE(
 	CHECK_MESSAGE(
 			image_jpg->load_jpg_from_buffer(data_jpg) == OK,
 			image_jpg->load_jpg_from_buffer(data_jpg) == OK,
 			"The JPG image should load successfully.");
 			"The JPG image should load successfully.");
@@ -121,8 +121,8 @@ TEST_CASE("[Image] Saving and loading") {
 	Ref<Image> image_webp = memnew(Image());
 	Ref<Image> image_webp = memnew(Image());
 	FileAccessRef f_webp = FileAccess::open(TestUtils::get_data_path("images/icon.webp"), FileAccess::READ, &err);
 	FileAccessRef f_webp = FileAccess::open(TestUtils::get_data_path("images/icon.webp"), FileAccess::READ, &err);
 	PackedByteArray data_webp;
 	PackedByteArray data_webp;
-	data_webp.resize(f_webp->get_len() + 1);
-	f_webp->get_buffer(data_webp.ptrw(), f_webp->get_len());
+	data_webp.resize(f_webp->get_length() + 1);
+	f_webp->get_buffer(data_webp.ptrw(), f_webp->get_length());
 	CHECK_MESSAGE(
 	CHECK_MESSAGE(
 			image_webp->load_webp_from_buffer(data_webp) == OK,
 			image_webp->load_webp_from_buffer(data_webp) == OK,
 			"The WEBP image should load successfully.");
 			"The WEBP image should load successfully.");
@@ -131,8 +131,8 @@ TEST_CASE("[Image] Saving and loading") {
 	Ref<Image> image_png = memnew(Image());
 	Ref<Image> image_png = memnew(Image());
 	FileAccessRef f_png = FileAccess::open(TestUtils::get_data_path("images/icon.png"), FileAccess::READ, &err);
 	FileAccessRef f_png = FileAccess::open(TestUtils::get_data_path("images/icon.png"), FileAccess::READ, &err);
 	PackedByteArray data_png;
 	PackedByteArray data_png;
-	data_png.resize(f_png->get_len() + 1);
-	f_png->get_buffer(data_png.ptrw(), f_png->get_len());
+	data_png.resize(f_png->get_length() + 1);
+	f_png->get_buffer(data_png.ptrw(), f_png->get_length());
 	CHECK_MESSAGE(
 	CHECK_MESSAGE(
 			image_png->load_png_from_buffer(data_png) == OK,
 			image_png->load_png_from_buffer(data_png) == OK,
 			"The PNG image should load successfully.");
 			"The PNG image should load successfully.");
@@ -141,8 +141,8 @@ TEST_CASE("[Image] Saving and loading") {
 	Ref<Image> image_tga = memnew(Image());
 	Ref<Image> image_tga = memnew(Image());
 	FileAccessRef f_tga = FileAccess::open(TestUtils::get_data_path("images/icon.tga"), FileAccess::READ, &err);
 	FileAccessRef f_tga = FileAccess::open(TestUtils::get_data_path("images/icon.tga"), FileAccess::READ, &err);
 	PackedByteArray data_tga;
 	PackedByteArray data_tga;
-	data_tga.resize(f_tga->get_len() + 1);
-	f_tga->get_buffer(data_tga.ptrw(), f_tga->get_len());
+	data_tga.resize(f_tga->get_length() + 1);
+	f_tga->get_buffer(data_tga.ptrw(), f_tga->get_length());
 	CHECK_MESSAGE(
 	CHECK_MESSAGE(
 			image_tga->load_tga_from_buffer(data_tga) == OK,
 			image_tga->load_tga_from_buffer(data_tga) == OK,
 			"The TGA image should load successfully.");
 			"The TGA image should load successfully.");

+ 2 - 2
tests/test_math.cpp

@@ -529,8 +529,8 @@ MainLoop *test() {
 	ERR_FAIL_COND_V_MSG(!fa, nullptr, "Could not open file: " + test);
 	ERR_FAIL_COND_V_MSG(!fa, nullptr, "Could not open file: " + test);
 
 
 	Vector<uint8_t> buf;
 	Vector<uint8_t> buf;
-	uint64_t flen = fa->get_len();
-	buf.resize(fa->get_len() + 1);
+	uint64_t flen = fa->get_length();
+	buf.resize(fa->get_length() + 1);
 	fa->get_buffer(buf.ptrw(), flen);
 	fa->get_buffer(buf.ptrw(), flen);
 	buf.write[flen] = 0;
 	buf.write[flen] = 0;
 
 

+ 4 - 4
tests/test_pck_packer.h

@@ -62,10 +62,10 @@ TEST_CASE("[PCKPacker] Pack an empty PCK file") {
 			err == OK,
 			err == OK,
 			"The generated empty PCK file should be opened successfully.");
 			"The generated empty PCK file should be opened successfully.");
 	CHECK_MESSAGE(
 	CHECK_MESSAGE(
-			f->get_len() >= 100,
+			f->get_length() >= 100,
 			"The generated empty PCK file shouldn't be too small (it should have the PCK header).");
 			"The generated empty PCK file shouldn't be too small (it should have the PCK header).");
 	CHECK_MESSAGE(
 	CHECK_MESSAGE(
-			f->get_len() <= 500,
+			f->get_length() <= 500,
 			"The generated empty PCK file shouldn't be too large.");
 			"The generated empty PCK file shouldn't be too large.");
 }
 }
 
 
@@ -103,10 +103,10 @@ TEST_CASE("[PCKPacker] Pack a PCK file with some files and directories") {
 			err == OK,
 			err == OK,
 			"The generated non-empty PCK file should be opened successfully.");
 			"The generated non-empty PCK file should be opened successfully.");
 	CHECK_MESSAGE(
 	CHECK_MESSAGE(
-			f->get_len() >= 25000,
+			f->get_length() >= 25000,
 			"The generated non-empty PCK file should be large enough to actually hold the contents specified above.");
 			"The generated non-empty PCK file should be large enough to actually hold the contents specified above.");
 	CHECK_MESSAGE(
 	CHECK_MESSAGE(
-			f->get_len() <= 35000,
+			f->get_length() <= 35000,
 			"The generated non-empty PCK file shouldn't be too large.");
 			"The generated non-empty PCK file shouldn't be too large.");
 }
 }
 } // namespace TestPCKPacker
 } // namespace TestPCKPacker