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

Common::WriteStream Class Reference

Generic interface for a writable data stream. More...

#include <stream.h>

Inheritance diagram for Common::WriteStream:
Collaboration diagram for Common::WriteStream:

List of all members.

Public Member Functions

virtual uint32 write (const void *dataPtr, uint32 dataSize)=0
 Write data into the stream.
virtual bool flush ()
 Commit any buffered data to the underlying channel or storage medium; unbuffered streams can use the default implementation.
virtual void finalize ()
 Finalize and close this stream.
virtual int32 pos () const =0
 Obtains the current value of the stream position indicator of the stream.
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)
 Write the given 32-bit floating point value stored in little endian(LSB first) order into the stream.
FORCEINLINE void writeFloatBE (float value)
 Write the given 32-bit floating point value stored in big endian order into the stream.
FORCEINLINE void writeDoubleLE (double value)
 Write the given 64-bit floating point value stored in little endian(LSB first) order into the stream.
FORCEINLINE void writeDoubleBE (double value)
 Write the given 64-bit floating point value stored in big endian order into the stream.
void writeString (const String &str)
 Write the given string to the stream.

Detailed Description

Generic interface for a writable data stream.

Definition at line 64 of file stream.h.


Member Function Documentation

virtual void Common::WriteStream::finalize (  )  [inline, 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 in Common::OutSaveFile, and Common::GZipWriteStream.

Definition at line 102 of file stream.h.

virtual bool Common::WriteStream::flush (  )  [inline, 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 in Common::OutSaveFile.

Definition at line 89 of file stream.h.

virtual int32 Common::WriteStream::pos (  )  const [pure virtual]

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

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

Implemented in Common::MemoryWriteStream, Common::MemoryWriteStreamDynamic, Common::MemoryReadWriteStream, Common::OutSaveFile, and Common::GZipWriteStream.

virtual uint32 Common::WriteStream::write ( const void *  dataPtr,
uint32  dataSize 
) [pure 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.

Implemented in Common::MemoryWriteStream, Common::MemoryWriteStreamDynamic, Common::MemoryReadWriteStream, Common::OutSaveFile, and Common::GZipWriteStream.

void Common::WriteStream::writeByte ( byte  value  )  [inline]

Definition at line 118 of file stream.h.

FORCEINLINE void Common::WriteStream::writeDoubleBE ( double  value  )  [inline]

Write the given 64-bit floating point value stored in big endian order into the stream.

Definition at line 223 of file stream.h.

FORCEINLINE void Common::WriteStream::writeDoubleLE ( double  value  )  [inline]

Write the given 64-bit floating point value stored in little endian(LSB first) order into the stream.

Definition at line 210 of file stream.h.

FORCEINLINE void Common::WriteStream::writeFloatBE ( float  value  )  [inline]

Write the given 32-bit floating point value stored in big endian order into the stream.

Definition at line 198 of file stream.h.

FORCEINLINE void Common::WriteStream::writeFloatLE ( float  value  )  [inline]

Write the given 32-bit floating point value stored in little endian(LSB first) order into the stream.

Definition at line 185 of file stream.h.

void Common::WriteStream::writeSByte ( int8  value  )  [inline]

Definition at line 122 of file stream.h.

FORCEINLINE void Common::WriteStream::writeSint16BE ( int16  value  )  [inline]

Definition at line 168 of file stream.h.

FORCEINLINE void Common::WriteStream::writeSint16LE ( int16  value  )  [inline]

Definition at line 156 of file stream.h.

FORCEINLINE void Common::WriteStream::writeSint32BE ( int32  value  )  [inline]

Definition at line 172 of file stream.h.

FORCEINLINE void Common::WriteStream::writeSint32LE ( int32  value  )  [inline]

Definition at line 160 of file stream.h.

FORCEINLINE void Common::WriteStream::writeSint64BE ( int64  value  )  [inline]

Definition at line 176 of file stream.h.

FORCEINLINE void Common::WriteStream::writeSint64LE ( int64  value  )  [inline]

Definition at line 164 of file stream.h.

void Common::WriteStream::writeString ( const String str  ) 

Write the given string to the stream.

This writes str.size() characters, but no terminating zero byte.

Definition at line 31 of file stream.cpp.

void Common::WriteStream::writeUint16BE ( uint16  value  )  [inline]

Definition at line 141 of file stream.h.

void Common::WriteStream::writeUint16LE ( uint16  value  )  [inline]

Definition at line 126 of file stream.h.

void Common::WriteStream::writeUint32BE ( uint32  value  )  [inline]

Definition at line 146 of file stream.h.

void Common::WriteStream::writeUint32LE ( uint32  value  )  [inline]

Definition at line 131 of file stream.h.

void Common::WriteStream::writeUint64BE ( uint64  value  )  [inline]

Definition at line 151 of file stream.h.

void Common::WriteStream::writeUint64LE ( uint64  value  )  [inline]

Definition at line 136 of file stream.h.


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


Generated on Sat Jul 13 2019 05:03:52 for ResidualVM by doxygen 1.7.1
curved edge   curved edge