22 #ifndef TITANIC_SIMPLE_FILE_H 23 #define TITANIC_SIMPLE_FILE_H 25 #include "common/file.h" 26 #include "titanic/support/rect.h" 27 #include "common/savefile.h" 28 #include "common/stream.h" 29 #include "common/compression/deflate.h" 30 #include "titanic/support/string.h" 35 class DecompressorData;
84 virtual void safeRead(
void *dst,
size_t count);
89 virtual size_t unsafeRead(
void *dst,
size_t count);
94 virtual size_t write(
const void *src,
size_t count)
const;
99 virtual void seek(
int offset,
int origin);
148 void readBuffer(
char *buffer =
nullptr,
size_t count = 0);
153 bool scanf(
const char *format, ...);
163 void writeUint16LE(uint val);
168 void writeUint32LE(uint val);
173 void writeLine(
const CString &str)
const;
178 void writeString(
const CString &str)
const;
183 void writeQuotedString(
const CString &str)
const;
188 void writeQuotedLine(
const CString &str,
int indent)
const;
193 void writeNumber(
int val)
const;
198 void writeNumberLine(
int val,
int indent)
const;
203 void writeFloat(
double val)
const;
208 void writeFloatLine(
double val,
int indent)
const;
213 void writePoint(
const Point &pt,
int indent)
const;
218 void writeRect(
const Rect &r,
int indent)
const;
223 void writeBounds(
const Rect &r,
int indent)
const;
228 void writeFormat(
const char *format, ...)
const;
233 void writeIndent(uint indent)
const;
245 void writeClassStart(
const CString &classStr,
int indent);
250 void writeClassEnd(
int indent);
257 return _inStream->
pos() >= _inStream->
size();
virtual int64 size() const =0
SeekableReadStream * wrapCompressedReadStream(SeekableReadStream *toBeWrapped, DisposeAfterUse::Flag disposeParent=DisposeAfterUse::YES, uint64 knownSize=0)
virtual int64 pos() const =0
uint16 readUint16LE()
Definition: stream.h:459
void open(Common::SeekableReadStream *stream) override
Definition: simple_file.h:272
Definition: savefile.h:54
String readString(char terminator=0, size_t len=String::npos)
WriteStream * wrapCompressedWriteStream(WriteStream *toBeWrapped)
uint32 readUint32LE()
Definition: stream.h:473
Definition: simple_file.h:49
void open(Common::OutSaveFile *stream) override
Definition: simple_file.h:305
byte readByte()
Definition: stream.h:434
void writeByte(byte b)
Definition: simple_file.h:158
Common::SeekableReadStream * readStream() const
Definition: simple_file.h:310
void open(Common::SeekableReadStream *stream) override
Definition: simple_file.h:300
Definition: simple_file.h:41
void open(Common::OutSaveFile *stream) override
Definition: simple_file.h:279
Definition: simple_file.h:287
virtual void open(Common::SeekableReadStream *stream)
bool open(const Common::Path &filename) override
bool seek(int64 offs, int whence=SEEK_SET) override
Definition: simple_file.h:264
bool eos() const
Definition: simple_file.h:255