ScummVM API documentation
Common::OutSaveFile Class Reference

#include <savefile.h>

Inheritance diagram for Common::OutSaveFile:
Common::SeekableWriteStream Common::WriteStream Common::Stream

Public Member Functions

 OutSaveFile (WriteStream *w)
 
bool err () const override
 
void clearErr () override
 
void finalize () override
 
bool flush () override
 
uint32 write (const void *dataPtr, uint32 dataSize) override
 
int64 pos () const override
 
bool seek (int64 offset, int whence) override
 
int64 size () const override
 
- Public Member Functions inherited from Common::WriteStream
void writeByte (byte value)
 
void writeSByte (int8 value)
 
void writeUint16LE (uint16 value)
 
void writeUint32LE (uint32 value)
 
void writeUint64LE (uint64 value)
 
void writeUint16BE (uint16 value)
 
void writeUint32BE (uint32 value)
 
void writeUint64BE (uint64 value)
 
FORCEINLINE void writeSint16LE (int16 value)
 
FORCEINLINE void writeSint32LE (int32 value)
 
FORCEINLINE void writeSint64LE (int64 value)
 
FORCEINLINE void writeSint16BE (int16 value)
 
FORCEINLINE void writeSint32BE (int32 value)
 
FORCEINLINE void writeSint64BE (int64 value)
 
FORCEINLINE void writeFloatLE (float value)
 
FORCEINLINE void writeFloatBE (float value)
 
FORCEINLINE void writeDoubleLE (double value)
 
FORCEINLINE void writeDoubleBE (double value)
 
template<class TDataFormat , class... T>
bool writeMultiple (const TDataFormat &dataFormat, const T &...values)
 
template<class... T>
bool writeMultipleEndian (bool isLittle, const T &...values)
 
template<class... T>
bool writeMultipleLE (const T &...values)
 
template<class... T>
bool writeMultipleBE (const T &...values)
 
uint32 writeStream (ReadStream *stream, uint32 dataSize)
 
uint32 writeStream (ReadStream *stream)
 
void writeString (const String &str)
 

Protected Attributes

WriteStream_wrapped
 

Detailed Description

A class which allows game engines to save game state data. That typically means "save games", but also includes things like the IQ points in Indy3.

Constructor & Destructor Documentation

◆ OutSaveFile()

Common::OutSaveFile::OutSaveFile ( WriteStream w)

Create an OutSaveFile that uses the given WriteStream to write the data.

Member Function Documentation

◆ err()

bool Common::OutSaveFile::err ( ) const
overridevirtual

Return true if an I/O failure occurred. This flag is never cleared automatically. In order to clear it, you must call clearErr() explicitly.

Reimplemented from Common::Stream.

◆ clearErr()

void Common::OutSaveFile::clearErr ( )
overridevirtual

Reset the I/O error status as returned by err().

Reimplemented from Common::Stream.

◆ finalize()

void Common::OutSaveFile::finalize ( )
overridevirtual

Finalize and close this stream. To be called right before this stream instance is deleted. The goal here is to enable calling code to detect and handle I/O errors which might occur when closing (and flushing, if buffered) the stream.

After this method has been called, no further writes may be performed on the stream. Calling err() is allowed.

By default, this just flushes the stream.

Reimplemented from Common::WriteStream.

◆ flush()

bool Common::OutSaveFile::flush ( )
overridevirtual

Commit any buffered data to the underlying channel or storage medium. Unbuffered streams can use the default implementation

Reimplemented from Common::WriteStream.

◆ write()

uint32 Common::OutSaveFile::write ( const void *  dataPtr,
uint32  dataSize 
)
overridevirtual

Write data into the stream.

Parameters
dataPtrPointer to the data to be written.
dataSizeNumber of bytes to be written.

Implements Common::WriteStream.

◆ pos()

int64 Common::OutSaveFile::pos ( ) const
overridevirtual

Obtain the current value of the stream position indicator of the stream.

Returns
The current position indicator, or -1 if an error occurred.

Implements Common::WriteStream.

◆ seek()

bool Common::OutSaveFile::seek ( int64  offset,
int  whence 
)
overridevirtual

Seeks to a new position within the file. This is only supported when creating uncompressed save files.

Implements Common::SeekableWriteStream.

◆ size()

int64 Common::OutSaveFile::size ( ) const
overridevirtual

Returns the size of the save file This is only supported when creating uncompressed save files.

Implements Common::SeekableWriteStream.

Member Data Documentation

◆ _wrapped

WriteStream* Common::OutSaveFile::_wrapped
protected

The documentation for this class was generated from the following file: