aboutsummaryrefslogtreecommitdiff
path: root/common/fs.h
diff options
context:
space:
mode:
authorMax Horn2008-03-29 21:12:36 +0000
committerMax Horn2008-03-29 21:12:36 +0000
commitdbe38029db40911cc82136820a771b2fc85454f2 (patch)
tree183991175713fe302a74e620bc639c218b231ab9 /common/fs.h
parente411ccc01f4d6e2071cb5d2d86590fa8041486a5 (diff)
downloadscummvm-rg350-dbe38029db40911cc82136820a771b2fc85454f2.tar.gz
scummvm-rg350-dbe38029db40911cc82136820a771b2fc85454f2.tar.bz2
scummvm-rg350-dbe38029db40911cc82136820a771b2fc85454f2.zip
Changed FilesystemNode to use a SharedPtr instead of implementing its own ref counting
svn-id: r31303
Diffstat (limited to 'common/fs.h')
-rw-r--r--common/fs.h26
1 files changed, 3 insertions, 23 deletions
diff --git a/common/fs.h b/common/fs.h
index b287280ca4..ed7355cc00 100644
--- a/common/fs.h
+++ b/common/fs.h
@@ -26,6 +26,7 @@
#define COMMON_FS_H
#include "common/array.h"
+#include "common/ptr.h"
#include "common/str.h"
//namespace Common {
@@ -67,8 +68,7 @@ class FSList : public Common::Array<FilesystemNode> {};
*/
class FilesystemNode {
private:
- int *_refCount;
- AbstractFilesystemNode *_realNode;
+ Common::SharedPtr<AbstractFilesystemNode> _realNode;
FilesystemNode(AbstractFilesystemNode *realNode);
public:
@@ -99,20 +99,7 @@ public:
*/
explicit FilesystemNode(const Common::String &path);
- /**
- * Copy constructor.
- */
- FilesystemNode(const FilesystemNode &node);
-
- /**
- * Destructor.
- */
- virtual ~FilesystemNode();
-
- /**
- * Copy operator.
- */
- FilesystemNode &operator= (const FilesystemNode &node);
+ virtual ~FilesystemNode() {}
/**
* Compare the name of this node to the name of another. Directories
@@ -234,13 +221,6 @@ public:
* @return true if matches could be found, false otherwise.
*/
virtual bool lookupFile(FSList &results, const Common::String &pattern, bool hidden, bool exhaustive, int depth = -1) const;
-
-protected:
- /**
- * Decreases the reference count to the FilesystemNode, and if necessary,
- * deletes the corresponding underlying references.
- */
- void decRefCount();
};
//} // End of namespace Common