[Scummvm-cvs-logs] CVS: scummvm/common file.cpp,1.1,1.2 file.h,1.1,1.2

Pawe? Ko?odziejski aquadran at users.sourceforge.net
Sat Aug 31 02:56:04 CEST 2002


Update of /cvsroot/scummvm/scummvm/common
In directory usw-pr-cvs1:/tmp/cvs-serv16262

Modified Files:
	file.cpp file.h 
Log Message:
updated

Index: file.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/file.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- file.cpp	31 Aug 2002 07:43:34 -0000	1.1
+++ file.cpp	31 Aug 2002 09:55:58 -0000	1.2
@@ -77,6 +77,11 @@
 void File::close() {
 	if (_handle)
 		fclose(_handle);
+	_handle = NULL;
+}
+
+bool File::isOpen() {
+	return _handle != NULL;
 }
 
 bool File::readFailed() {
@@ -136,7 +141,7 @@
 	} while (--size);
 }
 
-byte File::fileReadByte() {
+byte File::readByte() {
 	byte b;
 
 	if (fread(&b, 1, 1, _handle) != 1) {
@@ -146,26 +151,26 @@
 	return b ^ _encbyte;
 }
 
-uint16 File::fileReadWordLE() {
-	uint a = fileReadByte();
-	uint b = fileReadByte();
+uint16 File::readWordLE() {
+	uint16 a = readByte();
+	uint16 b = readByte();
 	return a | (b << 8);
 }
 
-uint32 File::fileReadDwordLE() {
-	uint a = fileReadWordLE();
-	uint b = fileReadWordLE();
+uint32 File::readDwordLE() {
+	uint32 a = readWordLE();
+	uint32 b = readWordLE();
 	return (b << 16) | a;
 }
 
-uint16 File::fileReadWordBE() {
-	uint b = fileReadByte();
-	uint a = fileReadByte();
+uint16 File::readWordBE() {
+	uint16 b = readByte();
+	uint16 a = readByte();
 	return a | (b << 8);
 }
 
-uint32 File::fileReadDwordBE() {
-	uint b = fileReadWordBE();
-	uint a = fileReadWordBE();
+uint32 File::readDwordBE() {
+	uint32 b = readWordBE();
+	uint32 a = readWordBE();
 	return (b << 16) | a;
 }

Index: file.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/file.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- file.h	31 Aug 2002 07:43:34 -0000	1.1
+++ file.h	31 Aug 2002 09:55:58 -0000	1.2
@@ -40,17 +40,18 @@
 	~File();
 	bool open(const char *filename, int mode = 1, byte encbyte = 0);
 	void close();
+	bool isOpen();
 	bool readFailed();
 	void clearReadFailed();
 	bool eof();
 	uint32 pos();
 	void seek(uint32 offs, int whence);
 	void read(void *ptr, uint32 size);
-	byte fileReadByte();
-	uint16 fileReadWordLE();
-	uint32 fileReadDwordLE();
-	uint16 fileReadWordBE();
-	uint32 fileReadDwordBE();
+	byte readByte();
+	uint16 readWordLE();
+	uint32 readDwordLE();
+	uint16 readWordBE();
+	uint32 readDwordBE();
 
 };
 





More information about the Scummvm-git-logs mailing list