libzypp 17.31.7
zypp::gzstream_detail::gzstreambufimpl Class Reference

Streambuffer reading or writing gzip files. More...

#include <base/gzstream.h>

Public Types

using error_type = ZlibError

Public Member Functions

 ~gzstreambufimpl ()
bool isOpen () const
bool canRead () const
bool canWrite () const
bool canSeek (std::ios_base::seekdir way_r) const
error_type error () const
 The last error returned fron zlib. More...
std::streamsize readData (char *buffer_r, std::streamsize maxcount_r)
bool writeData (const char *buffer_r, std::streamsize count_r)
off_t seekTo (off_t off_r, std::ios_base::seekdir way_r, std::ios_base::openmode omode_r)
off_t tell () const

Protected Member Functions

bool openImpl (const char *name_r, std::ios_base::openmode mode_r)
bool closeImpl ()
off_t compressed_tell () const
 Tell the file position in the compressed file. More...

Private Member Functions

void setZError () const

Private Attributes

int _fd = -1
 file descriptor of the compressed file More...
gzFile _file = nullptr
std::ios_base::openmode _mode = std::ios_base::openmode(0)
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 90 of file gzstream.h.

Member Typedef Documentation

◆ error_type

Constructor & Destructor Documentation

◆ ~gzstreambufimpl()

zypp::gzstream_detail::gzstreambufimpl::~gzstreambufimpl ( )

Definition at line 95 of file gzstream.h.

Member Function Documentation

◆ isOpen()

bool zypp::gzstream_detail::gzstreambufimpl::isOpen ( ) const

Definition at line 99 of file gzstream.h.

◆ canRead()

bool zypp::gzstream_detail::gzstreambufimpl::canRead ( ) const

Definition at line 103 of file gzstream.h.

◆ canWrite()

bool zypp::gzstream_detail::gzstreambufimpl::canWrite ( ) const

Definition at line 107 of file gzstream.h.

◆ canSeek()

bool zypp::gzstream_detail::gzstreambufimpl::canSeek ( std::ios_base::seekdir  way_r) const

Definition at line 111 of file gzstream.h.

◆ openImpl()

bool zypp::gzstream_detail::gzstreambufimpl::openImpl ( const char *  name_r,
std::ios_base::openmode  mode_r 

Definition at line 74 of file

◆ closeImpl()

bool zypp::gzstream_detail::gzstreambufimpl::closeImpl ( )

Definition at line 110 of file

◆ compressed_tell()

off_t zypp::gzstream_detail::gzstreambufimpl::compressed_tell ( ) const

Tell the file position in the compressed file.

Analogous to tell(2), complementary to gztell.

Definition at line 197 of file

◆ error()

error_type zypp::gzstream_detail::gzstreambufimpl::error ( ) const

The last error returned fron zlib.

Definition at line 127 of file gzstream.h.

◆ readData()

std::streamsize zypp::gzstream_detail::gzstreambufimpl::readData ( char *  buffer_r,
std::streamsize  maxcount_r 

Definition at line 143 of file

◆ writeData()

bool zypp::gzstream_detail::gzstreambufimpl::writeData ( const char *  buffer_r,
std::streamsize  count_r 

Definition at line 157 of file

◆ seekTo()

off_t zypp::gzstream_detail::gzstreambufimpl::seekTo ( off_t  off_r,
std::ios_base::seekdir  way_r,
std::ios_base::openmode  omode_r 

Definition at line 174 of file

◆ tell()

off_t zypp::gzstream_detail::gzstreambufimpl::tell ( ) const

Definition at line 188 of file

◆ setZError()

void zypp::gzstream_detail::gzstreambufimpl::setZError ( ) const

Definition at line 138 of file gzstream.h.

Member Data Documentation

◆ _fd

int zypp::gzstream_detail::gzstreambufimpl::_fd = -1

file descriptor of the compressed file

Definition at line 142 of file gzstream.h.

◆ _file

gzFile zypp::gzstream_detail::gzstreambufimpl::_file = nullptr

Definition at line 144 of file gzstream.h.

◆ _mode

std::ios_base::openmode zypp::gzstream_detail::gzstreambufimpl::_mode = std::ios_base::openmode(0)

Definition at line 146 of file gzstream.h.

◆ _error

ZlibError zypp::gzstream_detail::gzstreambufimpl::_error

Definition at line 148 of file gzstream.h.

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