13 if ( own_file_descriptor )
30 }
else if ( io_mode & ios::app ) {
38 if ( io_mode & ios::binary ) {
44 if ( io_mode & (
ios::out|ios::app )) {
51 if ( (
file =
gzopen(name, char_mode)) == NULL )
54 own_file_descriptor = 1;
72 }
else if ( io_mode & ios::app ) {
80 if ( io_mode & ios::binary ) {
86 if ( io_mode & (
ios::out|ios::app )) {
93 if ( (
file =
gzdopen(file_descriptor, char_mode)) == NULL )
96 own_file_descriptor = 0;
131 return streampos(EOF);
144 if ( (allocate()) == EOF )
151 return (
unsigned char) *gptr();
153 if ( out_waiting() ) {
154 if ( flushbuf() == EOF )
162 int result = fillbuf();
163 if ( result == EOF ) {
169 return (
unsigned char) *gptr();
179 if ( allocate() == EOF )
187 if (flushbuf() == EOF)
193 setp( base(), base() + bl);
218 int gzfilebuf::flushbuf() {
235 int gzfilebuf::fillbuf() {
246 if ( t <= 0)
return EOF;
248 setg( base(), base(), base()+t);
263 if ( !buffer.
attach( fd, io_mode) )
264 clear( ios::failbit | ios::badbit );
272 if ( !buffer.
open( name, io_mode ) )
273 clear( ios::failbit | ios::badbit );
281 if ( !buffer.
close() )
282 clear( ios::failbit | ios::badbit );
294 clear( ios::badbit );
314 clear( ios::badbit );
virtual streampos seekoff(streamoff, ios::seek_dir, int)
void open(const char *name, int io_mode)
gzfilebuf * attach(int file_descriptor, int io_mode)
int gzread(gzFile file, voidp buf, unsigned len)
gzFile gzopen(char *path, char *mode)
gzfilebuf * rdbuf() const
gzfilebuf * open(const char *name, int io_mode)
void attach(int fd, int io_mode)
gzfilebuf * rdbuf() const
int gzsetparams(gzFile file, int level, int strategy)
Gzipped file stream buffer class.
static int out(void *out_desc, unsigned char *buf, unsigned len)
gzFile gzdopen(int fd, char *mode)
virtual ~gzfilestream_common()
int setcompressionlevel(int comp_level)
static unsigned in(void *in_desc, z_const unsigned char **buf)
int setcompressionstrategy(int comp_strategy)
virtual int overflow(int=EOF)
int gzwrite(gzFile file, voidpc buf, unsigned len)