added iOS source code
[wl-app.git] / iOS / Pods / FolioReaderKit / Source / EPUBCore / FRResource.swift
diff --git a/iOS/Pods/FolioReaderKit/Source/EPUBCore/FRResource.swift b/iOS/Pods/FolioReaderKit/Source/EPUBCore/FRResource.swift
new file mode 100755 (executable)
index 0000000..d7a2a76
--- /dev/null
@@ -0,0 +1,32 @@
+//
+//  FRResource.swift
+//  FolioReaderKit
+//
+//  Created by Heberti Almeida on 29/04/15.
+//  Copyright (c) 2015 Folio Reader. All rights reserved.
+//
+
+import UIKit
+
+open class FRResource: NSObject {
+    var id: String!
+    var properties: String?
+    var mediaType: MediaType!
+    var mediaOverlay: String?
+    
+    public var href: String!
+    public var fullHref: String!
+
+    func basePath() -> String! {
+        if href == nil || href.isEmpty { return nil }
+        var paths = fullHref.components(separatedBy: "/")
+        paths.removeLast()
+        return paths.joined(separator: "/")
+    }
+}
+
+// MARK: Equatable
+
+func ==(lhs: FRResource, rhs: FRResource) -> Bool {
+    return lhs.id == rhs.id && lhs.href == rhs.href
+}