aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMax Horn2003-11-30 00:41:19 +0000
committerMax Horn2003-11-30 00:41:19 +0000
commit93f58abde7e9fe9b28a336db609c884afd0fec6a (patch)
tree21d93213203d8c097df417f8e28199304315f9f4 /common
parent3612dc54dcc1fbf9f863127bd919c7921fe11988 (diff)
downloadscummvm-rg350-93f58abde7e9fe9b28a336db609c884afd0fec6a.tar.gz
scummvm-rg350-93f58abde7e9fe9b28a336db609c884afd0fec6a.tar.bz2
scummvm-rg350-93f58abde7e9fe9b28a336db609c884afd0fec6a.zip
oops forgot to commit this one, it seems
svn-id: r11434
Diffstat (limited to 'common')
-rw-r--r--common/savefile.h28
1 files changed, 5 insertions, 23 deletions
diff --git a/common/savefile.h b/common/savefile.h
index 31271c656d..1188b46c51 100644
--- a/common/savefile.h
+++ b/common/savefile.h
@@ -29,6 +29,7 @@
#include <stdio.h>
#include <string.h>
+
class SaveFile {
public:
virtual ~SaveFile() {}
@@ -47,46 +48,27 @@ public:
void writeUint16BE(uint16 value);
void writeUint32BE(uint32 value);
+ 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 StdioSaveFile : public SaveFile {
-private:
- FILE *fh;
-public:
- StdioSaveFile(const char *filename, const char *mode)
- { fh = ::fopen(filename, mode); }
- ~StdioSaveFile()
- { if(fh) ::fclose(fh); }
-
-
- bool is_open() { return fh != NULL; }
-
-protected:
- int fread(void *buf, int size, int cnt)
- { return ::fread(buf, size, cnt, fh); }
- int fwrite(const void *buf, int size, int cnt)
- { return ::fwrite(buf, size, cnt, fh); }
-};
-
class SaveFileManager {
public:
virtual ~SaveFileManager() {}
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));
}
protected:
- void join_paths(const char *filename, const char *directory,
- char *buf, int bufsize);
-
+ void join_paths(const char *filename, const char *directory, char *buf, int bufsize);
+ virtual SaveFile *makeSaveFile(const char *filename, bool saveOrLoad);
};
#endif