diff options
author | Max Horn | 2004-06-25 22:11:48 +0000 |
---|---|---|
committer | Max Horn | 2004-06-25 22:11:48 +0000 |
commit | e5f90509a606819dec58b7642c9845373ae364d5 (patch) | |
tree | b892289fd90878d306be42c236c18f6ea6bbf269 /common/savefile.h | |
parent | de7c36f063eb4ee33b01bfb7be4186c7cb9fd704 (diff) | |
download | scummvm-rg350-e5f90509a606819dec58b7642c9845373ae364d5.tar.gz scummvm-rg350-e5f90509a606819dec58b7642c9845373ae364d5.tar.bz2 scummvm-rg350-e5f90509a606819dec58b7642c9845373ae364d5.zip |
Cleaned up SaveFileManager stuff a little bit
svn-id: r14056
Diffstat (limited to 'common/savefile.h')
-rw-r--r-- | common/savefile.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/common/savefile.h b/common/savefile.h index 83e09ad9c1..4e2c21eaa5 100644 --- a/common/savefile.h +++ b/common/savefile.h @@ -32,30 +32,30 @@ class SaveFile : public Common::ReadStream, public Common::WriteStream { public: virtual ~SaveFile() {} - /* Compatible with File API */ - uint32 read(void *ptr, uint32 size); - uint32 write(const void *ptr, uint32 size); - virtual bool isOpen() const = 0; - -protected: - /* Only for internal use, use File compatible API above instead */ - virtual int fread(void *buf, int size, int cnt) = 0; - virtual int fwrite(const void *buf, int size, int cnt) = 0; }; class SaveFileManager { - public: virtual ~SaveFileManager() {} + /** + * Open the file with name filename in the given directory for saving or loading. + * @param filename the filename + * @param directory the directory + * @param saveOrLoad true for saving, false for loading + * @return pointer to a SaveFile object + */ + virtual SaveFile *open_savefile(const char *filename, const char *directory, bool saveOrLoad) = 0; + virtual void list_savefiles(const char * /* prefix */, const char *directory, bool *marks, int num) = 0; +}; + +class DefaultSaveFileManager : public SaveFileManager { +public: virtual SaveFile *open_savefile(const char *filename, const char *directory, bool saveOrLoad); - virtual void list_savefiles(const char * /* prefix */, const char *directory, bool *marks, int num) { - memset(marks, true, num * sizeof(bool)); - } + virtual void list_savefiles(const char * /* prefix */, const char *directory, bool *marks, int num); protected: - void join_paths(const char *filename, const char *directory, char *buf, int bufsize); virtual SaveFile *makeSaveFile(const char *filename, bool saveOrLoad); }; |