13 if ( own_file_descriptor )
30 }
else if ( io_mode & ios::app ) {
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 ) {
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 )
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() {
226 if (
gzwrite( file, q, n) < n )
235 int gzfilebuf::fillbuf() {
244 int t =
gzread( file, p, required );
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 );
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)
GLdouble GLdouble GLdouble GLdouble q
int ZEXPORT gzsetparams(gzFile file, int level, int strategy)
int ZEXPORT gzclose(gzFile file)
int ZEXPORT gzwrite(gzFile file, voidpc buf, unsigned len)
gzfilebuf * open(const char *name, int io_mode)
void attach(int fd, int io_mode)
const GLuint GLenum const GLvoid * binary
local int out(void *out_desc, unsigned char *buf, unsigned len)
Gzipped file stream buffer class.
gzfilebuf * rdbuf() const
Obtain underlying stream buffer.
gzFile ZEXPORT gzdopen(int fd, const char *mode)
gzfilebuf * rdbuf() const
Obtain underlying stream buffer.
virtual ~gzfilestream_common()
GLuint const GLchar * name
int setcompressionlevel(int comp_level)
int setcompressionstrategy(int comp_strategy)
gzFile ZEXPORT gzopen(char *path, const char *mode) const
virtual int overflow(int=EOF)
int ZEXPORT gzread(gzFile file, voidp buf, unsigned len)