added iOS source code
[wl-app.git] / iOS / Pods / FolioReaderKit / Source / EPUBCore / FRResource.swift
1 //
2 //  FRResource.swift
3 //  FolioReaderKit
4 //
5 //  Created by Heberti Almeida on 29/04/15.
6 //  Copyright (c) 2015 Folio Reader. All rights reserved.
7 //
8
9 import UIKit
10
11 open class FRResource: NSObject {
12     var id: String!
13     var properties: String?
14     var mediaType: MediaType!
15     var mediaOverlay: String?
16     
17     public var href: String!
18     public var fullHref: String!
19
20     func basePath() -> String! {
21         if href == nil || href.isEmpty { return nil }
22         var paths = fullHref.components(separatedBy: "/")
23         paths.removeLast()
24         return paths.joined(separator: "/")
25     }
26 }
27
28 // MARK: Equatable
29
30 func ==(lhs: FRResource, rhs: FRResource) -> Bool {
31     return lhs.id == rhs.id && lhs.href == rhs.href
32 }