diff options
author | letheed <letheed@outlook.com> | 2017-09-10 15:37:49 +0200 |
---|---|---|
committer | letheed <letheed@outlook.com> | 2017-09-20 13:11:10 +0200 |
commit | 5ad9be4c24e9d7dc5672fdc42cea896622fe5685 (patch) | |
tree | a8811a50265edd940b00e12b9bd522e3e9b4694e /core/io | |
parent | ecd226c6a751f8a20766363fd1f2e1e0e2da8fba (diff) |
Rename pos to position in user facing methods and variables
Rename user facing methods and variables as well as the corresponding
C++ methods according to the folloming changes:
* pos -> position
* rot -> rotation
* loc -> location
C++ variables are left as is.
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/file_access_buffered.cpp | 2 | ||||
-rw-r--r-- | core/io/file_access_buffered.h | 2 | ||||
-rw-r--r-- | core/io/file_access_compressed.cpp | 4 | ||||
-rw-r--r-- | core/io/file_access_compressed.h | 2 | ||||
-rw-r--r-- | core/io/file_access_encrypted.cpp | 4 | ||||
-rw-r--r-- | core/io/file_access_encrypted.h | 2 | ||||
-rw-r--r-- | core/io/file_access_memory.cpp | 2 | ||||
-rw-r--r-- | core/io/file_access_memory.h | 2 | ||||
-rw-r--r-- | core/io/file_access_network.cpp | 2 | ||||
-rw-r--r-- | core/io/file_access_network.h | 2 | ||||
-rw-r--r-- | core/io/file_access_pack.cpp | 8 | ||||
-rw-r--r-- | core/io/file_access_pack.h | 2 | ||||
-rw-r--r-- | core/io/file_access_zip.cpp | 6 | ||||
-rw-r--r-- | core/io/file_access_zip.h | 2 | ||||
-rw-r--r-- | core/io/pck_packer.cpp | 8 | ||||
-rw-r--r-- | core/io/resource_format_binary.cpp | 8 | ||||
-rw-r--r-- | core/io/stream_peer.cpp | 6 | ||||
-rw-r--r-- | core/io/stream_peer.h | 2 | ||||
-rw-r--r-- | core/io/xml_parser.cpp | 2 | ||||
-rw-r--r-- | core/io/zip_io.h | 4 |
20 files changed, 36 insertions, 36 deletions
diff --git a/core/io/file_access_buffered.cpp b/core/io/file_access_buffered.cpp index 859f2e3f8c..9ec03bf32b 100644 --- a/core/io/file_access_buffered.cpp +++ b/core/io/file_access_buffered.cpp @@ -76,7 +76,7 @@ void FileAccessBuffered::seek_end(int64_t p_position) { file.offset = file.size + p_position; }; -size_t FileAccessBuffered::get_pos() const { +size_t FileAccessBuffered::get_position() const { return file.offset; }; diff --git a/core/io/file_access_buffered.h b/core/io/file_access_buffered.h index d3137058fb..70aaeb8ae0 100644 --- a/core/io/file_access_buffered.h +++ b/core/io/file_access_buffered.h @@ -72,7 +72,7 @@ protected: int get_cache_size(); public: - virtual size_t get_pos() const; ///< get position in the file + virtual size_t get_position() const; ///< get position in the file virtual size_t get_len() const; ///< get size of the file virtual void seek(size_t p_position); ///< seek to a given position diff --git a/core/io/file_access_compressed.cpp b/core/io/file_access_compressed.cpp index 70430ca5d3..4750945854 100644 --- a/core/io/file_access_compressed.cpp +++ b/core/io/file_access_compressed.cpp @@ -62,7 +62,7 @@ Error FileAccessCompressed::open_after_magic(FileAccess *p_base) { block_size = f->get_32(); read_total = f->get_32(); int bc = (read_total / block_size) + 1; - int acc_ofs = f->get_pos() + bc * 4; + int acc_ofs = f->get_position() + bc * 4; int max_bs = 0; for (int i = 0; i < bc; i++) { @@ -232,7 +232,7 @@ void FileAccessCompressed::seek_end(int64_t p_position) { seek(read_total + p_position); } } -size_t FileAccessCompressed::get_pos() const { +size_t FileAccessCompressed::get_position() const { ERR_FAIL_COND_V(!f, 0); if (writing) { diff --git a/core/io/file_access_compressed.h b/core/io/file_access_compressed.h index ba84c9767c..1a57e2d4ee 100644 --- a/core/io/file_access_compressed.h +++ b/core/io/file_access_compressed.h @@ -74,7 +74,7 @@ public: virtual void seek(size_t p_position); ///< seek to a given position virtual void seek_end(int64_t p_position = 0); ///< seek from the end of file - virtual size_t get_pos() const; ///< get position in the file + virtual size_t get_position() const; ///< get position in the file virtual size_t get_len() 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 12503f3be4..461c5bafe2 100644 --- a/core/io/file_access_encrypted.cpp +++ b/core/io/file_access_encrypted.cpp @@ -71,7 +71,7 @@ Error FileAccessEncrypted::open_and_parse(FileAccess *p_base, const Vector<uint8 unsigned char md5d[16]; p_base->get_buffer(md5d, 16); length = p_base->get_64(); - base = p_base->get_pos(); + base = p_base->get_position(); ERR_FAIL_COND_V(p_base->get_len() < base + length, ERR_FILE_CORRUPT); uint32_t ds = length; if (ds % 16) { @@ -199,7 +199,7 @@ void FileAccessEncrypted::seek_end(int64_t p_position) { seek(data.size() + p_position); } -size_t FileAccessEncrypted::get_pos() const { +size_t FileAccessEncrypted::get_position() const { return pos; } diff --git a/core/io/file_access_encrypted.h b/core/io/file_access_encrypted.h index 74d00a5a8f..82f60ac654 100644 --- a/core/io/file_access_encrypted.h +++ b/core/io/file_access_encrypted.h @@ -61,7 +61,7 @@ public: virtual void seek(size_t p_position); ///< seek to a given position virtual void seek_end(int64_t p_position = 0); ///< seek from the end of file - virtual size_t get_pos() const; ///< get position in the file + virtual size_t get_position() const; ///< get position in the file virtual size_t get_len() 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 5b186b7798..b948394385 100644 --- a/core/io/file_access_memory.cpp +++ b/core/io/file_access_memory.cpp @@ -120,7 +120,7 @@ void FileAccessMemory::seek_end(int64_t p_position) { pos = length + p_position; } -size_t FileAccessMemory::get_pos() const { +size_t FileAccessMemory::get_position() const { ERR_FAIL_COND_V(!data, 0); return pos; diff --git a/core/io/file_access_memory.h b/core/io/file_access_memory.h index 7feb16461b..b7b8430089 100644 --- a/core/io/file_access_memory.h +++ b/core/io/file_access_memory.h @@ -51,7 +51,7 @@ public: virtual void seek(size_t p_position); ///< seek to a given position virtual void seek_end(int64_t p_position); ///< seek from the end of file - virtual size_t get_pos() const; ///< get position in the file + virtual size_t get_position() const; ///< get position in the file virtual size_t get_len() 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 58ca2d4c58..8c624226a1 100644 --- a/core/io/file_access_network.cpp +++ b/core/io/file_access_network.cpp @@ -350,7 +350,7 @@ void FileAccessNetwork::seek_end(int64_t p_position) { seek(total_size + p_position); } -size_t FileAccessNetwork::get_pos() const { +size_t FileAccessNetwork::get_position() const { ERR_FAIL_COND_V(!opened, 0); return pos; diff --git a/core/io/file_access_network.h b/core/io/file_access_network.h index cd5046f007..abbe378b60 100644 --- a/core/io/file_access_network.h +++ b/core/io/file_access_network.h @@ -145,7 +145,7 @@ public: virtual void seek(size_t p_position); ///< seek to a given position virtual void seek_end(int64_t p_position = 0); ///< seek from the end of file - virtual size_t get_pos() const; ///< get position in the file + virtual size_t get_position() const; ///< get position in the file virtual size_t get_len() 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 e511085ac5..ff4c28ec39 100644 --- a/core/io/file_access_pack.cpp +++ b/core/io/file_access_pack.cpp @@ -140,17 +140,17 @@ bool PackedSourcePCK::try_open_pack(const String &p_path) { if (magic != 0x43504447) { //maybe at he end.... self contained exe f->seek_end(); - f->seek(f->get_pos() - 4); + f->seek(f->get_position() - 4); magic = f->get_32(); if (magic != 0x43504447) { memdelete(f); return false; } - f->seek(f->get_pos() - 12); + f->seek(f->get_position() - 12); uint64_t ds = f->get_64(); - f->seek(f->get_pos() - ds - 8); + f->seek(f->get_position() - ds - 8); magic = f->get_32(); if (magic != 0x43504447) { @@ -236,7 +236,7 @@ void FileAccessPack::seek_end(int64_t p_position) { seek(pf.size + p_position); } -size_t FileAccessPack::get_pos() const { +size_t FileAccessPack::get_position() const { return pos; } diff --git a/core/io/file_access_pack.h b/core/io/file_access_pack.h index 758e9afa8e..3deb0d2bd3 100644 --- a/core/io/file_access_pack.h +++ b/core/io/file_access_pack.h @@ -148,7 +148,7 @@ public: virtual void seek(size_t p_position); virtual void seek_end(int64_t p_position = 0); - virtual size_t get_pos() const; + virtual size_t get_position() const; virtual size_t get_len() const; virtual bool eof_reached() const; diff --git a/core/io/file_access_zip.cpp b/core/io/file_access_zip.cpp index 8c99ef2983..73b23ac702 100644 --- a/core/io/file_access_zip.cpp +++ b/core/io/file_access_zip.cpp @@ -65,7 +65,7 @@ static uLong godot_write(voidpf opaque, voidpf stream, const void *buf, uLong si static long godot_tell(voidpf opaque, voidpf stream) { FileAccess *f = (FileAccess *)opaque; - return f->get_pos(); + return f->get_position(); }; static long godot_seek(voidpf opaque, voidpf stream, uLong offset, int origin) { @@ -76,7 +76,7 @@ static long godot_seek(voidpf opaque, voidpf stream, uLong offset, int origin) { switch (origin) { case ZLIB_FILEFUNC_SEEK_CUR: - pos = f->get_pos() + offset; + pos = f->get_position() + offset; break; case ZLIB_FILEFUNC_SEEK_END: pos = f->get_len() + offset; @@ -301,7 +301,7 @@ void FileAccessZip::seek_end(int64_t p_position) { unzSeekCurrentFile(zfile, get_len() + p_position); }; -size_t FileAccessZip::get_pos() const { +size_t FileAccessZip::get_position() const { ERR_FAIL_COND_V(!zfile, 0); return unztell(zfile); diff --git a/core/io/file_access_zip.h b/core/io/file_access_zip.h index 2a8ec3fca5..a40e1a753d 100644 --- a/core/io/file_access_zip.h +++ b/core/io/file_access_zip.h @@ -98,7 +98,7 @@ public: virtual void seek(size_t p_position); ///< seek to a given position virtual void seek_end(int64_t p_position = 0); ///< seek from the end of file - virtual size_t get_pos() const; ///< get position in the file + virtual size_t get_position() const; ///< get position in the file virtual size_t get_len() 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 f1f5b6f538..23e86580d1 100644 --- a/core/io/pck_packer.cpp +++ b/core/io/pck_packer.cpp @@ -119,7 +119,7 @@ Error PCKPacker::flush(bool p_verbose) { for (int i = 0; i < files.size(); i++) { file->store_pascal_string(files[i].path); - files[i].offset_offset = file->get_pos(); + files[i].offset_offset = file->get_position(); file->store_64(0); // offset file->store_64(files[i].size); // size @@ -130,10 +130,10 @@ Error PCKPacker::flush(bool p_verbose) { file->store_32(0); }; - uint64_t ofs = file->get_pos(); + uint64_t ofs = file->get_position(); ofs = _align(ofs, alignment); - _pad(file, ofs - file->get_pos()); + _pad(file, ofs - file->get_position()); const uint32_t buf_max = 65536; uint8_t *buf = memnew_arr(uint8_t, buf_max); @@ -150,7 +150,7 @@ Error PCKPacker::flush(bool p_verbose) { to_write -= read; }; - uint64_t pos = file->get_pos(); + uint64_t pos = file->get_position(); file->seek(files[i].offset_offset); // go back to store the file's offset file->store_64(ofs); file->seek(pos); diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index 16ec6cd3c5..900db7c2dc 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -1179,7 +1179,7 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, cons save_ustring(fw, get_ustring(f)); //type - size_t md_ofs = f->get_pos(); + size_t md_ofs = f->get_position(); size_t importmd_ofs = f->get_64(); fw->store_64(0); //metadata offset @@ -1227,7 +1227,7 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, cons save_ustring(fw, path); } - int64_t size_diff = (int64_t)fw->get_pos() - (int64_t)f->get_pos(); + int64_t size_diff = (int64_t)fw->get_position() - (int64_t)f->get_position(); //internal resources uint32_t int_resources_size = f->get_32(); @@ -1880,7 +1880,7 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path, const RES &p } else { save_unicode_string(r->get_path()); //actual external } - ofs_pos.push_back(f->get_pos()); + ofs_pos.push_back(f->get_position()); f->store_64(0); //offset in 64 bits } @@ -1891,7 +1891,7 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path, const RES &p ResourceData &rd = E->get(); - ofs_table.push_back(f->get_pos()); + ofs_table.push_back(f->get_position()); save_unicode_string(rd.type); f->store_32(rd.properties.size()); diff --git a/core/io/stream_peer.cpp b/core/io/stream_peer.cpp index f4f81f0807..2583eb369d 100644 --- a/core/io/stream_peer.cpp +++ b/core/io/stream_peer.cpp @@ -405,9 +405,9 @@ void StreamPeer::_bind_methods() { void StreamPeerBuffer::_bind_methods() { - ClassDB::bind_method(D_METHOD("seek", "pos"), &StreamPeerBuffer::seek); + ClassDB::bind_method(D_METHOD("seek", "position"), &StreamPeerBuffer::seek); ClassDB::bind_method(D_METHOD("get_size"), &StreamPeerBuffer::get_size); - ClassDB::bind_method(D_METHOD("get_pos"), &StreamPeerBuffer::get_pos); + ClassDB::bind_method(D_METHOD("get_position"), &StreamPeerBuffer::get_position); ClassDB::bind_method(D_METHOD("resize", "size"), &StreamPeerBuffer::resize); ClassDB::bind_method(D_METHOD("set_data_array", "data"), &StreamPeerBuffer::set_data_array); ClassDB::bind_method(D_METHOD("get_data_array"), &StreamPeerBuffer::get_data_array); @@ -484,7 +484,7 @@ int StreamPeerBuffer::get_size() const { return data.size(); } -int StreamPeerBuffer::get_pos() const { +int StreamPeerBuffer::get_position() const { return pointer; } diff --git a/core/io/stream_peer.h b/core/io/stream_peer.h index 1ee997c123..b120d18501 100644 --- a/core/io/stream_peer.h +++ b/core/io/stream_peer.h @@ -111,7 +111,7 @@ public: void seek(int p_pos); int get_size() const; - int get_pos() const; + int get_position() const; void resize(int p_size); void set_data_array(const PoolVector<uint8_t> &p_data); diff --git a/core/io/xml_parser.cpp b/core/io/xml_parser.cpp index 3a4be7cd13..8ae68183d7 100644 --- a/core/io/xml_parser.cpp +++ b/core/io/xml_parser.cpp @@ -369,7 +369,7 @@ void XMLParser::_bind_methods() { ClassDB::bind_method(D_METHOD("is_empty"), &XMLParser::is_empty); ClassDB::bind_method(D_METHOD("get_current_line"), &XMLParser::get_current_line); ClassDB::bind_method(D_METHOD("skip_section"), &XMLParser::skip_section); - ClassDB::bind_method(D_METHOD("seek", "pos"), &XMLParser::seek); + ClassDB::bind_method(D_METHOD("seek", "position"), &XMLParser::seek); ClassDB::bind_method(D_METHOD("open", "file"), &XMLParser::open); ClassDB::bind_method(D_METHOD("open_buffer", "buffer"), &XMLParser::open_buffer); diff --git a/core/io/zip_io.h b/core/io/zip_io.h index 8cf971ee08..ce3c919b77 100644 --- a/core/io/zip_io.h +++ b/core/io/zip_io.h @@ -72,7 +72,7 @@ static uLong zipio_write(voidpf opaque, voidpf stream, const void *buf, uLong si static long zipio_tell(voidpf opaque, voidpf stream) { FileAccess *f = *(FileAccess **)opaque; - return f->get_pos(); + return f->get_position(); }; static long zipio_seek(voidpf opaque, voidpf stream, uLong offset, int origin) { @@ -83,7 +83,7 @@ static long zipio_seek(voidpf opaque, voidpf stream, uLong offset, int origin) { switch (origin) { case ZLIB_FILEFUNC_SEEK_CUR: - pos = f->get_pos() + offset; + pos = f->get_position() + offset; break; case ZLIB_FILEFUNC_SEEK_END: pos = f->get_len() + offset; |