xoreos  0.0.5
Public Member Functions | List of all members
Common::WriteStream Class Referenceabstract

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

#include <writestream.h>

Inheritance diagram for Common::WriteStream:
Inheritance graph
[legend]

Public Member Functions

 WriteStream ()
 
virtual ~WriteStream ()
 
virtual size_t write (const void *dataPtr, size_t dataSize)=0
 Write data into the stream. More...
 
virtual void flush ()
 Commit any buffered data to the underlying channel or storage medium; unbuffered streams can use the default implementation. More...
 
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)
 
void writeBytes (byte value, size_t n)
 Write n bytes of value to the stream. More...
 
FORCEINLINE void writeZeros (size_t n)
 Write n zeros to the stream. More...
 
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 writeIEEEFloatLE (float value)
 
FORCEINLINE void writeIEEEFloatBE (float value)
 
FORCEINLINE void writeIEEEDoubleLE (double value)
 
FORCEINLINE void writeIEEEDoubleBE (double value)
 
size_t writeStream (ReadStream &stream, size_t n)
 Copy n bytes of the given stream into the stream. More...
 
size_t writeStream (ReadStream &stream)
 Copy the complete contents of the given stream. More...
 
void writeString (const UString &str)
 Write the given string to the stream, encoded as UTF-8. More...
 

Detailed Description

Generic interface for a writable data stream.

Definition at line 64 of file writestream.h.

Constructor & Destructor Documentation

◆ WriteStream()

Common::WriteStream::WriteStream ( )

Definition at line 59 of file writestream.cpp.

◆ ~WriteStream()

Common::WriteStream::~WriteStream ( )
virtual

Definition at line 62 of file writestream.cpp.

References flush().

Here is the call graph for this function:

Member Function Documentation

◆ flush()

void Common::WriteStream::flush ( )
virtual

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

When flushing fails, a kWriteError exception is thrown.

Reimplemented in Common::WriteFile.

Definition at line 69 of file writestream.cpp.

Referenced by Graphics::dumpTGA(), Common::FoxPro::save(), Common::ConfigFile::save(), Aurora::TwoDAFile::writeASCII(), Aurora::TwoDAFile::writeCSV(), and ~WriteStream().

Here is the caller graph for this function:

◆ write()

virtual size_t Common::WriteStream::write ( const void *  dataPtr,
size_t  dataSize 
)
pure virtual

Write data into the stream.

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

Parameters
dataPtrpointer to the data to be written.
dataSizenumber of bytes to be written.
Returns
the number of bytes which were actually written.

Implemented in Common::MemoryWriteStreamDynamic, Common::MemoryWriteStream, and Common::WriteFile.

Referenced by Aurora::ERFWriter::add(), Aurora::compress10(), Common::FoxPro::saveFields(), Common::FoxPro::saveMemos(), Common::FoxPro::saveRecords(), Aurora::GFF3Writer::write(), writeByte(), writeBytes(), Aurora::LocString::writeLocString(), writeSByte(), writeStream(), writeString(), writeUint16BE(), writeUint16LE(), writeUint32BE(), writeUint32LE(), writeUint64BE(), and writeUint64LE().

Here is the caller graph for this function:

◆ writeByte()

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

◆ writeBytes()

void Common::WriteStream::writeBytes ( byte  value,
size_t  n 
)
inline

Write n bytes of value to the stream.

Definition at line 135 of file writestream.h.

References Common::kWriteError, and write().

Referenced by writeZeros().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeIEEEDoubleBE()

FORCEINLINE void Common::WriteStream::writeIEEEDoubleBE ( double  value)
inline

Definition at line 183 of file writestream.h.

References convertIEEEDouble(), and writeUint64BE().

Here is the call graph for this function:

◆ writeIEEEDoubleLE()

FORCEINLINE void Common::WriteStream::writeIEEEDoubleLE ( double  value)
inline

Definition at line 179 of file writestream.h.

References convertIEEEDouble(), and writeUint64LE().

Referenced by Aurora::GFF3Writer::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeIEEEFloatBE()

FORCEINLINE void Common::WriteStream::writeIEEEFloatBE ( float  value)
inline

Definition at line 175 of file writestream.h.

References convertIEEEFloat(), and writeUint32BE().

Here is the call graph for this function:

◆ writeIEEEFloatLE()

FORCEINLINE void Common::WriteStream::writeIEEEFloatLE ( float  value)
inline

