diff options
Diffstat (limited to 'backends/fs/ds/ds-fs.h')
-rw-r--r-- | backends/fs/ds/ds-fs.h | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/backends/fs/ds/ds-fs.h b/backends/fs/ds/ds-fs.h index 9ac453aca9..36e7bc9824 100644 --- a/backends/fs/ds/ds-fs.h +++ b/backends/fs/ds/ds-fs.h @@ -41,12 +41,10 @@ namespace DS { */ class DSFileSystemNode : public AbstractFilesystemNode { protected: - typedef class Common::String String; - static ZipFile* _zipFile; - String _displayName; - String _path; + Common::String _displayName; + Common::String _path; bool _isDirectory; bool _isValid; @@ -61,7 +59,7 @@ public: * * @param path String with the path the new node should point to. */ - DSFileSystemNode(const String &path); + DSFileSystemNode(const Common::String &path); /** * Creates a DSFilesystemNode for a given path. @@ -69,7 +67,7 @@ public: * @param path String with the path the new node should point to. * @param path true if path is a directory, false otherwise. */ - DSFileSystemNode(const String& path, bool isDir); + DSFileSystemNode(const Common::String& path, bool isDir); /** * Copy constructor. @@ -77,9 +75,9 @@ public: DSFileSystemNode(const DSFileSystemNode *node); virtual bool exists() const { return true; } //FIXME: this is just a stub - virtual String getDisplayName() const { return _displayName; } - virtual String getName() const { return _displayName; } - virtual String getPath() const { return _path; } + virtual Common::String getDisplayName() const { return _displayName; } + virtual Common::String getName() const { return _displayName; } + virtual Common::String getPath() const { return _path; } virtual bool isDirectory() const { return _isDirectory; } virtual bool isReadable() const { return true; } //FIXME: this is just a stub virtual bool isWritable() const { return true; } //FIXME: this is just a stub @@ -89,9 +87,12 @@ public: */ virtual AbstractFilesystemNode *clone() const { return new DSFileSystemNode(this); } virtual AbstractFilesystemNode *getChild(const Common::String& name) const; - virtual bool getChildren(AbstractFSList &list, ListMode mode = FilesystemNode::kListDirectoriesOnly, bool hidden = false) const; + 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. @@ -107,10 +108,8 @@ public: */ class GBAMPFileSystemNode : public AbstractFilesystemNode { protected: - typedef class Common::String String; - - String _displayName; - String _path; + Common::String _displayName; + Common::String _path; bool _isDirectory; bool _isValid; @@ -125,7 +124,7 @@ public: * * @param path String with the path the new node should point to. */ - GBAMPFileSystemNode(const String &path); + GBAMPFileSystemNode(const Common::String &path); /** * Creates a DSFilesystemNode for a given path. @@ -133,7 +132,7 @@ public: * @param path String with the path the new node should point to. * @param path true if path is a directory, false otherwise. */ - GBAMPFileSystemNode(const String &path, bool isDirectory); + GBAMPFileSystemNode(const Common::String &path, bool isDirectory); /** * Copy constructor. @@ -141,9 +140,9 @@ public: GBAMPFileSystemNode(const GBAMPFileSystemNode *node); virtual bool exists() const { return _isValid || _isDirectory; } - virtual String getDisplayName() const { return _displayName; } - virtual String getName() const { return _displayName; } - virtual String getPath() const { return _path; } + virtual Common::String getDisplayName() const { return _displayName; } + virtual Common::String getName() const { return _displayName; } + virtual Common::String getPath() const { return _path; } virtual bool isDirectory() const { return _isDirectory; } virtual bool isReadable() const { return true; } //FIXME: this is just a stub virtual bool isWritable() const { return true; } //FIXME: this is just a stub @@ -153,8 +152,11 @@ public: */ virtual AbstractFilesystemNode *clone() const { return new GBAMPFileSystemNode(this); } virtual AbstractFilesystemNode *getChild(const Common::String& name) const; - virtual bool getChildren(AbstractFSList &list, ListMode mode = FilesystemNode::kListDirectoriesOnly, bool hidden = false) 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 { @@ -179,15 +181,14 @@ struct fileHandle { // Please do not remove any of these prototypes that appear not to be required. FILE* std_fopen(const char* name, const char* mode); void std_fclose(FILE* handle); -int std_getc(FILE* handle); size_t std_fread(const void* ptr, size_t size, size_t numItems, FILE* handle); size_t std_fwrite(const void* ptr, size_t size, size_t numItems, FILE* handle); bool std_feof(FILE* handle); long int std_ftell(FILE* handle); int std_fseek(FILE* handle, long int offset, int whence); void std_clearerr(FILE* handle); -void std_cwd(char* dir); -void std_fflush(FILE* handle); +int std_fflush(FILE* handle); +int std_ferror(FILE* handle); } //namespace DS |