aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMax Horn2006-05-20 15:10:04 +0000
committerMax Horn2006-05-20 15:10:04 +0000
commit4d1f4ffb50934aae2f3f948bbfbbf1937089a2ea (patch)
tree5609efae4196d95e86d2806df39c575d59133df2 /common
parente4ab8000f030d7846bd200e0b2c3f8fffc2e966c (diff)
downloadscummvm-rg350-4d1f4ffb50934aae2f3f948bbfbbf1937089a2ea.tar.gz
scummvm-rg350-4d1f4ffb50934aae2f3f948bbfbbf1937089a2ea.tar.bz2
scummvm-rg350-4d1f4ffb50934aae2f3f948bbfbbf1937089a2ea.zip
Make the copy constructor / assignment operator of class File private to prevent accidental copying of File objects
svn-id: r22549
Diffstat (limited to 'common')
-rw-r--r--common/file.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/file.h b/common/file.h
index ef27a18b33..5b7086924d 100644
--- a/common/file.h
+++ b/common/file.h
@@ -46,6 +46,14 @@ protected:
/** 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 @@ public:
File();
virtual ~File();
+
void incRef();
void decRef();