有没有适用于 iOS 的 unrar 库?

2023-11-23

我想在我的 iPhone 应用程序中包含 unrar 文件选项。

我已经尝试过了https://github.com/ararog/Unrar4iOS但这个库并不完整(有些功能尚未实现,例如 -(BOOL) unrarFileTo:(NSString*)path overWrite:(BOOL)overwrite)

Thanks.


我最终使用了 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;
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

有没有适用于 iOS 的 unrar 库? 的相关文章

随机推荐