|
@@ -8,5 +8,20 @@
|
|
|
import Cocoa
|
|
|
|
|
|
class KMFileManager: NSObject {
|
|
|
-
|
|
|
+ static let manager = KMFileManager()
|
|
|
+
|
|
|
+ var files: [KMFile] = []
|
|
|
+
|
|
|
+ func fetchFile(filePath: String) -> KMFile {
|
|
|
+ for file in files {
|
|
|
+ if file.filePath == filePath {
|
|
|
+ return file
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ let file = KMFile()
|
|
|
+ file.filePath = filePath
|
|
|
+ self.files.append(file)
|
|
|
+ return file
|
|
|
+ }
|
|
|
}
|