C++学习笔记码农崛起(iOS、Android、java、c++等)C++

C++封装zlib库压缩字符串

2016-01-06  本文已影响979人  明天不用上课

可以看一下我的Github项目,使用封装zlib库的ZLibString类进行压缩C++字符串。

// 压缩,pcContentBuf:要压缩的内容 pcCompBuf:压缩后的内容 ulCompLen:得到压缩后的长度
bool Compress(const char* pcContentBuf, char* pcCompBuf, unsigned long& ulCompLen);
// 解压,pcCompBuf:压缩的内容, pcUnCompBuf:解压后的内容 ulCompLen:传入压缩内容的长度
bool UnCompress(const char* pcCompBuf, char* pcUnCompBuf, unsigned long ulCompLen);
```
具体见源码。

上一篇 下一篇

猜你喜欢

热点阅读