You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
690 B
37 lines
690 B
//
|
|
// ExportFormat.swift
|
|
// PadelClub
|
|
//
|
|
// Created by Razmig Sarkissian on 19/07/2024.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
enum ExportFormat: Int, Identifiable, CaseIterable {
|
|
var id: Int { self.rawValue }
|
|
|
|
case rawText
|
|
case csv
|
|
|
|
var suffix: String {
|
|
switch self {
|
|
case .rawText:
|
|
return "txt"
|
|
case .csv:
|
|
return "csv"
|
|
}
|
|
}
|
|
|
|
func separator() -> String {
|
|
switch self {
|
|
case .rawText:
|
|
return " "
|
|
case .csv:
|
|
return ";"
|
|
}
|
|
}
|
|
|
|
func newLineSeparator(_ count: Int = 1) -> String {
|
|
return Array(repeating: "\n", count: count).joined()
|
|
}
|
|
}
|
|
|