aboutsummaryrefslogtreecommitdiff
path: root/Sources/fileTypes.swift
diff options
context:
space:
mode:
authorNavan Chauhan <navanchauhan@gmail.com>2023-12-12 13:07:40 -0700
committerNavan Chauhan <navanchauhan@gmail.com>2023-12-12 13:07:40 -0700
commit315e2510d577b7303f4b8204a4555aad26bc41a3 (patch)
treeec16e87bda839f71424d489d1e8dda96c69d504c /Sources/fileTypes.swift
parentdf466eba1bd4c9728fdb66e1a5fcf0e89203cf39 (diff)
move files
Diffstat (limited to 'Sources/fileTypes.swift')
-rw-r--r--Sources/fileTypes.swift133
1 files changed, 0 insertions, 133 deletions
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"
- }
-}