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/ds | |
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/ds')
-rw-r--r-- | backends/fs/ds/ds-fs.cpp | 17 | ||||
-rw-r--r-- | backends/fs/ds/ds-fs.h | 6 |
2 files changed, 23 insertions, 0 deletions
diff --git a/backends/fs/ds/ds-fs.cpp b/backends/fs/ds/ds-fs.cpp index db6a63cad7..d482109fdb 100644 --- a/backends/fs/ds/ds-fs.cpp +++ b/backends/fs/ds/ds-fs.cpp @@ -24,6 +24,7 @@ #include "common/util.h" //#include <NDS/ARM9/console.h> //basic print funcionality #include "backends/fs/ds/ds-fs.h" +#include "backends/fs/stdiostream.h" #include "dsmain.h" #include "fat/gba_nds_fat.h" @@ -204,6 +205,14 @@ AbstractFilesystemNode* DSFileSystemNode::getParent() const { return p; } +Common::SeekableReadStream *DSFileSystemNode::openForReading() { + return StdioStream::makeFromPath(getPath().c_str(), false); +} + +Common::WriteStream *DSFileSystemNode::openForWriting() { + return StdioStream::makeFromPath(getPath().c_str(), true); +} + ////////////////////////////////////////////////////////////////////////// // GBAMPFileSystemNode - File system using GBA Movie Player and CF card // ////////////////////////////////////////////////////////////////////////// @@ -367,6 +376,14 @@ AbstractFilesystemNode* GBAMPFileSystemNode::getParent() const { return p; } +Common::SeekableReadStream *GBAMPFileSystemNode::openForReading() { + return StdioStream::makeFromPath(getPath().c_str(), false); +} + +Common::WriteStream *GBAMPFileSystemNode::openForWriting() { + return StdioStream::makeFromPath(getPath().c_str(), true); +} + // Stdio replacements #define MAX_FILE_HANDLES 32 diff --git a/backends/fs/ds/ds-fs.h b/backends/fs/ds/ds-fs.h index 2856ec4903..2c1924a2fb 100644 --- a/backends/fs/ds/ds-fs.h +++ b/backends/fs/ds/ds-fs.h @@ -90,6 +90,9 @@ public: virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const; virtual AbstractFilesystemNode *getParent() const; + virtual Common::SeekableReadStream *openForReading(); + virtual Common::WriteStream *openForWriting(); + /** * Returns the zip file this node points to. * TODO: check this documentation. @@ -151,6 +154,9 @@ public: virtual AbstractFilesystemNode *getChild(const Common::String& name) const; virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const; virtual AbstractFilesystemNode *getParent() const; + + virtual Common::SeekableReadStream *openForReading(); + virtual Common::WriteStream *openForWriting(); }; struct fileHandle { |