[Scummvm-cvs-logs] SF.net SVN: scummvm:[42294] tools/branches/gsoc2009-gui

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Thu Jul 9 17:33:05 CEST 2009


Revision: 42294
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42294&view=rev
Author:   fingolfin
Date:     2009-07-09 15:33:04 +0000 (Thu, 09 Jul 2009)

Log Message:
-----------
Added File::rewind and File::getFileHandle methods; added FIXME to utils/file.h -> why do we have *two* wrappers for FILE ??

Modified Paths:
--------------
    tools/branches/gsoc2009-gui/util.cpp
    tools/branches/gsoc2009-gui/util.h
    tools/branches/gsoc2009-gui/utils/file.cpp
    tools/branches/gsoc2009-gui/utils/file.h

Modified: tools/branches/gsoc2009-gui/util.cpp
===================================================================
--- tools/branches/gsoc2009-gui/util.cpp	2009-07-09 15:32:25 UTC (rev 42293)
+++ tools/branches/gsoc2009-gui/util.cpp	2009-07-09 15:33:04 UTC (rev 42294)
@@ -470,6 +470,10 @@
 		throw FileException("Could not seek in file (" + _name.getFullPath() + ")");
 }
 
+void File::rewind() {
+	return ::rewind(_file);
+}
+
 int File::pos() {
 	return ftell(_file);
 }

Modified: tools/branches/gsoc2009-gui/util.h
===================================================================
--- tools/branches/gsoc2009-gui/util.h	2009-07-09 15:32:25 UTC (rev 42293)
+++ tools/branches/gsoc2009-gui/util.h	2009-07-09 15:33:04 UTC (rev 42294)
@@ -455,6 +455,9 @@
 	 */
 	void seek(long offset, int origin);
 
+	// TODO: document
+	void rewind();
+
 	/**
 	 * Returns the position in the stream.
 	 */
@@ -469,8 +472,11 @@
 	 * We implicitly convert into a FILE, so we can use fread() etc. directly.
 	 * @todo get rid of this ASAP
 	 */
-	operator FILE *() {return _file;}
+	operator FILE *() { return _file; }
 
+	// FIXME: Remove this method ASAP
+	FILE *getFileHandle() { return _file; }
+
 protected:
 	/** The mode the file was opened in. */
 	FileMode _mode;

Modified: tools/branches/gsoc2009-gui/utils/file.cpp
===================================================================
--- tools/branches/gsoc2009-gui/utils/file.cpp	2009-07-09 15:32:25 UTC (rev 42293)
+++ tools/branches/gsoc2009-gui/utils/file.cpp	2009-07-09 15:33:04 UTC (rev 42294)
@@ -31,7 +31,7 @@
 }
 
 File::File(::File &file)
-	: _handle((FILE *)file), _ioFailed(false), _owned(false) {
+	: _handle(file.getFileHandle()), _ioFailed(false), _owned(false) {
 }
 
 File::~File() {

Modified: tools/branches/gsoc2009-gui/utils/file.h
===================================================================
--- tools/branches/gsoc2009-gui/utils/file.h	2009-07-09 15:32:25 UTC (rev 42293)
+++ tools/branches/gsoc2009-gui/utils/file.h	2009-07-09 15:33:04 UTC (rev 42294)
@@ -49,8 +49,9 @@
 public:
 
 	File(FILE *file);
-	// Allow construction from a ::File object, not that we *do not* own the file pointer
+	// Allow construction from a ::File object, note that we *do not* own the file pointer
 	// in this scenario, we just act as a different wrapper for the file
+	// FIXME: Actually -- why do we have *two* wrappers anyway???
 	File(::File &file);
 	virtual ~File();
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list