diff options
Diffstat (limited to 'common/file.cpp')
-rw-r--r-- | common/file.cpp | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/common/file.cpp b/common/file.cpp index cbb2b58189..b9f097c986 100644 --- a/common/file.cpp +++ b/common/file.cpp @@ -273,45 +273,6 @@ uint32 File::read(void *ptr, uint32 len) { return real_len; } -byte File::readByte() { - byte b; - - if (_handle == NULL) { - error("File is not open!"); - return 0; - } - - if (fread(&b, 1, 1, _handle) != 1) { - clearerr(_handle); - _ioFailed = true; - } - return b ^ _encbyte; -} - -uint16 File::readUint16LE() { - uint16 a = readByte(); - uint16 b = readByte(); - return a | (b << 8); -} - -uint32 File::readUint32LE() { - uint32 a = readUint16LE(); - uint32 b = readUint16LE(); - return (b << 16) | a; -} - -uint16 File::readUint16BE() { - uint16 b = readByte(); - uint16 a = readByte(); - return a | (b << 8); -} - -uint32 File::readUint32BE() { - uint32 b = readUint16BE(); - uint32 a = readUint16BE(); - return (b << 16) | a; -} - uint32 File::write(const void *ptr, uint32 len) { byte *tmp = 0; @@ -345,36 +306,3 @@ uint32 File::write(const void *ptr, uint32 len) { return len; } - -void File::writeByte(byte value) { - value ^= _encbyte; - - if (_handle == NULL) { - error("File is not open!"); - } - - if (fwrite(&value, 1, 1, _handle) != 1) { - clearerr(_handle); - _ioFailed = true; - } -} - -void File::writeUint16LE(uint16 value) { - writeByte((byte)(value & 0xff)); - writeByte((byte)(value >> 8)); -} - -void File::writeUint32LE(uint32 value) { - writeUint16LE((uint16)(value & 0xffff)); - writeUint16LE((uint16)(value >> 16)); -} - -void File::writeUint16BE(uint16 value) { - writeByte((byte)(value >> 8)); - writeByte((byte)(value & 0xff)); -} - -void File::writeUint32BE(uint32 value) { - writeUint16BE((uint16)(value >> 16)); - writeUint16BE((uint16)(value & 0xffff)); -} |