#include <zstream.h>
Inheritance diagram for regina::ZBuffer:
Public Member Functions | |
virtual | ~ZBuffer () |
Destroys this stream buffer. | |
virtual int | overflow (int c) |
Writes the given character to the underlying file, compressing en route. | |
virtual int | underflow () |
Reads the next character from the underlying file, decompressing en route. | |
virtual int | uflow () |
Reads the next character from the underlying file, decompressing en route. | |
virtual std::streamsize | xsputn (const char *s, std::streamsize n) |
Writes the given set of characters to the underlying file, compressing en route. | |
virtual std::streamsize | xsgetn (char *s, std::streamsize n) |
Reads a set of characters from the underlying file, decompressing en route. | |
virtual int | pbackfail (int c) |
Pushes the given character back into the underlying input stream. | |
virtual int | sync () |
Flushes all input/output buffers. | |
int | close () |
Closes the underlying file. | |
void | showError (std::ostream &out) |
Writes a description of the last (de)compression error that occurred. | |
Static Public Attributes | |
static const int | zEOF |
The end-of-file marker used with this stream buffer. | |
Protected Member Functions | |
ZBuffer () | |
Creates a new stream buffer. | |
int | open (const char *path, const char *mode) |
Opens the given file for (de)compressed reading or writing. |
This class should not be instantiated directly; see classes CompressionBuffer and DecompressionBuffer instead.
The standard zlib compression library is used for compression and decompression.
|
Creates a new stream buffer.
|
|
Destroys this stream buffer. Any underlying file that is open will be closed. |
|
Closes the underlying file. If no file is open, this routine does nothing.
|
|
Opens the given file for (de)compressed reading or writing. If a file is already open, it will be closed before the new file is opened.
|
|
Writes the given character to the underlying file, compressing en route.
|
|
Pushes the given character back into the underlying input stream.
|
|
Writes a description of the last (de)compression error that occurred. For the message to be meaningful, the underlying file must still be open.
|
|
Flushes all input/output buffers.
|
|
Reads the next character from the underlying file, decompressing en route. The character is consumed.
|
|
Reads the next character from the underlying file, decompressing en route. The character is not consumed.
|
|
Reads a set of characters from the underlying file, decompressing en route. The characters are all consumed. Reading will stop if end-of-file is reached or an error occurs.
|
|
Writes the given set of characters to the underlying file, compressing en route.
|
|
The end-of-file marker used with this stream buffer.
|