Skip to content
4 changes: 0 additions & 4 deletions Sources/Adapters/GCDWebServer/GCDHTTPServer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,6 @@ public class GCDHTTPServer: HTTPServer, Loggable {
private func isPortFree(_ port: UInt) -> Bool {
let port = in_port_t(port)

func getErrnoMessage() -> String {
String(cString: UnsafePointer(strerror(errno)))
}

let socketDescriptor = socket(AF_INET, SOCK_STREAM, 0)
if socketDescriptor == -1 {
// Just in case, returns true to attempt restarting the server.
Expand Down
9 changes: 0 additions & 9 deletions Sources/Adapters/GCDWebServer/ResourceResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@ import Foundation
import ReadiumGCDWebServer
import ReadiumShared

/// Errors thrown by the `WebServerResourceResponse`
///
/// - streamOpenFailed: The stream is not open, stream.open() failed.
/// - invalidRange: The range queried is invalid.
enum WebServerResponseError: Error {
case streamOpenFailed
case invalidRange
}

/// The object containing the response's ressource data.
/// If the ressource to be served is too big, multiple responses will be created.
class ResourceResponse: ReadiumGCDWebServerResponse, Loggable {
Expand Down
16 changes: 0 additions & 16 deletions Sources/Internal/Extensions/Array.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,4 @@ public extension Array where Element: Hashable {
}
return result
}

@inlinable func removing(_ element: Element) -> Self {
var array = self
array.removeAll { other in other == element }
return array
}

@inlinable mutating func remove(_ element: Element) {
removeAll { other in other == element }
}
}

public extension Array where Element: Equatable {
func firstMemberFrom(_ candidates: Element?...) -> Element? {
candidates.compactMap { $0 }.first { contains($0) }
}
}
4 changes: 0 additions & 4 deletions Sources/Internal/Extensions/Date+ISO8601.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ public extension DateFormatter {
// Otherwise it will accept bad format, for exmaple 2018-04-24XXXXXXXXX
// Because it will only test the part you asssigned, date, time, timezone.
// But we should also cover the optional cases. So there is not too much benefit.
// let formatter = ISO8601DateFormatter()
// formatter.formatOptions = [.withFullDate]
// return formatter

// https://developer.apple.com/documentation/foundation/dateformatter
// Doesn't support millisecond or uncompleted part for date, time, timezone offset.
let formats = [
Expand Down
21 changes: 0 additions & 21 deletions Sources/Internal/Measure.swift

This file was deleted.

1 change: 0 additions & 1 deletion Sources/LCP/License/License.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import Foundation
import ReadiumShared
import ReadiumZIPFoundation

final class License: Loggable {
/// Last Documents which passed the integrity checks.
Expand Down
4 changes: 0 additions & 4 deletions Sources/Navigator/EPUB/EPUBNavigatorViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1229,10 +1229,6 @@ extension EPUBNavigatorViewController: EPUBSpreadViewDelegate {
}
}

func spreadView(_ spreadView: EPUBSpreadView, present viewController: UIViewController) {
present(viewController, animated: true)
}

func spreadViewDidTerminate() {
reloadSpreads()
}
Expand Down
3 changes: 0 additions & 3 deletions Sources/Navigator/EPUB/EPUBSpreadView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ protocol EPUBSpreadViewDelegate: AnyObject {
/// Called when the pages visible in the spread changed.
func spreadViewPagesDidChange(_ spreadView: EPUBSpreadView)

/// Called when the spread view needs to present a view controller.
func spreadView(_ spreadView: EPUBSpreadView, present viewController: UIViewController)

/// Called when the user triggered an input pointer event.
func spreadView(_ spreadView: EPUBSpreadView, didReceive event: PointerEvent)

Expand Down
2 changes: 0 additions & 2 deletions Sources/Navigator/TTS/AVTTSEngine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ public class AVTTSEngine: NSObject, TTSEngine, AVSpeechSynthesizerDelegate, Logg

private func taskUtterance(with task: Task) -> TaskUtterance {
let utter = TaskUtterance(task: task)
// utter.rate = rateMultiplierToAVRate(task.utterance.rateMultiplier)
// utter.pitchMultiplier = Float(task.utterance.pitchMultiplier)
utter.preUtteranceDelay = task.utterance.delay
utter.voice = voice(for: task.utterance)
delegate?.avTTSEngine(self, didCreateUtterance: utter)
Expand Down
13 changes: 0 additions & 13 deletions Sources/Navigator/Toolkit/PaginationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,6 @@ final class PaginationView: UIView, Loggable {
loadedViews[currentIndex]
}

/// Loaded page views in reading order.
private var orderedViews: [UIView & PageView] {
var orderedViews = loadedViews
.sorted { $0.key < $1.key }
.map(\.value)

if readingProgression == .rtl {
orderedViews.reverse()
}

return orderedViews
}

private let scrollView = UIScrollView()

/// Set while a transition animation is in progress to prevent
Expand Down
4 changes: 0 additions & 4 deletions Sources/OPDS/OPDS2Parser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,3 @@ public class OPDS2Parser: Loggable {
}
}
}

private func hrefNormalizer(_ baseURL: URL?) -> (String) -> (String) {
{ href in URLHelper.getAbsolute(href: href, base: baseURL) ?? href }
}
4 changes: 0 additions & 4 deletions Sources/OPDS/OPDSParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,13 @@ public enum OPDSParserError: Error {
}

public enum OPDSParser {
static var feedURL: URL?

/// Parse an OPDS feed or publication.
/// Feed can be v1 (XML) or v2 (JSON).
/// - Parameters:
/// - url: The feed URL.
/// - completion: A closure called when the parsing is complete, returning the
/// parsed `ParseData` on success, or an `Error` if the operation failed.
public static func parseURL(url: URL, completion: @escaping (ParseData?, Error?) -> Void) {
feedURL = url

URLSession.shared.dataTask(with: url) { data, response, error in
guard let data = data, let response = response else {
completion(nil, error ?? OPDSParserError.documentNotFound)
Expand Down
7 changes: 0 additions & 7 deletions Sources/Shared/Toolkit/Extensions/Optional.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,4 @@ public extension Optional {
}
return value
}

/// Returns the wrapped value and modify the variable to be nil.
internal mutating func pop() -> Wrapped? {
let res = self
self = nil
return res
}
}
16 changes: 0 additions & 16 deletions Sources/Streamer/Parser/PDF/PDFParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,7 @@ import CoreGraphics
import Foundation
import ReadiumShared

/// Errors thrown during the parsing of the PDF.
public enum PDFParserError: Error {
/// The file at 'path' is missing from the container.
case missingFile(path: String)
/// Failed to open the PDF
case openFailed
/// The PDF is encrypted with a password. This is not supported right now.
case fileEncryptedWithPassword
/// The LCP for PDF Package is malformed.
case invalidLCPDF
}

public final class PDFParser: PublicationParser, Loggable {
enum Error: Swift.Error {
case fileNotReadable
}

private let pdfFactory: PDFDocumentFactory

public init(pdfFactory: PDFDocumentFactory) {
Expand Down
44 changes: 0 additions & 44 deletions Sources/Streamer/Toolkit/StringExtension.swift

This file was deleted.

Loading