summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/core_bind.cpp8
-rw-r--r--core/core_bind.h2
-rw-r--r--core/io/file_access_compressed.cpp2
-rw-r--r--core/io/file_access_compressed.h2
-rw-r--r--core/io/file_access_encrypted.cpp22
-rw-r--r--core/io/file_access_encrypted.h2
-rw-r--r--core/io/file_access_memory.cpp2
-rw-r--r--core/io/file_access_memory.h2
-rw-r--r--core/io/file_access_network.cpp2
-rw-r--r--core/io/file_access_network.h2
-rw-r--r--core/io/file_access_pack.cpp2
-rw-r--r--core/io/file_access_pack.h2
-rw-r--r--core/io/file_access_zip.cpp6
-rw-r--r--core/io/file_access_zip.h2
-rw-r--r--core/io/pck_packer.cpp2
-rw-r--r--core/io/xml_parser.cpp2
-rw-r--r--core/io/zip_io.cpp2
-rw-r--r--core/os/file_access.cpp4
-rw-r--r--core/os/file_access.h2
19 files changed, 35 insertions, 35 deletions
diff --git a/core/core_bind.cpp b/core/core_bind.cpp
index 63238e3029..b8c448dc82 100644
--- a/core/core_bind.cpp
+++ b/core/core_bind.cpp
@@ -1272,9 +1272,9 @@ uint64_t _File::get_position() const {
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.");
- return f->get_len();
+ return f->get_length();
}
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_end", "position"), &_File::seek_end, DEFVAL(0));
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("get_8"), &_File::get_8);
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_double"), &_File::get_double);
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_csv_line", "delim"), &_File::get_csv_line, DEFVAL(","));
ClassDB::bind_method(D_METHOD("get_as_text"), &_File::get_as_text);
diff --git a/core/core_bind.h b/core/core_bind.h
index 8bd96d8268..be8b30b38d 100644
--- a/core/core_bind.h
+++ b/core/core_bind.h
@@ -391,7 +391,7 @@ public:
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.
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.
diff --git a/core/io/file_access_compressed.cpp b/core/io/file_access_compressed.cpp
index efcaa80fc5..e54c947340 100644
--- a/core/io/file_access_compressed.cpp
+++ b/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.");
if (writing) {
return write_max;
diff --git a/core/io/file_access_compressed.h b/core/io/file_access_compressed.h
index d8a81c2417..19e4f241dd 100644
--- a/core/io/file_access_compressed.h
+++ b/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_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_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
diff --git a/core/io/file_access_encrypted.cpp b/core/io/file_access_encrypted.cpp
index 9a6bee7348..b9514c8c8b 100644
--- a/core/io/file_access_encrypted.cpp
+++ b/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();
- 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;
if (ds % 16) {
ds += 16 - (ds % 16);
@@ -199,8 +199,8 @@ String FileAccessEncrypted::get_path_absolute() const {
}
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;
@@ -208,14 +208,14 @@ void FileAccessEncrypted::seek(uint64_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 {
return pos;
}
-uint64_t FileAccessEncrypted::get_len() const {
+uint64_t FileAccessEncrypted::get_length() const {
return data.size();
}
@@ -225,7 +225,7 @@ bool FileAccessEncrypted::eof_reached() const {
uint8_t FileAccessEncrypted::get_8() const {
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;
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_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++) {
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) {
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++) {
store_8(p_src[i]);
}
- } else if (pos == get_len()) {
+ } else if (pos == get_length()) {
data.resize(pos + p_length);
for (uint64_t i = 0; i < p_length; i++) {
data.write[pos + i] = p_src[i];
@@ -280,10 +280,10 @@ void FileAccessEncrypted::flush() {
void FileAccessEncrypted::store_8(uint8_t p_dest) {
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;
pos++;
- } else if (pos == get_len()) {
+ } else if (pos == get_length()) {
data.push_back(p_dest);
pos++;
}
diff --git a/core/io/file_access_encrypted.h b/core/io/file_access_encrypted.h
index 8bea8c2585..00f14099f9 100644
--- a/core/io/file_access_encrypted.h
+++ b/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_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_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
diff --git a/core/io/file_access_memory.cpp b/core/io/file_access_memory.cpp
index 14e24d6668..0114ab1765 100644
--- a/core/io/file_access_memory.cpp
+++ b/core/io/file_access_memory.cpp
@@ -117,7 +117,7 @@ uint64_t FileAccessMemory::get_position() const {
return pos;
}
-uint64_t FileAccessMemory::get_len() const {
+uint64_t FileAccessMemory::get_length() const {
ERR_FAIL_COND_V(!data, 0);
return length;
}
diff --git a/core/io/file_access_memory.h b/core/io/file_access_memory.h
index cc589dc259..4157531d01 100644
--- a/core/io/file_access_memory.h
+++ b/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_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_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
diff --git a/core/io/file_access_network.cpp b/core/io/file_access_network.cpp
index dedd5523ed..63a8f9c5b6 100644
--- a/core/io/file_access_network.cpp
+++ b/core/io/file_access_network.cpp
@@ -328,7 +328,7 @@ uint64_t FileAccessNetwork::get_position() const {
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.");
return total_size;
}
diff --git a/core/io/file_access_network.h b/core/io/file_access_network.h
index 4810cca195..94b66c2480 100644
--- a/core/io/file_access_network.h
+++ b/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_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_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
diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp
index 3e1c51b733..e9983ece47 100644
--- a/core/io/file_access_pack.cpp
+++ b/core/io/file_access_pack.cpp
@@ -279,7 +279,7 @@ uint64_t FileAccessPack::get_position() const {
return pos;
}
-uint64_t FileAccessPack::get_len() const {
+uint64_t FileAccessPack::get_length() const {
return pf.size;
}
diff --git a/core/io/file_access_pack.h b/core/io/file_access_pack.h
index 763c0fb327..9747e865c8 100644
--- a/core/io/file_access_pack.h
+++ b/core/io/file_access_pack.h
@@ -163,7 +163,7 @@ public:
virtual void seek(uint64_t p_position);
virtual void seek_end(int64_t p_position = 0);
virtual uint64_t get_position() const;
- virtual uint64_t get_len() const;
+ virtual uint64_t get_length() const;
virtual bool eof_reached() const;
diff --git a/core/io/file_access_zip.cpp b/core/io/file_access_zip.cpp
index d7ff1b7e00..b8383fd865 100644
--- a/core/io/file_access_zip.cpp
+++ b/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;
break;
case ZLIB_FILEFUNC_SEEK_END:
- pos = f->get_len() + offset;
+ pos = f->get_length() + offset;
break;
default:
break;
@@ -270,7 +270,7 @@ void FileAccessZip::seek(uint64_t p_position) {
void FileAccessZip::seek_end(int64_t p_position) {
ERR_FAIL_COND(!zfile);
- unzSeekCurrentFile(zfile, get_len() + p_position);
+ unzSeekCurrentFile(zfile, get_length() + p_position);
}
uint64_t FileAccessZip::get_position() const {
@@ -278,7 +278,7 @@ uint64_t FileAccessZip::get_position() const {
return unztell(zfile);
}
-uint64_t FileAccessZip::get_len() const {
+uint64_t FileAccessZip::get_length() const {
ERR_FAIL_COND_V(!zfile, 0);
return file_info.uncompressed_size;
}
diff --git a/core/io/file_access_zip.h b/core/io/file_access_zip.h
index 91bdaafb68..cca14ded62 100644
--- a/core/io/file_access_zip.h
+++ b/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_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_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
diff --git a/core/io/pck_packer.cpp b/core/io/pck_packer.cpp
index 4fe22e57d8..cadb02b5dd 100644
--- a/core/io/pck_packer.cpp
+++ b/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.src_path = p_src;
pf.ofs = ofs;
- pf.size = f->get_len();
+ pf.size = f->get_length();
Vector<uint8_t> data = FileAccess::get_file_as_array(p_src);
{
diff --git a/core/io/xml_parser.cpp b/core/io/xml_parser.cpp
index f3ce2319e3..938d93a01b 100644
--- a/core/io/xml_parser.cpp
+++ b/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 + "'.");
- length = file->get_len();
+ length = file->get_length();
ERR_FAIL_COND_V(length < 1, ERR_FILE_CORRUPT);
if (data) {
diff --git a/core/io/zip_io.cpp b/core/io/zip_io.cpp
index e0e491dc85..fb4c76aa7a 100644
--- a/core/io/zip_io.cpp
+++ b/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;
break;
case ZLIB_FILEFUNC_SEEK_END:
- pos = f->get_len() + offset;
+ pos = f->get_length() + offset;
break;
default:
break;
diff --git a/core/os/file_access.cpp b/core/os/file_access.cpp
index d00d0ac5bb..d1b940190a 100644
--- a/core/os/file_access.cpp
+++ b/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 {
Vector<uint8_t> sourcef;
- uint64_t len = get_len();
+ uint64_t len = get_length();
sourcef.resize(len + 1);
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) + "'.");
}
Vector<uint8_t> data;
- data.resize(f->get_len());
+ data.resize(f->get_length());
f->get_buffer(data.ptrw(), data.size());
memdelete(f);
return data;
diff --git a/core/os/file_access.h b/core/os/file_access.h
index f9749c0fd1..1b9fb2f422 100644
--- a/core/os/file_access.h
+++ b/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_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_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