33 #ifdef GZSTREAM_NAMESPACE
34 namespace GZSTREAM_NAMESPACE {
50 if ((mode & std::ios::ate) || (mode & std::ios::app)
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);
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)
114 if ( ! ( mode & std::ios::out) || ! opened)
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