gzstream library

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top