https://github.com/jhuix/librarres
The librarres project is a library that reads RAR compressed files as resource packages.
https://github.com/jhuix/librarres
jres librarres rar rarres res unrar
Last synced: 2 months ago
JSON representation
The librarres project is a library that reads RAR compressed files as resource packages.
- Host: GitHub
- URL: https://github.com/jhuix/librarres
- Owner: jhuix
- License: mit
- Created: 2018-12-27T10:35:55.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-21T03:26:04.000Z (over 6 years ago)
- Last Synced: 2025-01-28T10:35:48.571Z (4 months ago)
- Topics: jres, librarres, rar, rarres, res, unrar
- Language: C++
- Size: 309 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Librarres
=============librarres 工程是一读取由RAR压缩文件做为资源包的库。
## UnRAR
RAR文件分析和解压缩采用 [www.rarlab.com](https://www.rarlab.com) 的解压缩[UnRAR 5.6.8](https://www.rarlab.com/rar/unrarsrc-5.6.8.tar.gz)开源版本源码, 该部分源码请遵守它相关的开源许可。
## Example
#### 1. 获取一个test.rar资源包里的名为"skin\\ui\\index.html"的内容至缓存中:
```
JRES::IRes* rarres = JRES::CreateRarRes(true);
if (rarres) {
if (rarres->Open("test.rar", 0)) {
char* buf = nullptr;
size_t bufsize = 0;
void* res = rarres->LoadResource("skin\\ui\\index.html", &buf, bufsize);
if (res) {
//TO DO USE data of "buf"
rarres->FreeResource(res);
}
}
rarres->Release();
}
```#### 2. 在windows平台下,获取一个test.rar资源包里的名为"skin/img/caotion.png"的内容至IStream中:
```
JRES::IRes* rarres = JRES::CreateRarRes(false);
if (rarres) {
if (rarres->Open("test.rar", '/')) {
IStream* res = rarres->LoadResource("skin/img/caotion.png");
if (res) {
//TO DO USE IStream interface methods of "res";
//For examples: || methods etc.
res->Release();
}
}
rarres->Release();
}
```## License
[MIT](http://opensource.org/licenses/MIT)
Copyright (c) 2018-present, [Jhuix](mailto:[email protected]) (Hui Jin)