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:
parent
e4ab8000f0
commit
4d1f4ffb50
1 changed files with 9 additions and 0 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue