zypp::gzstream_detail::fgzstreambuf Class Reference

Streambuffer reading or writing gzip files. More...

#include <GzStream.h>

Inheritance diagram for zypp::gzstream_detail::fgzstreambuf:

streambuf 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=std::ios_base::in)
fgzstreambufclose ()
ZlibError zError () const
 The last error returned fron zlib.

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.

Definition at line 81 of file GzStream.h.


Member Typedef Documentation

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

Definition at line 141 of file GzStream.h.


Constructor & Destructor Documentation

zypp::gzstream_detail::fgzstreambuf::fgzstreambuf unsigned  bufferSize_r = 512  )  [inline]
 

Definition at line 85 of file GzStream.h.

virtual zypp::gzstream_detail::fgzstreambuf::~fgzstreambuf  )  [inline, virtual]
 

Definition at line 92 of file GzStream.h.

References close().


Member Function Documentation

bool zypp::gzstream_detail::fgzstreambuf::isOpen  )  const [inline]
 

Definition at line 96 of file GzStream.h.

References _file.

Referenced by close(), open(), and seekTo().

bool zypp::gzstream_detail::fgzstreambuf::inReadMode  )  const [inline]
 

Definition at line 100 of file GzStream.h.

References _mode.

Referenced by open(), and underflow().

bool zypp::gzstream_detail::fgzstreambuf::inWriteMode  )  const [inline]
 

Definition at line 104 of file GzStream.h.

References _mode.

Referenced by overflow(), and seekTo().

fgzstreambuf * zypp::gzstream_detail::fgzstreambuf::open const char *  name_r,
std::ios_base::openmode  mode_r = std::ios_base::in
 

Definition at line 64 of file GzStream.cc.

References _buffer, _file, _mode, inReadMode(), isOpen(), and setZError().

fgzstreambuf * zypp::gzstream_detail::fgzstreambuf::close  ) 
 

Definition at line 103 of file GzStream.cc.

References _file, _mode, isOpen(), setZError(), and sync().

Referenced by ~fgzstreambuf().

ZlibError zypp::gzstream_detail::fgzstreambuf::zError  )  const [inline]
 

The last error returned fron zlib.

Definition at line 117 of file GzStream.h.

References _error.

int zypp::gzstream_detail::fgzstreambuf::sync  )  [protected, virtual]
 

Definition at line 134 of file GzStream.cc.

References overflow().

Referenced by close(), and seekTo().

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

Definition at line 151 of file GzStream.cc.

References _buffer, inWriteMode(), and zWriteFrom().

Referenced by sync().

fgzstreambuf::int_type zypp::gzstream_detail::fgzstreambuf::underflow  )  [protected, virtual]
 

Definition at line 180 of file GzStream.cc.

References _buffer, inReadMode(), and zReadTo().

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

Definition at line 132 of file GzStream.h.

References seekTo().

virtual pos_type zypp::gzstream_detail::fgzstreambuf::seekpos pos_type  pos_r,
std::ios_base::openmode 
[inline, protected, virtual]
 

Definition at line 136 of file GzStream.h.

References seekTo().

void zypp::gzstream_detail::fgzstreambuf::setZError  )  [inline, private]
 

Definition at line 154 of file GzStream.h.

References _error, _file, and zypp::gzstream_detail::ZlibError::_zError.

Referenced by close(), open(), zReadTo(), zSeekTo(), zTell(), and zWriteFrom().

std::streamsize zypp::gzstream_detail::fgzstreambuf::zReadTo char *  buffer_r,
std::streamsize  maxcount_r
[private]
 

Definition at line 210 of file GzStream.cc.

References _file, zypp::base::sysconfig::read(), and setZError().

Referenced by underflow().

bool zypp::gzstream_detail::fgzstreambuf::zWriteFrom const char *  buffer_r,
std::streamsize  count_r
[private]
 

Definition at line 224 of file GzStream.cc.

References _file, and setZError().

Referenced by overflow().

fgzstreambuf::pos_type zypp::gzstream_detail::fgzstreambuf::zSeekTo off_type  off_r,
std::ios_base::seekdir  way_r
[private]
 

Definition at line 241 of file GzStream.cc.

References _file, and setZError().

Referenced by seekTo().

fgzstreambuf::pos_type zypp::gzstream_detail::fgzstreambuf::zTell  )  [private]
 

Definition at line 255 of file GzStream.cc.

References _file, and setZError().

Referenced by seekTo().

fgzstreambuf::pos_type zypp::gzstream_detail::fgzstreambuf::seekTo off_type  off_r,
std::ios_base::seekdir  way_r
[private]
 

Definition at line 269 of file GzStream.cc.

References _buffer, inWriteMode(), isOpen(), sync(), zSeekTo(), and zTell().

Referenced by seekoff(), and seekpos().


Member Data Documentation

gzFile zypp::gzstream_detail::fgzstreambuf::_file [private]
 

Definition at line 143 of file GzStream.h.

Referenced by close(), isOpen(), open(), setZError(), zReadTo(), zSeekTo(), zTell(), and zWriteFrom().

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

Definition at line 145 of file GzStream.h.

Referenced by close(), inReadMode(), inWriteMode(), and open().

buffer_type zypp::gzstream_detail::fgzstreambuf::_buffer [private]
 

Definition at line 147 of file GzStream.h.

Referenced by open(), overflow(), seekTo(), and underflow().

ZlibError zypp::gzstream_detail::fgzstreambuf::_error [private]
 

Definition at line 149 of file GzStream.h.

Referenced by setZError(), and zError().


The documentation for this class was generated from the following files:
Generated on Thu Jul 6 00:07:32 2006 for zypp by  doxygen 1.4.6