ScummVM API documentation
Common::OutSaveFile Class Reference

#include <savefile.h>

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

Public Member Functions

 OutSaveFile (WriteStream *w)
 
virtual bool err () const
 
virtual void clearErr ()
 
virtual void finalize ()
 
virtual bool flush ()
 
virtual uint32 write (const void *dataPtr, uint32 dataSize)
 
virtual int32 pos () const
 
- Public Member Functions inherited from Common::WriteStream
void writeByte (uint8 value)
 
void writeSByte (sint8 value)
 
void writeUint16LE (uint16 value)
 
void writeUint32LE (uint32 value)
 
void writeUint16BE (uint16 value)
 
void writeUint32BE (uint32 value)
 
FORCEINLINE void writeSint16LE (sint16 value)
 
FORCEINLINE void writeSint32LE (sint32 value)
 
FORCEINLINE void writeSint16BE (sint16 value)
 
FORCEINLINE void writeSint32BE (sint32 value)
 
void writeString (const Std::string &str)
 
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)
 
uint32 writeStream (ReadStream *stream, uint32 dataSize)
 
uint32 writeStream (SeekableReadStream *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()

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

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()

virtual void Common::OutSaveFile::clearErr ( )
virtual

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

Reimplemented from Common::Stream.

◆ finalize()

virtual void Common::OutSaveFile::finalize ( )
virtual

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()

virtual bool Common::OutSaveFile::flush ( )
virtual

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

Reimplemented from Common::WriteStream.

◆ write()

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

Write data into the stream.

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

Implements Common::WriteStream.

◆ pos()

virtual int32 Common::OutSaveFile::pos ( ) const
virtual

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.

Member Data Documentation

◆ _wrapped

WriteStream* Common::OutSaveFile::_wrapped
protected

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