ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

Common::OutSaveFile Class Reference

A class which allows game engines to save game state data. More...

#include <savefile.h>

Inheritance diagram for Common::OutSaveFile:
Collaboration diagram for Common::OutSaveFile:

List of all members.

Public Member Functions

 OutSaveFile (WriteStream *w)
virtual ~OutSaveFile ()
virtual bool err () const
 Returns true if an I/O failure occurred.
virtual void clearErr ()
 Reset the I/O error status as returned by err().
virtual void finalize ()
 Finalize and close this stream.
virtual bool flush ()
 Commit any buffered data to the underlying channel or storage medium; unbuffered streams can use the default implementation.
virtual uint32 write (const void *dataPtr, uint32 dataSize)
 Write data into the stream.
virtual int32 pos () const
 Obtains the current value of the stream position indicator of the stream.

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.

Definition at line 47 of file savefile.h.


Constructor & Destructor Documentation

Common::OutSaveFile::OutSaveFile ( WriteStream w  ) 

Definition at line 32 of file savefile.cpp.

Common::OutSaveFile::~OutSaveFile (  )  [virtual]

Definition at line 34 of file savefile.cpp.


Member Function Documentation

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

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

For a ReadStream, also reset the end-of-stream status returned by eos().

Note:
The semantics of any implementation of this method are supposed to match those of ISO C clearerr().

Reimplemented from Common::Stream.

Definition at line 40 of file savefile.cpp.

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

Returns true if an I/O failure occurred.

This flag is never cleared automatically. In order to clear it, client code has to call clearErr() explicitly.

Note:
The semantics of any implementation of this method are supposed to match those of ISO C ferror().

Reimplemented from Common::Stream.

Definition at line 38 of file savefile.cpp.

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 this 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.

Definition at line 42 of file savefile.cpp.

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

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

Note:
The semantics of any implementation of this method are supposed to match those of ISO C fflush().
Returns:
true on success, false in case of a failure

Reimplemented from Common::WriteStream.

Definition at line 49 of file savefile.cpp.

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

Obtains 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.

Definition at line 55 of file savefile.cpp.

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

Write data into the stream.

Subclasses must implement this method; all other write methods are implemented using it.

Note:
The semantics of any implementation of this method are supposed to match those of ISO C fwrite().
Parameters:
dataPtr pointer to the data to be written
dataSize number of bytes to be written
Returns:
the number of bytes which were actually written.

Implements Common::WriteStream.

Definition at line 51 of file savefile.cpp.


Member Data Documentation

Definition at line 49 of file savefile.h.


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


Generated on Sat Sep 14 2019 05:04:06 for ResidualVM by doxygen 1.7.1
curved edge   curved edge