32 #ifdef GZSTREAM_NAMESPACE
33 namespace GZSTREAM_NAMESPACE {
49 if ((mode & std::ios::ate) || (mode & std::ios::app)
50 || ((mode & std::ios::in) && (mode & std::ios::out)))
53 char* fmodeptr = fmode;
54 if ( mode & std::ios::in)
56 else if ( mode & std::ios::out)
60 file = gzopen( name, fmode);
71 if ( gzclose( file) == Z_OK)
78 if ( gptr() && ( gptr() < egptr()))
79 return *
reinterpret_cast<unsigned char *
>( gptr());
81 if ( ! (mode & std::ios::in) || ! opened)
84 int n_putback = (int)(gptr() - eback());
87 memcpy( buffer + (4 - n_putback), gptr() - n_putback, n_putback);
89 int num = gzread( file, buffer+4, bufferSize-4);
94 setg( buffer + (4 - n_putback),
99 return *
reinterpret_cast<unsigned char *
>( gptr());
105 int w = (int)(pptr() - pbase());
106 if ( gzwrite( file, pbase(), w) != w)
113 if ( ! ( mode & std::ios::out) || ! opened)
119 if ( flush_buffer() == EOF)
128 if ( pptr() && pptr() > pbase()) {
129 if ( flush_buffer() == EOF)
149 if ( ! buf.open( name, gz_open_mode))
150 clear( rdstate() | std::ios::badbit);
156 clear( rdstate() | std::ios::badbit);
159 #ifdef GZSTREAM_NAMESPACE