iphone - 那里有适用于 iOS 的 unrar 库吗?

标签 iphone ios cocoa ipad unrar

我想在我的 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;
}

关于iphone - 那里有适用于 iOS 的 unrar 库吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7785659/

相关文章:

ios - Core Animation 在应用重新出现时停止动画

macos - 拖动 NSStackView 中的 View 以重新排列顺序

iphone - 关于自动释放/释放使用的另一个 iOS 内存管理说明

iphone - 确定长按手势识别器的位置

ios - 如何在 Swift 中保持 UITextView 中 HTML 内容的缩进?

iphone - UILabel 默认字距与 CATextLayer 不同

javascript - PhoneGap for iOS 中的通知

c++ - Mac 中的 OpenGL ARB 函数

macos - cgeventtap 的 Apple mach-o 链接器 ID 错误

cocoa - OS X/Cocoa - 如何从目录中读取每个文件?