diff --git a/README.md b/README.md index 79c608a..29e9181 100644 --- a/README.md +++ b/README.md @@ -194,14 +194,9 @@ If you want to retrieve a portion of file you should can `contentsAtPath` method ### TODO List -[] TCPSocket test (using telnet) - -[] SMB2 protocol support using TCPSocketClient - -[] FTP/FTPS protocol support using TCPSocketClient - -[] Dropbox support - -[] Amazon S3 support - -[] SMB1 protocol implementation \ No newline at end of file +- [ ] TCPSocket test (using telnet) +- [ ] SMB2 protocol support using TCPSocketClient +- [ ] FTP/FTPS protocol support using TCPSocketClient +- [ ] Dropbox support +- [ ] Amazon S3 support +- [ ] SMB1 protocol implementation \ No newline at end of file diff --git a/Source/FileProvider.swift b/Source/FileProvider.swift index ebcd982..88b58b3 100644 --- a/Source/FileProvider.swift +++ b/Source/FileProvider.swift @@ -7,6 +7,12 @@ // import Foundation +#if (iOS) +import UIKit +#endif +#if (OSX) +import Cocoa +#endif public enum FileType: String { case Directory @@ -171,6 +177,11 @@ public protocol ExtendedFileProvider: FileProvider { func thumbnailOfFileAtPath(path: String, dimension: CGSize, completionHandler: ((image: UIImage?, error: ErrorType?) -> Void)) func propertiesOfFileAtPath(path: String, completionHandler: ((propertiesDictionary: [String: AnyObject], keys: [String], error: ErrorType?) -> Void)) } +#elseif (OSX) +public protocol ExtendedFileProvider: FileProvider { + func thumbnailOfFileAtPath(path: String, dimension: CGSize, completionHandler: ((image: NSImage?, error: ErrorType?) -> Void)) + func propertiesOfFileAtPath(path: String, completionHandler: ((propertiesDictionary: [String: AnyObject], keys: [String], error: ErrorType?) -> Void)) +} #endif public enum FileOperation { diff --git a/Source/LocalFileProvider.swift b/Source/LocalFileProvider.swift index 9520dcb..bf669b3 100644 --- a/Source/LocalFileProvider.swift +++ b/Source/LocalFileProvider.swift @@ -264,7 +264,7 @@ public class LocalFileProvider: FileProvider { } } - public func searchFilesAtPath(path: String, recursive: Bool, query: String, foundItemHandler: ((FileObjectClass) -> Void)?, completionHandler: ((files: [FileObjectClass], error: ErrorType?) -> Void)) { + public func searchFilesAtPath(path: String, recursive: Bool, query: String, foundItemHandler: ((FileObject) -> Void)?, completionHandler: ((files: [FileObject], error: ErrorType?) -> Void)) { dispatch_async(dispatch_queue) { let iterator = self.fileManager.enumeratorAtURL(self.absoluteURL(path), includingPropertiesForKeys: nil, options: recursive ? NSDirectoryEnumerationOptions() : .SkipsSubdirectoryDescendants) { (url, e) -> Bool in completionHandler(files: [], error: e)