F
Fraser Ross
Does anyone have any experience with this library wrapper? I would not
expect it to be entirely bug free. Here is a few changes I made to improve
it:
Some necessary code is copied from the constructor to here to fix a bug with
reattaching a file:
GZStreamBuf * GZStreamBuf::close() {
if ( is_open()) {
sync();
opened = 0;
setp( buffer, buffer + (bufferSize-1));
setg( buffer + 4, // beginning of putback area
buffer + 4, // read position
buffer + 4); // end position
if ( gzclose( file) == Z_OK)
return this;
}
return (GZStreamBuf*)0;
}
The rdbuf() functions of igzstream and ogzstream can be removed. The same
function in the base class should be constant and return a pointer to
constant.
Fraser.
expect it to be entirely bug free. Here is a few changes I made to improve
it:
Some necessary code is copied from the constructor to here to fix a bug with
reattaching a file:
GZStreamBuf * GZStreamBuf::close() {
if ( is_open()) {
sync();
opened = 0;
setp( buffer, buffer + (bufferSize-1));
setg( buffer + 4, // beginning of putback area
buffer + 4, // read position
buffer + 4); // end position
if ( gzclose( file) == Z_OK)
return this;
}
return (GZStreamBuf*)0;
}
The rdbuf() functions of igzstream and ogzstream can be removed. The same
function in the base class should be constant and return a pointer to
constant.
Fraser.