33 #ifdef GZSTREAM_NAMESPACE
34 namespace GZSTREAM_NAMESPACE {
54 char* fmodeptr = fmode;
55 if (
mode & std::ios::in)
57 else if (
mode & std::ios::out)
61 file = gzopen( name, fmode);
72 if ( gzclose(
file) == Z_OK)
79 if ( gptr() && ( gptr() < egptr()))
80 return *
reinterpret_cast<unsigned char *
>( gptr());
85 int n_putback = gptr() - eback();
88 memcpy(
buffer + (4 - n_putback), gptr() - n_putback, n_putback);
90 int num = gzread(
file,
buffer+4, bufferSize-4);
95 setg(
buffer + (4 - n_putback),
100 return *
reinterpret_cast<unsigned char *
>( gptr());
106 int w = pptr() - pbase();
107 if ( gzwrite(
file, pbase(), w) != w)
120 if ( flush_buffer() == EOF)
129 if ( pptr() && pptr() > pbase()) {
130 if ( flush_buffer() == EOF)
150 if ( ! buf.open( name, open_mode))
151 clear( rdstate() | std::ios::badbit);
157 clear( rdstate() | std::ios::badbit);
160 #ifdef GZSTREAM_NAMESPACE