在控制台下用C ++编写Zip文件 [英] Zip file in C++ under console

查看:60
本文介绍了在控制台下用C ++编写Zip文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我需要一个可以用c ++压缩文件的zip库(或函数)。

请帮帮我

谢谢



我尝试了什么:



我试过zlib,minizib,......但我可以'找到解决方案

Hi all, I need a zip library (or a function) that can zip file in c++.
please help me
thanks

What I have tried:

I tried zlib, minizib, ... but I can't find a solution

推荐答案

你找不到的是一个内置的C ++函数来做到这一点。因为没有。 C ++是一种语言,依赖于底层运行时/框架来提供文件系统和其他支持。这个问题在CodeProject上已经被问过很多次了,比如看看这里,用C ++编写Zip文件 [ ^ ]



一种方法是使用boost库。但同样,你必须使钉子正常工作。其他方法是使用您已经看过的其他库。解决方案是正确编写获取文件的函数,压缩流,然后将流写为存档文件。



分享您尝试过的代码,我们将为您提供更多指导。



c ++ - 具有公共域许可证的最佳zip库 - Stack Overflow [ ^ ]

C ++跨平台zlib simplifer-wrapper - Stack Overflow [ ^ ]

c ++ - 跨平台文件归档 - Stack Overflow [ ^ ]



如果您还不知道,网站 [ ^ ]对于您所说的您正在探索但未找到的解决方案的库之一,您可以看到提供示例应用程序,您应该下载并且看看它是如何工作的。
What you cannot find is a built-in C++ function that does this. Because there isn't any. C++ is a language and relies upon the underlying runtime/framework to provide file system and other support. This question has been asked on CodeProject a lot times as well, for example look here, Zip Files in C++[^]

One way to do is, using boost libraries. But again, you would have to make the pegs work correctly. Other way is by using other libraries that you have already seen. The solution is to properly write the functions that take the file, compress the stream, then write the stream as an archived file.

Share your code that you have tried, and we would be able to guide you further.

c++ - The best zip library with public domain license - Stack Overflow[^]
C++ cross-platform zlib simplifer-wrapper - Stack Overflow[^]
c++ - Cross platform file archiving - Stack Overflow[^]

If you still do not know, here is the website[^] for one of the libraries that you said you explore but didn't find a solution for, you can see that provide a sample app as well, you should download and see how that works.


这篇关于在控制台下用C ++编写Zip文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