From 315e2510d577b7303f4b8204a4555aad26bc41a3 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Tue, 12 Dec 2023 13:07:40 -0700 Subject: move files --- Sources/fileTypes.swift | 133 ------------------------------------------------ 1 file changed, 133 deletions(-) delete mode 100644 Sources/fileTypes.swift (limited to 'Sources/fileTypes.swift') diff --git a/Sources/fileTypes.swift b/Sources/fileTypes.swift deleted file mode 100644 index 221b7b2..0000000 --- a/Sources/fileTypes.swift +++ /dev/null @@ -1,133 +0,0 @@ -// -// fileTypes.swift -// -// -// Created by Navan Chauhan on 12/3/23. -// - -import Foundation - -enum ResponseType { - case string(String) - case data(Data) -} - -enum gopherFileType { - case text - case directory - case nameserver - case error - case binhex - case bindos - case uuencoded - case indexSearch - case telnet - case binary - case redundantServer - case tn3270Session - case gif - case image - case bitmap - case movie - case sound - case doc - case html - case message - case png - case rtf - case wavfile - case pdf - case xml -} - -func getFileType(fileExtension: String) -> gopherFileType { - switch fileExtension { - case "txt": - return .text - case "md": - return .text - case "html": - return .html - case "pdf": - return .pdf - case "png": - return .png - case "gif": - return .gif - case "jpg": - return .image - case "jpeg": - return .image - case "mp3": - return .sound - case "wav": - return .wavfile - case "mp4": - return .movie - case "mov": - return .movie - case "avi": - return .movie - case "rtf": - return .rtf - case "xml": - return .xml - default: - return .binary - } -} - -func fileTypeToGopherItem(fileType: gopherFileType) -> String { - switch fileType { - case .text: - return "0" - case .directory: - return "1" - case .nameserver: - return "2" - case .error: - return "3" - case .binhex: - return "4" - case .bindos: - return "5" - case .uuencoded: - return "6" - case .indexSearch: - return "7" - case .telnet: - return "8" - case .binary: - return "9" - case .redundantServer: - return "+" - case .tn3270Session: - return "T" - case .gif: - return "g" - case .image: - return "I" - case .bitmap: - return "b" - case .movie: - return "M" - case .sound: - return "s" - case .doc: - return "d" - case .html: - return "h" - case .message: - return "i" - case .png: - return "p" - case .rtf: - return "t" - case .wavfile: - return "w" - case .pdf: - return "P" - case .xml: - return "x" - } -} -- cgit v1.2.3