C++ cross-platform zlib simplifer-wrapper

后端 未结 8 502
陌清茗
陌清茗 2020-12-17 20:26

I\'m looking for a wrapper that distills zlib to:

  1. OpenZipFile()
  2. GetItemInfo(n)
  3. UnzipItem(n) // Bonus points for unzipping recursively if ite
相关标签:
8条回答
  • 2020-12-17 20:59

    This is an old thread, but I thought I'd throw in Boost's ZLib wrapper:

    http://www.boost.org/doc/libs/1_47_0/libs/iostreams/doc/classes/zlib.html

    0 讨论(0)
  • 2020-12-17 21:01

    In the zlib source archive, there is a contribution named "minizip".

    "minizip" is a set of files you can use to play with .zip files. Basic services you need are already there :

    • unzOpen
    • unzLocateFile
    • unzOpenCurrentFile
    • unzGetCurrentFileInfo
    • unzCloseCurrentFile
    • unzClose

    Of course, this is not object oriented (and I'm sure that was not the goal of the creator of minizip), but writing a simple object oriented wrapper should be easy.

    0 讨论(0)
  • 2020-12-17 21:03

    If you will use minizip -- pay attention, thet version shipped with zlib 1.2.3 has 2GB resulting zip file limitation. IT will produce zip with size >2GB - but you won't be able to open them...

    0 讨论(0)
  • 2020-12-17 21:06

    In boost::iostreams there is the possibility to use zlib, gzip and bzip2 formats.

    You find it from http://www.boost.org/

    0 讨论(0)
  • 2020-12-17 21:11

    You can check also this C++ Zlib wrapper with auto-detection of input format: https://github.com/mateidavid/zstr

    0 讨论(0)
  • 2020-12-17 21:12

    GZStream is worth a look. This is a nice cross-platform wrapper round ZLib which extend the STL iostream classes.

    http://www.cs.unc.edu/Research/compgeom/gzstream/

    What is good about this wrapper over some of the others is that if you're working with very large archives you don't need to load the whole dataset into memory.

    0 讨论(0)
提交回复
热议问题