我需要 ungzip/regzip 文件以便在我的 c++ 中编辑在窗口中
我正在开发一个小型应用程序,用于解析某个文件、取消加密、进行更改、重新加密和保存。它工作得很好,但为了让它工作,我需要手动解压缩它,在输出上运行应用程序,然后 gzip 来自其中的内容。我只是想知道是否有人知道一个优雅的解决方案/库,我可以使用它来自动化将在 Windows 上运行的 C++ 应用程序中的两个阶段。如果它能够检测到文件是否首先被 gzip 压缩,那就加分了。
多谢!
I'm working on a small application that parses a certain file, un-encrypts, makes changes, re-encrypts, and saves. It works well, but for it to work I need to manually ungzip it, run the application on the output, then gzip what comes from that. I'm just wondering if someone knows of an elegant solution/library I can use to automate both stages within the C++ application that will run on windows. Bonus points if it can detect if the file is gzipped in the first place.
Thanks a lot!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Zlib 就是这样做的。 CGZip 为其实现了一个 C++ 包装器。 这里是如何检测给定文件是否被 gzip 压缩的示例。
Zlib does that. And CGZip implements a C++ wrapper for it. And here is an example of how to detect if a given file is gzipped.