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

svn-id: r22549
This commit is contained in:
Max Horn 2006-05-20 15:10:04 +00:00
parent e4ab8000f0
commit 4d1f4ffb50

View file

@ -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();