是否有一个unrar库在那里为iOS? [英] Is there an unrar library out there for iOS?
本文介绍了是否有一个unrar库在那里为iOS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在我的iphone应用程序中包括一个unrar文件选项。
I want to include an unrar files option in my iphone app.
我已经尝试过 https://github.com/ararog/Unrar4iOS但是这个库不完整(一些功能还没有实现像 - (BOOL)unrarFileTo:(NSString *)path overWrite:(BOOL)覆盖)
I have already tried https://github.com/ararog/Unrar4iOS but this library is not complete (some functions are not yet implemented like -(BOOL) unrarFileTo:(NSString*)path overWrite:(BOOL)overwrite)
。
推荐答案
我最终使用Unrar4ios,但我需要写自己的函数,实际上提取rar文件:
I ended up using Unrar4ios but I needed to write myself the function that actually extracts the rar file:
-(BOOL) unrarFileTo:(NSString*)path overWrite:(BOOL)overwrite {
int RHCode = 0, PFCode = 0;
[self _unrarOpenFile:filename mode:RAR_OM_EXTRACT];
while ((RHCode = RARReadHeaderEx(_rarFile, header)) == 0) {
if ((PFCode = RARProcessFile(_rarFile, RAR_EXTRACT, (char *)[path UTF8String], NULL)) != 0) {
[self _unrarCloseFile];
return NO;
}
}
[self _unrarCloseFile];
return YES;
}
这篇关于是否有一个unrar库在那里为iOS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文