aboutsummaryrefslogtreecommitdiff
path: root/common/fs.cpp
diff options
context:
space:
mode:
authorMax Horn2008-08-03 18:35:51 +0000
committerMax Horn2008-08-03 18:35:51 +0000
commit4d5df949c7ee7066fca39b714ecdb4679fe9b629 (patch)
treea173b624aa26f388758b23d29673c17bbe7db953 /common/fs.cpp
parent01f07b5e218cc2179343d4e6b3b905efc5fb9172 (diff)
downloadscummvm-rg350-4d5df949c7ee7066fca39b714ecdb4679fe9b629.tar.gz
scummvm-rg350-4d5df949c7ee7066fca39b714ecdb4679fe9b629.tar.bz2
scummvm-rg350-4d5df949c7ee7066fca39b714ecdb4679fe9b629.zip
FilesystemNode code: some comment cleanup; added FilesystemNode::openForReading() and openForWriting() methods (for now these are simple wrappers around Common::File)
svn-id: r33590
Diffstat (limited to 'common/fs.cpp')
-rw-r--r--common/fs.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/common/fs.cpp b/common/fs.cpp
index 7d803dacd4..3f585c6038 100644
--- a/common/fs.cpp
+++ b/common/fs.cpp
@@ -23,10 +23,13 @@
*/
#include "common/util.h"
+#include "common/file.h"
#include "common/system.h"
#include "backends/fs/abstract-fs.h"
#include "backends/fs/fs-factory.h"
+//namespace Common {
+
FilesystemNode::FilesystemNode() {
}
@@ -170,3 +173,41 @@ bool FilesystemNode::lookupFile(FSList &results, const Common::String &p, bool h
return !results.empty();
}
+
+Common::SeekableReadStream *FilesystemNode::openForReading() {
+ if (_realNode == 0)
+ return 0;
+#if 0
+ return _realNode->openForReading();
+#else
+ // FIXME: Until we support openForReading in AbstractFilesystemNode,
+ // we just use Common::File.
+ Common::File *confFile = new Common::File();
+ assert(confFile);
+ if (!confFile->open(*this)) {
+ delete confFile;
+ confFile = 0;
+ }
+ return confFile;
+#endif
+}
+
+Common::WriteStream *FilesystemNode::openForWriting() {
+ if (_realNode == 0)
+ return 0;
+#if 0
+ return _realNode->openForWriting();
+#else
+ // FIXME: Until we support openForWriting in AbstractFilesystemNode,
+ // we just use Common::DumpFile.
+ Common::DumpFile *confFile = new Common::DumpFile();
+ assert(confFile);
+ if (!confFile->open(*this)) {
+ delete confFile;
+ confFile = 0;
+ }
+ return confFile;
+#endif
+}
+
+//} // End of namespace Common