Regina Calculation Engine
Public Member Functions | List of all members
regina::CompressionBuffer Class Reference

An output stream buffer that compresses data as it is written. More...

#include <utilities/zstream.h>

Inheritance diagram for regina::CompressionBuffer:
regina::ZBuffer

Public Member Functions

 CompressionBuffer ()
 Creates a new compression stream buffer. More...
 
 CompressionBuffer (const char *path)
 Creates a new compression stream buffer that writes to the given file. More...
 
int open (const char *path)
 Opens the given file for compressed writing. More...
 
- Public Member Functions inherited from regina::ZBuffer
virtual ~ZBuffer ()
 Destroys this stream buffer. More...
 
virtual int overflow (int c)
 Writes the given character to the underlying file, compressing en route. More...
 
virtual int underflow ()
 Reads the next character from the underlying file, decompressing en route. More...
 
virtual int uflow ()
 Reads the next character from the underlying file, decompressing en route. More...
 
virtual std::streamsize xsputn (const char *s, std::streamsize n)
 Writes the given set of characters to the underlying file, compressing en route. More...
 
virtual std::streamsize xsgetn (char *s, std::streamsize n)
 Reads a set of characters from the underlying file, decompressing en route. More...
 
virtual int pbackfail (int c)
 Pushes the given character back into the underlying input stream. More...
 
virtual int sync ()
 Flushes all input/output buffers. More...
 
int close ()
 Closes the underlying file. More...
 
void showError (std::ostream &out)
 Writes a description of the last (de)compression error that occurred. More...
 

Additional Inherited Members

- Static Public Attributes inherited from regina::ZBuffer
static const int zEOF
 The end-of-file marker used with this stream buffer. More...
 
- Protected Member Functions inherited from regina::ZBuffer
 ZBuffer ()
 Creates a new stream buffer. More...
 
int open (const char *path, const char *mode)
 Opens the given file for (de)compressed reading or writing. More...
 

Detailed Description

An output stream buffer that compresses data as it is written.

The standard zlib compression library is used.

This buffer is designed for use with standard C++ I/O streams.

This stream buffer should not be used for input.

Python:
Not present.

Constructor & Destructor Documentation

regina::CompressionBuffer::CompressionBuffer ( )
inline

Creates a new compression stream buffer.

regina::CompressionBuffer::CompressionBuffer ( const char *  path)
inline

Creates a new compression stream buffer that writes to the given file.

The underlying file will be opened automatically.

Internationalisation:
This routine makes no assumptions about the character encoding used in the given file name, and simply passes it through unchanged to low-level C/C++ file I/O routines.
Parameters
paththe pathname of the new file to open.

Member Function Documentation

int regina::CompressionBuffer::open ( const char *  path)
inline

Opens the given file for compressed writing.

If a file is already open, it will be closed before the new file is opened.

Internationalisation:
This routine makes no assumptions about the character encoding used in the given file name, and simply passes it through unchanged to low-level C/C++ file I/O routines.
Parameters
paththe pathname of the new file to open.
Returns
0 on success, or zEOF on error.

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

Copyright © 1999-2013, The Regina development team
This software is released under the GNU General Public License, with some additional permissions; see the source code for details.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@debian.org).