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

A simple wrapper class which can be used to wrap around an arbitrary other WriteStream and will then provide on-the-fly compression support. More...

Inheritance diagram for Common::GZipWriteStream:
Collaboration diagram for Common::GZipWriteStream:

List of all members.

Public Member Functions

 GZipWriteStream (WriteStream *w)
 ~GZipWriteStream ()
bool err () const
 Returns true if an I/O failure occurred.
void clearErr ()
 Reset the I/O error status as returned by err().
void finalize ()
 Finalize and close this stream.
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 Types

enum  { BUFSIZE = 16384 }

Protected Member Functions

void processData (int flushType)

Protected Attributes

byte _buf [BUFSIZE]
ScopedPtr< WriteStream_wrapped
z_stream _stream
int _zlibErr
uint32 _pos

Detailed Description

A simple wrapper class which can be used to wrap around an arbitrary other WriteStream and will then provide on-the-fly compression support.

The compressed data is written in the gzip format.

Definition at line 309 of file zlib.cpp.


Member Enumeration Documentation

anonymous enum [protected]
Enumerator:
BUFSIZE 

Definition at line 311 of file zlib.cpp.


Constructor & Destructor Documentation

Common::GZipWriteStream::GZipWriteStream ( WriteStream w  )  [inline]

Definition at line 337 of file zlib.cpp.

Common::GZipWriteStream::~GZipWriteStream (  )  [inline]

Definition at line 358 of file zlib.cpp.


Member Function Documentation

void Common::GZipWriteStream::clearErr (  )  [inline, 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 368 of file zlib.cpp.

bool Common::GZipWriteStream::err (  )  const [inline, 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 363 of file zlib.cpp.

void Common::GZipWriteStream::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 from Common::WriteStream.

Definition at line 374 of file zlib.cpp.

virtual int32 Common::GZipWriteStream::pos (  )  const [inline, 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 411 of file zlib.cpp.

void Common::GZipWriteStream::processData ( int  flushType  )  [inline, protected]

Definition at line 321 of file zlib.cpp.

uint32 Common::GZipWriteStream::write ( const void *  dataPtr,
uint32  dataSize 
) [inline, 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 394 of file zlib.cpp.


Member Data Documentation

byte Common::GZipWriteStream::_buf[BUFSIZE] [protected]

Definition at line 315 of file zlib.cpp.

Definition at line 319 of file zlib.cpp.

z_stream Common::GZipWriteStream::_stream [protected]

Definition at line 317 of file zlib.cpp.

Definition at line 316 of file zlib.cpp.

Definition at line 318 of file zlib.cpp.


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


Generated on Sat May 18 2019 05:06:10 for ResidualVM by doxygen 1.7.1
curved edge   curved edge