marvelph / RarFile

Rar archive library for cocoa.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RarFile
Rar archive library for cocoa.

Kenji Nishishiro <marvel@programmershigh.org>


- Build instructions

1.Get UnRAR source
http://www.rarlab.com/rar_add.htm

2. Add files to Xcode project from UnRAR
unrar/arccmt.cpp
unrar/archive.cpp
unrar/archive.hpp
unrar/arcread.cpp
unrar/array.hpp
unrar/blake2s.cpp
unrar/blake2s.hpp
unrar/blake2sp.cpp
unrar/cmddata.cpp
unrar/cmddata.hpp
unrar/coder.cpp
unrar/coder.hpp
unrar/compress.hpp
unrar/consio.cpp
unrar/consio.hpp
unrar/crc.cpp
unrar/crc.hpp
unrar/crypt.cpp
unrar/crypt.hpp
unrar/crypt1.cpp
unrar/crypt2.cpp
unrar/crypt3.cpp
unrar/crypt5.cpp
unrar/dll.cpp
unrar/dll.hpp
unrar/encname.cpp
unrar/encname.hpp
unrar/errhnd.cpp
unrar/errhnd.hpp
unrar/extinfo.cpp
unrar/extinfo.hpp
unrar/extract.cpp
unrar/extract.hpp
unrar/filcreat.cpp
unrar/filcreat.hpp
unrar/file.cpp
unrar/file.hpp
unrar/filefn.cpp
unrar/filefn.hpp
unrar/filestr.cpp
unrar/filestr.hpp
unrar/find.cpp
unrar/find.hpp
unrar/getbits.cpp
unrar/getbits.hpp
unrar/global.cpp
unrar/global.hpp
unrar/hardlinks.cpp
unrar/hash.cpp
unrar/hash.hpp
unrar/headers.cpp
unrar/headers.hpp
unrar/headers5.hpp
unrar/list.hpp
unrar/loclang.hpp
unrar/log.cpp
unrar/log.hpp
unrar/match.cpp
unrar/match.hpp
unrar/model.cpp
unrar/model.hpp
unrar/options.cpp
unrar/options.hpp
unrar/os.hpp
unrar/pathfn.cpp
unrar/pathfn.hpp
unrar/qopen.cpp
unrar/qopen.hpp
unrar/rar.hpp
unrar/rardefs.hpp
unrar/rarlang.hpp
unrar/raros.hpp
unrar/rartypes.hpp
unrar/rarvm.cpp
unrar/rarvm.hpp
unrar/rarvmtbl.cpp
unrar/rawread.cpp
unrar/rawread.hpp
unrar/rdwrfn.cpp
unrar/rdwrfn.hpp
unrar/recvol.hpp
unrar/resource.hpp
unrar/rijndael.cpp
unrar/rijndael.hpp
unrar/rs.hpp
unrar/rs16.hpp
unrar/savepos.hpp
unrar/scantree.cpp
unrar/scantree.hpp
unrar/secpassword.cpp
unrar/secpassword.hpp
unrar/sha1.cpp
unrar/sha1.hpp
unrar/sha256.cpp
unrar/sha256.hpp
unrar/smallfn.cpp
unrar/smallfn.hpp
unrar/strfn.cpp
unrar/strfn.hpp
unrar/strlist.cpp
unrar/strlist.hpp
unrar/suballoc.cpp
unrar/suballoc.hpp
unrar/system.cpp
unrar/system.hpp
unrar/threadpool.hpp
unrar/timefn.cpp
unrar/timefn.hpp
unrar/ulinks.cpp
unrar/unicode.cpp
unrar/unicode.hpp
unrar/unpack.cpp
unrar/unpack.hpp
unrar/unpack15.cpp
unrar/unpack20.cpp
unrar/unpack30.cpp
unrar/unpack50.cpp
unrar/unpack50frag.cpp
unrar/unpackinline.cpp
unrar/uowners.cpp
unrar/version.hpp
unrar/volume.cpp
unrar/volume.hpp
unrar/win32stm.cpp

3. Remove target membership from Xcode project
arccmt.cpp
blake2sp.cpp
coder.cpp
crypt1.cpp
crypt2.cpp
crypt3.cpp
crypt5.cpp
hardlinks.cpp
log.cpp
model.cpp
rarvmtbl.cpp
suballoc.cpp
ulinks.cpp
unpack15.cpp
unpack20.cpp
unpack30.cpp
unpack50.cpp
unpack50frag.cpp
unpackinline.cpp
uowners.cpp
win32stm.cpp

4. Add preprocessor macro to Xcode project
SILENT RARDLL

5. Add files to Xcode project from RarFile
RarFile.h RarFile.m


- How to use RarFile

RarFile *rarFile = [[[RarFile alloc] initWithFileAtPath:@"foo.rar"] autorelease];

// Open rar archive
if (![rarFile open]) {
	// Handle error
}

// Get file name list. 
// Hierarchy handling is unnecessary.
// File name includes pass separator, and list of file names gives back all file names.
NSArray *fileNames = [rarFile fileNames];
if (!fileNames) {
	// Handle error
}

// Get file contents.
// That will read all at a time, not suitable for huge file.
// For safety, please set maxLength.
NSData *data = [rarFile readWithFileName:@"baa.jpeg" maxLength:1024 * 1024];
if (!data) {
	// Handle error
}

// Close rar archive
[rarFile close];


- Licence

Copyright (c) 2013 Kenji Nishishiro

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

About

Rar archive library for cocoa.


Languages

Language:Erlang 56.4%Language:Objective-C 43.6%