35#ifdef GZSTREAM_NAMESPACE
52 if ((
mode & std::ios::ate) || (
mode & std::ios::app)
53 || ((
mode & std::ios::in) && (
mode & std::ios::out)))
56 char* fmodeptr = fmode;
57 if (
mode & std::ios::in)
59 else if (
mode & std::ios::out)
63 file = gzopen( _name, fmode);
74 if ( gzclose(
file) == Z_OK)
81 if ( gptr() && ( gptr() < egptr()))
82 return *
reinterpret_cast<unsigned char *
>( gptr());
87 size_t n_putback = (size_t) (gptr() - eback());
90 memcpy(
buffer + (4 - n_putback), gptr() - n_putback, n_putback);
97 setg(
buffer + (4 - n_putback),
102 return *
reinterpret_cast<unsigned char *
>( gptr());
108 int w =
static_cast<int>(pptr() - pbase());
109 if ( gzwrite(
file, pbase(), (
unsigned int) w) != w)
119 *pptr() =
static_cast<char>(c);
131 if ( pptr() && pptr() > pbase()) {
152 if ( !
buf.
open( _name, _open_mode))
153 setstate(std::ios::badbit);
160 setstate(std::ios::badbit);
164#ifdef GZSTREAM_NAMESPACE
~gzstreambase()
destructor
gzstreambase()
default constructor
void open(const char *_name, int _open_mode)
Internal class to implement gzstream.
char opened
open/close state of stream
gzFile file
file handle for compressed file
static const int bufferSize
size of data buff
virtual int overflow(int c=EOF)
gzstreambuf * open(const char *name, int open_mode)
char buffer[bufferSize]
data buffer
Utilities for handling gzipped input and output streams.