Definition at line 171 of file writestream.h.

References convertIEEEFloat(), and writeUint32LE().

Referenced by Aurora::GFF3Writer::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeSByte()

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

Definition at line 93 of file writestream.h.

References Common::kWriteError, and write().

Here is the call graph for this function:

◆ writeSint16BE()

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

Definition at line 159 of file writestream.h.

References writeUint16BE().

Here is the call graph for this function:

◆ writeSint16LE()

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

Definition at line 147 of file writestream.h.

References writeUint16LE().

Here is the call graph for this function:

◆ writeSint32BE()

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

Definition at line 163 of file writestream.h.

References writeUint32BE().

Here is the call graph for this function:

◆ writeSint32LE()

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

Definition at line 151 of file writestream.h.

References writeUint32LE().

Referenced by Aurora::GFF3Writer::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeSint64BE()

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

Definition at line 167 of file writestream.h.

References writeUint64BE().

Here is the call graph for this function:

◆ writeSint64LE()

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

Definition at line 155 of file writestream.h.

References writeUint64LE().

Referenced by Aurora::GFF3Writer::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeStream() [1/2]

size_t Common::WriteStream::writeStream ( ReadStream stream,
size_t  n 
)

Copy n bytes of the given stream into the stream.

Even if less bytes than requested could be written to the stream, all requested bytes will always be read from the input stream.

Parameters
streamThe stream to read from.
nThe number of bytes to read from the stream.
Returns
the number of bytes which were actually written.

Definition at line 72 of file writestream.cpp.

References Common::ReadStream::eos(), Common::ReadStream::read(), and write().

Referenced by Aurora::TheWitcherSaveWriter::add(), Aurora::ERFWriter::add(), Aurora::compress00(), Aurora::decompress00(), Engines::dumpStream(), Aurora::PEFile::getResource(), writeStream(), Common::writeString(), and Common::writeStringFixed().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeStream() [2/2]

size_t Common::WriteStream::writeStream ( ReadStream stream)

Copy the complete contents of the given stream.

Even if less bytes than are available in the input stream can be written to this stream, the input stream will always be exhausted to completion.

Parameters
streamThe stream to read from.
Returns
the number of bytes which were actually written.

Definition at line 90 of file writestream.cpp.

References writeStream().

Here is the call graph for this function:

◆ writeString()

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

◆ writeUint16BE()

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

Definition at line 116 of file writestream.h.

References Common::kWriteError, and write().

Referenced by Common::FoxPro::saveMemos(), and writeSint16BE().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeUint16LE()

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

Definition at line 98 of file writestream.h.

References Common::kWriteError, and write().

Referenced by Aurora::ERFWriter::add(), Aurora::PEFile::getResource(), Graphics::openTGA(), Common::FoxPro::saveHeader(), Aurora::TwoDAFile::writeBinary(), Graphics::writeBMP(), and writeSint16LE().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeUint32BE()

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

Definition at line 122 of file writestream.h.

References Common::kWriteError, and write().

Referenced by Aurora::ERFWriter::ERFWriter(), Common::FoxPro::saveMemos(), Aurora::TheWitcherSaveWriter::TheWitcherSaveWriter(), Aurora::GFF3Writer::write(), writeIEEEFloatBE(), Aurora::NSBTXFile::writeITEXHeader(), and writeSint32BE().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeUint32LE()

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

◆ writeUint64BE()

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

Definition at line 128 of file writestream.h.

References Common::kWriteError, and write().

Referenced by writeIEEEDoubleBE(), and writeSint64BE().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeUint64LE()

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

Definition at line 110 of file writestream.h.

References Common::kWriteError, and write().

Referenced by Aurora::TheWitcherSaveWriter::TheWitcherSaveWriter(), Aurora::GFF3Writer::write(), writeIEEEDoubleLE(), and writeSint64LE().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeZeros()

FORCEINLINE void Common::WriteStream::writeZeros ( size_t  n)
inline

Write n zeros to the stream.

Definition at line 143 of file writestream.h.

References writeBytes().

Referenced by Aurora::ERFWriter::add(), Aurora::ERFWriter::ERFWriter(), Aurora::TheWitcherSaveWriter::TheWitcherSaveWriter(), and Aurora::GFF3Writer::write().

Here is the call graph for this function:
Here is the caller graph for this function:

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