https://github.com/jhuix/lib7zres
The lib7zres project is a library that reads 7z compressed files as resource packages.
https://github.com/jhuix/lib7zres
7z 7zip 7zres lib7zres lzma lzma2 res sevenzip
Last synced: about 1 year ago
JSON representation
The lib7zres project is a library that reads 7z compressed files as resource packages.
- Host: GitHub
- URL: https://github.com/jhuix/lib7zres
- Owner: jhuix
- License: mit
- Created: 2018-12-29T04:22:50.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-21T03:36:42.000Z (over 7 years ago)
- Last Synced: 2025-01-28T10:35:45.754Z (over 1 year ago)
- Topics: 7z, 7zip, 7zres, lib7zres, lzma, lzma2, res, sevenzip
- Language: C++
- Homepage:
- Size: 1.81 MB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Lib7zres
=============
lib7zres 工程是一读取由7z压缩文件做为资源包的库。
## 7z-LZMA SDK
7z文件分析和解压缩采用 [7Zip](https://www.7-zip.org) 的解压缩[LZMA SDK](https://www.7-zip.org/sdk.html)开源版本源码。
## Example
#### 1. 获取一个test.7z资源包里的名为"skin\\ui\\index.html"的内容至缓存中:
```
JRES::IRes* jres = SEVENZRES::Create7zRes(true);
if (jres) {
if (jres->Open("test.7z", '\\')) {
char* buf = nullptr;
size_t bufsize = 0;
void* res = jres->LoadResource("skin\\ui\\index.html", &buf, bufsize);
if (res) {
//TO DO USE data of "buf"
rarres->FreeResource(res);
}
}
jres->Release();
}
```
#### 2. 在windows平台下,获取一个test.7z"skin/img/caotion.png"的内容至IStream中:
```
JRES::IRes* jres = SEVENZRES::Create7zRes(true);
if (jres) {
if (jres->Open("test.7z", 0)) {
IStream* res = jres->LoadResource("skin/img/caotion.png");
if (res) {
//TO DO USE IStream interface methods of "res";
//For examples: || methods etc.
res->Release();
}
}
jres->Release();
}
```
## License
[MIT](http://opensource.org/licenses/MIT)
Copyright (c) 2018-present, [Jhuix](mailto:jhuix0117@gmail.com) (Hui Jin)