Boost zlib filter help?

Alright, so I already set up a basic set of binary io, where data can be written byte by byte, and read back byte by byte, whether it's u16, u32, whatever.

However, I wanted to introduce .zip compression, and I'm already using boost as a dependency and wanted to try and apply the zlib filter rather than actually use zlib directly.

The thing is I'm not feeling so intelligent with their example.
http://www.boost.org/doc/libs/1_51_0/libs/iostreams/doc/classes/gzip.html

I'm not really sure how I can keep writing byte by byte with the filter.
Last edited on
You should do a bit more research into how the boost streams library works. You can definitely do what you are trying to do, you just need to apply the filter to your stream. I would grab a link or example for you but I am on my phone :p

EDIT: I have this old code I wrote a year or so ago, should give you some hints:
https://github.com/LB--/MCModify/blob/cpp/test/test.cpp
Last edited on
For some reason, push() doesn't seem to be a member of iostreams::filtering_streambuf, I'm using QtCreator which normally has pretty good autocompletion, and it didn't recognize. I tried building anyways and yeah it acts like the method doesn't exist.

I installed the prebuilt boost binaries through the package manager on my Ubuntu machine, I can't imagine why there would be some difference like this on different versions of boost however.

EDIT:

Ok, it was something else, thanks LB. I don't know why it doesn't autocomplete but push does build just fine.
Last edited on
Topic archived. No new replies allowed.