Logo Search packages:      
Sourcecode: zlib version File versions

gzfilebuf Class Reference

#include <zfstream.h>

List of all members.


Detailed Description

Gzipped file stream buffer class.

This class implements basic_filebuf for gzipped files. It doesn't yet support seeking (allowed by zlib but slow/limited), putback and read/write access (tricky). Otherwise, it attempts to be a drop-in replacement for the standard file streambuf.

Definition at line 8 of file zfstream.h.


Public Member Functions

gzfilebufattach (int fd, std::ios_base::openmode mode)
 Attach to already open gzipped file.
gzfilebufattach (int file_descriptor, int io_mode)
gzfilebufclose ()
 Close gzipped file.
gzfilebufclose ()
bool is_open () const
 Check if file is open.
int is_open () const
gzfilebufopen (const char *name, std::ios_base::openmode mode)
 Open gzipped file.
gzfilebufopen (const char *name, int io_mode)
virtual streampos seekoff (streamoff, ios::seek_dir, int)
int setcompression (int comp_level, int comp_strategy=Z_DEFAULT_STRATEGY)
 Set compression level and strategy on the fly.
int setcompressionlevel (int comp_level)
int setcompressionstrategy (int comp_strategy)
virtual int sync ()

Protected Member Functions

bool open_mode (std::ios_base::openmode mode, char *c_mode) const
 Convert ios open mode int to mode string used by zlib.
virtual int_type overflow (int_type c=traits_type::eof())
 Write put area to gzipped file.
virtual int overflow (int=EOF)
virtual std::streambuf * setbuf (char_type *p, std::streamsize n)
 Installs external stream buffer.
virtual std::streamsize showmanyc ()
 Number of characters available in stream buffer.
virtual int sync ()
 Flush stream buffer to file.
virtual int_type underflow ()
 Fill get area from gzipped file.
virtual int underflow ()

Private Member Functions

void disable_buffer ()
 Destroy internal buffer.
void enable_buffer ()
 Allocate internal buffer.
int fillbuf ()
int flushbuf ()

Private Attributes

char_type * buffer
 Stream buffer.
std::streamsize buffer_size
 Stream buffer size.
gzFile file
std::ios_base::openmode io_mode
short mode
bool own_buffer
 True if this object owns stream buffer.
bool own_fd
 True if this object owns file descriptor.
short own_file_descriptor

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

Generated by  Doxygen 1.6.0   Back to index