[Scummvm-cvs-logs] SF.net SVN: scummvm: [22549] scummvm/trunk/common/file.h

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sat May 20 08:11:03 CEST 2006


Revision: 22549
Author:   fingolfin
Date:     2006-05-20 08:10:04 -0700 (Sat, 20 May 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22549&view=rev

Log Message:
-----------
Make the copy constructor / assignment operator of class File private to prevent accidental copying of File objects

Modified Paths:
--------------
    scummvm/trunk/common/file.h
Modified: scummvm/trunk/common/file.h
===================================================================
--- scummvm/trunk/common/file.h	2006-05-20 15:09:15 UTC (rev 22548)
+++ scummvm/trunk/common/file.h	2006-05-20 15:10:04 UTC (rev 22549)
@@ -46,6 +46,14 @@
 	/** The name of this file, for debugging. */
 	String _name;
 
+private:
+	// Disallow copying File objects. There is not strict reason for this,
+	// except that so far we never had real need for such a feature, and
+	// code that accidentally copied File objects tended to break in strange
+	// ways.
+	File(const File &f);
+	File &operator  =(const File &f);
+
 public:
 	enum AccessMode {
 		kFileReadMode = 1,
@@ -64,6 +72,7 @@
 	File();
 	virtual ~File();
 
+
 	void incRef();
 	void decRef();
 


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