fgzstreambuf Class Reference

Streambuffer reading or writing gzip files. More...

#include <gzstream.h>

List of all members.

Public Member Functions

 fgzstreambuf (unsigned bufferSize_r=512)
virtual ~fgzstreambuf ()
bool isOpen () const
bool inReadMode () const
bool inWriteMode () const
fgzstreambufopen (const char *name_r, std::ios_base::openmode mode_r)
fgzstreambufclose ()
ZlibError zError () const

Protected Member Functions

virtual int sync ()
virtual int_type overflow (int_type c=traits_type::eof())
virtual int_type underflow ()
virtual pos_type seekoff (off_type off_r, std::ios_base::seekdir way_r, std::ios_base::openmode)
virtual pos_type seekpos (pos_type pos_r, std::ios_base::openmode)

Private Types

typedef std::vector
< char > 
buffer_type

Private Member Functions

void setZError ()
std::streamsize zReadTo (char *buffer_r, std::streamsize maxcount_r)
bool zWriteFrom (const char *buffer_r, std::streamsize count_r)
pos_type zSeekTo (off_type off_r, std::ios_base::seekdir way_r)
pos_type zTell ()
pos_type seekTo (off_type off_r, std::ios_base::seekdir way_r)

Private Attributes

gzFile _file
std::ios_base::openmode _mode
buffer_type _buffer
ZlibError _error


Detailed Description

Streambuffer reading or writing gzip files.

Read and write mode are mutual exclusive. Seek is supported, but zlib restrictions appy (only forward seek in write mode; backward seek in read mode might be expensive).Putback is not supported.

Reading plain (no gziped) files is possible as well.

This streambuf is used in ifgzstream and ofgzstream.


Member Typedef Documentation

typedef std::vector<char> fgzstreambuf::buffer_type [private]


Constructor & Destructor Documentation

fgzstreambuf::fgzstreambuf ( unsigned  bufferSize_r = 512  )  [inline]

virtual fgzstreambuf::~fgzstreambuf (  )  [inline, virtual]


Member Function Documentation

bool fgzstreambuf::isOpen (  )  const [inline]

bool fgzstreambuf::inReadMode (  )  const [inline]

bool fgzstreambuf::inWriteMode (  )  const [inline]

fgzstreambuf* fgzstreambuf::open ( const char *  name_r,
std::ios_base::openmode  mode_r 
)

fgzstreambuf* fgzstreambuf::close (  ) 

ZlibError fgzstreambuf::zError (  )  const [inline]

The last error returned retuned fron zlib.

virtual int fgzstreambuf::sync (  )  [protected, virtual]

virtual int_type fgzstreambuf::overflow ( int_type  c = traits_type::eof()  )  [protected, virtual]

virtual int_type fgzstreambuf::underflow (  )  [protected, virtual]

virtual pos_type fgzstreambuf::seekoff ( off_type  off_r,
std::ios_base::seekdir  way_r,
std::ios_base::openmode   
) [inline, protected, virtual]

virtual pos_type fgzstreambuf::seekpos ( pos_type  pos_r,
std::ios_base::openmode   
) [inline, protected, virtual]

void fgzstreambuf::setZError (  )  [inline, private]

std::streamsize fgzstreambuf::zReadTo ( char *  buffer_r,
std::streamsize  maxcount_r 
) [private]

bool fgzstreambuf::zWriteFrom ( const char *  buffer_r,
std::streamsize  count_r 
) [private]

pos_type fgzstreambuf::zSeekTo ( off_type  off_r,
std::ios_base::seekdir  way_r 
) [private]

pos_type fgzstreambuf::zTell (  )  [private]

pos_type fgzstreambuf::seekTo ( off_type  off_r,
std::ios_base::seekdir  way_r 
) [private]


Member Data Documentation

gzFile fgzstreambuf::_file [private]

std::ios_base::openmode fgzstreambuf::_mode [private]

buffer_type fgzstreambuf::_buffer [private]

ZlibError fgzstreambuf::_error [private]


The documentation for this class was generated from the following file:
Generated on Fri Sep 21 22:35:03 2007 for liby2util by  doxygen 1.5.3