Ale*_*987 7 iphone cocoa unrar ipad ios
我想在我的iPhone应用程序中包含一个unrar文件选项.
我已经尝试了https://github.com/ararog/Unrar4iOS但是这个库还没有完成(有些函数还没有实现像 - (BOOL)unrarFileTo:(NSString*)path overWrite:(BOOL)overwrite)
谢谢.
我最终使用的是Unrar4ios,但我需要自己编写实际提取rar文件的函数:
-(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;
}
Run Code Online (Sandbox Code Playgroud)