7

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

我已经尝试过https://github.com/ararog/Unrar4iOS但是这个库不完整(一些功能还没有实现,比如 -(BOOL) unrarFileTo:(NSString*)path overWrite:(BOOL)overwrite)

谢谢。

4

3 回答 3

5

我最终使用了 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;
}
于 2011-10-23T13:09:09.413 回答
4

这可能会有所帮助:https ://github.com/ararog/Unrar4iOS

于 2011-10-16T16:31:40.373 回答
0

unrarlib库应该适合你,因为 Objective C 是 C 的超集。

于 2011-10-21T00:29:49.737 回答