Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isolating raw ZLib API? #107

Open
target-san opened this issue Jan 12, 2021 · 3 comments
Open

Isolating raw ZLib API? #107

target-san opened this issue Jan 12, 2021 · 3 comments

Comments

@target-san
Copy link

Hello!

Is raw ZLib API strictly necessary for using QuaZip? Can it be isolated somehow, to have clean Qt API?
It's possible though that I'm using non-public headers, as some headers like quagzipfile.h, quaziodevice.h include <zlib.h> directly. The other peculiarity is that package installed by CMake requires ZLib as its dependency unconditionally, even if QuaZip was compiled as shared lib.

Thanks

@stachenov
Copy link
Owner

I think it's quite easy to get rid of #include <zlib.h> in those two headers. As far as I can see, these are pure headers with no inline functions or anything.

But the dependency itself would still be there. QuaZip is nothing more than a convenience wrapper around Minizip, and Minizip's API is exposed everywhere. It wasn't designed as a ZIP library with Minizip as an implementation detail, but rather than as an extension of Minizip. It was probably a design mistake, but now it can't be fixed until at least QuaZip 2.0. And that would require some time which I'm afraid I don't have.

And because Minizip itself uses zlib directly, the dependency is unavoidable. So the best I can do is to get rid of unnecessary zlib.h includes in some public headers. Minizip headers include it too, and they are considered public headers as well, so... it won't really help that much.

@target-san
Copy link
Author

target-san commented Jan 12, 2021

So, just in theory, if someone uses only Qt API, can he drop minizip and zlib headers?
EDIT: It seems that zip.h and unzip.h depend on ZLIB API. And they're included in quazip.h. Not the best news :(

@stachenov
Copy link
Owner

It should be possible to get rid of those. I think Minizip API is only exposed through error codes, which are just ints. Everything else in theory could be moved to source files thank to the Pimpl idiom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants