libzypp 17.31.23
|
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. | |
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. | |
Private Member Functions | |
void | setZError () const |
Private Attributes | |
int | _fd = -1 |
file descriptor of the compressed file | |
gzFile | _file = nullptr |
std::ios_base::openmode | _mode = std::ios_base::openmode(0) |
ZlibError | _error |
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.
Definition at line 93 of file gzstream.h.
|
inline |
Definition at line 95 of file gzstream.h.
|
inline |
Definition at line 99 of file gzstream.h.
|
inline |
Definition at line 103 of file gzstream.h.
|
inline |
Definition at line 107 of file gzstream.h.
|
inline |
Definition at line 111 of file gzstream.h.
|
protected |
Definition at line 74 of file gzstream.cc.
|
protected |
Definition at line 110 of file gzstream.cc.
|
protected |
Tell the file position in the compressed file.
Analogous to tell(2), complementary to gztell.
Definition at line 197 of file gzstream.cc.
|
inline |
The last error returned fron zlib.
Definition at line 127 of file gzstream.h.
std::streamsize zypp::gzstream_detail::gzstreambufimpl::readData | ( | char * | buffer_r, |
std::streamsize | maxcount_r | ||
) |
Definition at line 143 of file gzstream.cc.
bool zypp::gzstream_detail::gzstreambufimpl::writeData | ( | const char * | buffer_r, |
std::streamsize | count_r | ||
) |
Definition at line 157 of file gzstream.cc.
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 gzstream.cc.
off_t zypp::gzstream_detail::gzstreambufimpl::tell | ( | ) | const |
Definition at line 188 of file gzstream.cc.
|
inlineprivate |
Definition at line 138 of file gzstream.h.
|
private |
file descriptor of the compressed file
Definition at line 142 of file gzstream.h.
|
private |
Definition at line 144 of file gzstream.h.
|
private |
Definition at line 146 of file gzstream.h.
|
mutableprivate |
Definition at line 148 of file gzstream.h.