2017-06-21 07:00:19 +02:00
|
|
|
//
|
|
|
|
// ParsedAttachment.swift
|
|
|
|
// RSParser
|
|
|
|
//
|
|
|
|
// Created by Brent Simmons on 6/20/17.
|
|
|
|
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
2017-09-10 20:18:15 +02:00
|
|
|
public struct ParsedAttachment: Hashable {
|
2017-06-21 07:00:19 +02:00
|
|
|
|
2017-09-10 20:21:49 +02:00
|
|
|
public let url: String
|
2017-06-21 07:00:19 +02:00
|
|
|
public let mimeType: String?
|
|
|
|
public let title: String?
|
|
|
|
public let sizeInBytes: Int?
|
|
|
|
public let durationInSeconds: Int?
|
2017-09-10 20:18:15 +02:00
|
|
|
public let hashValue: Int
|
|
|
|
|
2017-09-10 20:21:49 +02:00
|
|
|
init?(url: String, mimeType: String?, title: String?, sizeInBytes: Int?, durationInSeconds: Int?) {
|
2017-06-25 19:23:30 +02:00
|
|
|
|
|
|
|
self.url = url
|
|
|
|
self.mimeType = mimeType
|
|
|
|
self.title = title
|
|
|
|
self.sizeInBytes = sizeInBytes
|
|
|
|
self.durationInSeconds = durationInSeconds
|
2017-09-10 20:21:49 +02:00
|
|
|
self.hashValue = url.hashValue
|
2017-09-10 20:18:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public static func ==(lhs: ParsedAttachment, rhs: ParsedAttachment) -> Bool {
|
|
|
|
|
|
|
|
return lhs.hashValue == rhs.hashValue && lhs.url == rhs.url && lhs.mimeType == rhs.mimeType && lhs.title == rhs.title && lhs.sizeInBytes == rhs.sizeInBytes && lhs.durationInSeconds == rhs.durationInSeconds
|
2017-06-25 19:23:30 +02:00
|
|
|
}
|
2017-06-21 07:00:19 +02:00
|
|
|
}
|