diff options
author | Paul Gilbert | 2016-06-25 23:07:44 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-15 19:25:03 -0400 |
commit | 04afc633794035cfcc0cb7030113d7750a7dbae3 (patch) | |
tree | 13eb89371f23cd0f28a7745a08c64b84b842dbb9 /engines/titanic/support/simple_file.h | |
parent | 507924b39d0beb50bacb05f3ad15f66fc113f3a9 (diff) | |
download | scummvm-rg350-04afc633794035cfcc0cb7030113d7750a7dbae3.tar.gz scummvm-rg350-04afc633794035cfcc0cb7030113d7750a7dbae3.tar.bz2 scummvm-rg350-04afc633794035cfcc0cb7030113d7750a7dbae3.zip |
TITANIC: Adding savegame header load/save methods
Diffstat (limited to 'engines/titanic/support/simple_file.h')
-rw-r--r-- | engines/titanic/support/simple_file.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/engines/titanic/support/simple_file.h b/engines/titanic/support/simple_file.h index bca96a631a..a83e5922e2 100644 --- a/engines/titanic/support/simple_file.h +++ b/engines/titanic/support/simple_file.h @@ -61,6 +61,9 @@ public: SimpleFile(); virtual ~SimpleFile(); + operator Common::SeekableReadStream &() { return *_inStream; } + operator Common::WriteStream &() { return *_outStream; } + /** * Set up a stream for read access */ @@ -92,11 +95,26 @@ public: virtual size_t write(const void *src, size_t count) const; /** + * Seek + */ + virtual void seek(int offset, int origin); + + /** * Read a byte */ byte readByte(); /** + * Read a 16-bit LE number + */ + uint readUint16LE(); + + /** + * Read a 32-bit LE number + */ + uint readUint32LE(); + + /** * Read a string from the file */ CString readString(); @@ -137,6 +155,21 @@ public: bool scanf(const char *format, ...); /** + * Write out a byte + */ + void writeByte(byte b) { write(&b, 1); } + + /** + * Write out a raw 16-bit LE number + */ + void writeUint16LE(uint val); + + /** + * Write out a raw 32-bit LE number + */ + void writeUint32LE(uint val); + + /** * Write a string line */ void writeLine(const CString &str) const; |