Skip to content

Commit

Permalink
Merged in Carthage/Swift 2.0 branches
Browse files Browse the repository at this point in the history
  • Loading branch information
abbeycode committed Nov 6, 2015
2 parents a6fbef1 + 162eabc commit 0207da7
Show file tree
Hide file tree
Showing 27 changed files with 1,071 additions and 1,541 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
build
.DS_Store

CarthageValidation

**/*.xccheckout
**/xcuserdata/*
13 changes: 6 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
language: objective-c
osx_image: xcode7.1

osx_image: beta-xcode6.3
before_install:
- brew update
- brew install carthage
- brew upgrade xctool

xcode_workspace: UnrarKit.xcworkspace

Expand All @@ -14,18 +18,13 @@ matrix:
xcode_sdk: iphonesimulator
env: NAME=iOSTests

- xcode_scheme: UnrarKit
xcode_sdk: macosx10.9
env: NAME=Mavericks

- xcode_scheme: UnrarExample
xcode_sdk: iphonesimulator
env: NAME=ExampleAppBuild

script:
- xctool -workspace $TRAVIS_XCODE_WORKSPACE -scheme "$TRAVIS_XCODE_SCHEME" -sdk $TRAVIS_XCODE_SDK -configuration Release analyze test

after_script:
- ./Scripts/carthage-validate.sh
- ./Scripts/cocoapod-validate.sh

# Turn on Docker, container-based infrastructure
Expand Down
75 changes: 63 additions & 12 deletions Classes/URKArchive.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ typedef NS_ENUM(NSInteger, URKErrorCode) {

#define ERAR_ARCHIVE_NOT_FOUND 101

NS_ASSUME_NONNULL_BEGIN

extern NSString *URKErrorDomain;

/**
Expand All @@ -106,48 +108,96 @@ extern NSString *URKErrorDomain;
/**
* The URL of the archive
*/
@property(weak, readonly) NSURL *fileURL;
@property(nullable, weak, readonly) NSURL *fileURL;

/**
* The filename of the archive
*/
@property(weak, readonly) NSString *filename;
@property(nullable, weak, readonly) NSString *filename;

/**
* The password of the archive
*/
@property(nonatomic, strong) NSString *password;
@property(nullable, nonatomic, strong) NSString *password;


/**
* Creates and returns an archive at the given path
*
* @param filePath A path to the archive file
*/
+ (instancetype)rarArchiveAtPath:(NSString *)filePath;
+ (nullable instancetype)rarArchiveAtPath:(NSString *)filePath __deprecated_msg("Use -initWithPath:error: instead");

/**
* Creates and returns an archive at the given URL
*
* @param fileURL The URL of the archive file
*/
+ (instancetype)rarArchiveAtURL:(NSURL *)fileURL;
+ (nullable instancetype)rarArchiveAtURL:(NSURL *)fileURL __deprecated_msg("Use -initWithURL:error: instead");

/**
* Creates and returns an archive at the given path, with a given password
*
* @param filePath A path to the archive file
* @param password The passowrd of the given archive
*/
+ (instancetype)rarArchiveAtPath:(NSString *)filePath password:(NSString *)password;
+ (nullable instancetype)rarArchiveAtPath:(NSString *)filePath password:(NSString *)password __deprecated_msg("Use -initWithPath:password:error: instead");

/**
* Creates and returns an archive at the given URL, with a given password
*
* @param fileURL The URL of the archive file
* @param password The passowrd of the given archive
*/
+ (instancetype)rarArchiveAtURL:(NSURL *)fileURL password:(NSString *)password;
+ (nullable instancetype)rarArchiveAtURL:(NSURL *)fileURL password:(NSString *)password __deprecated_msg("Use -initWithURL:password:error: instead");


/**
* Do not use the default initializer
*/
- (instancetype)init NS_UNAVAILABLE;

/**
* Creates and returns an archive at the given path
*
* @param filePath A path to the archive file
* @param error Contains any error during initialization
*
* @return Returns an initialized URKArchive, unless there's a problem creating a bookmark to the path
*/
- (nullable instancetype)initWithPath:(NSString *)filePath error:(NSError **)error;

/**
* Creates and returns an archive at the given URL
*
* @param fileURL The URL of the archive file
* @param error Contains any error during initialization
*
* @return Returns an initialized URKArchive, unless there's a problem creating a bookmark to the URL
*/
- (nullable instancetype)initWithURL:(NSURL *)fileURL error:(NSError **)error;

/**
* Creates and returns an archive at the given path, with a given password
*
* @param filePath A path to the archive file
* @param password The passowrd of the given archive
* @param error Contains any error during initialization
*
* @return Returns an initialized URKArchive, unless there's a problem creating a bookmark to the path
*/
- (nullable instancetype)initWithPath:(NSString *)filePath password:(NSString *)password error:(NSError **)error;

/**
* Creates and returns an archive at the given URL, with a given password
*
* @param fileURL The URL of the archive file
* @param password The passowrd of the given archive
* @param error Contains any error during initialization
*
* @return Returns an initialized URKArchive, unless there's a problem creating a bookmark to the URL
*/
- (nullable instancetype)initWithURL:(NSURL *)fileURL password:(NSString *)password error:(NSError **)error;


/**
Expand Down Expand Up @@ -175,7 +225,7 @@ extern NSString *URKErrorDomain;
*
* @return Returns a list of NSString containing the paths within the archive's contents, or nil if an error was encountered
*/
- (NSArray *)listFilenames:(NSError **)error;
- (nullable NSArray<NSString*> *)listFilenames:(NSError **)error;

/**
* Lists the various attributes of each file in the archive
Expand All @@ -184,7 +234,7 @@ extern NSString *URKErrorDomain;
*
* @return Returns a list of URKFileInfo objects, which contain metadata about the archive's files, or nil if an error was encountered
*/
- (NSArray *)listFileInfo:(NSError **)error;
- (nullable NSArray<URKFileInfo*> *)listFileInfo:(NSError **)error;

/**
* Writes all files in the archive to the given path
Expand All @@ -202,7 +252,7 @@ extern NSString *URKErrorDomain;
*/
- (BOOL)extractFilesTo:(NSString *)filePath
overwrite:(BOOL)overwrite
progress:(void (^)(URKFileInfo *currentFile, CGFloat percentArchiveDecompressed))progress
progress:(nullable void (^)(URKFileInfo *currentFile, CGFloat percentArchiveDecompressed))progress
error:(NSError **)error;

/**
Expand All @@ -218,7 +268,7 @@ extern NSString *URKErrorDomain;
* @return An NSData object containing the bytes of the file, or nil if an error was encountered
*/
- (NSData *)extractData:(URKFileInfo *)fileInfo
progress:(void (^)(CGFloat percentDecompressed))progress
progress:(nullable void (^)(CGFloat percentDecompressed))progress
error:(NSError **)error;

/**
Expand All @@ -234,7 +284,7 @@ extern NSString *URKErrorDomain;
* @return An NSData object containing the bytes of the file, or nil if an error was encountered
*/
- (NSData *)extractDataFromFile:(NSString *)filePath
progress:(void (^)(CGFloat percentDecompressed))progress
progress:(nullable void (^)(CGFloat percentDecompressed))progress
error:(NSError **)error;

/**
Expand Down Expand Up @@ -298,3 +348,4 @@ extern NSString *URKErrorDomain;


@end
NS_ASSUME_NONNULL_END
Loading

0 comments on commit 0207da7

Please sign in to comment.