diff options
author | Max Horn | 2008-09-03 12:56:46 +0000 |
---|---|---|
committer | Max Horn | 2008-09-03 12:56:46 +0000 |
commit | 7f18aaf8ec92a7ec7cd837db92b93dfada87eef3 (patch) | |
tree | e1510dfc5cd2b50b0d77c5a384307174687c4116 /backends/fs/posix | |
parent | 320a5dc99fa416d63a5fb8ec63c07463c80dc633 (diff) | |
download | scummvm-rg350-7f18aaf8ec92a7ec7cd837db92b93dfada87eef3.tar.gz scummvm-rg350-7f18aaf8ec92a7ec7cd837db92b93dfada87eef3.tar.bz2 scummvm-rg350-7f18aaf8ec92a7ec7cd837db92b93dfada87eef3.zip |
Pushed AbstractFilesystemNode::openForReading() / openForWriting() impls out to backends
svn-id: r34304
Diffstat (limited to 'backends/fs/posix')
-rw-r--r-- | backends/fs/posix/posix-fs.cpp | 9 | ||||
-rw-r--r-- | backends/fs/posix/posix-fs.h | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/backends/fs/posix/posix-fs.cpp b/backends/fs/posix/posix-fs.cpp index 992d54456b..72f45a5b27 100644 --- a/backends/fs/posix/posix-fs.cpp +++ b/backends/fs/posix/posix-fs.cpp @@ -25,6 +25,7 @@ #if defined(UNIX) #include "backends/fs/posix/posix-fs.h" +#include "backends/fs/stdiostream.h" #include "common/algorithm.h" #include <sys/param.h> @@ -231,4 +232,12 @@ AbstractFilesystemNode *POSIXFilesystemNode::getParent() const { return new POSIXFilesystemNode(Common::String(start, end), true); } +Common::SeekableReadStream *POSIXFilesystemNode::openForReading() { + return StdioStream::makeFromPath(getPath().c_str(), false); +} + +Common::WriteStream *POSIXFilesystemNode::openForWriting() { + return StdioStream::makeFromPath(getPath().c_str(), true); +} + #endif //#if defined(UNIX) diff --git a/backends/fs/posix/posix-fs.h b/backends/fs/posix/posix-fs.h index df50fc16af..9459b38010 100644 --- a/backends/fs/posix/posix-fs.h +++ b/backends/fs/posix/posix-fs.h @@ -70,6 +70,9 @@ public: virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const; virtual AbstractFilesystemNode *getParent() const; + virtual Common::SeekableReadStream *openForReading(); + virtual Common::WriteStream *openForWriting(); + private: /** * Tests and sets the _isValid and _isDirectory flags, using the stat() function. |