mirror of
https://github.com/tsolomko/SWCompression.git
synced 2026-06-23 14:56:41 +00:00
28 lines
565 B
Swift
28 lines
565 B
Swift
// Copyright (c) 2026 Timofey Solomko
|
|
// Licensed under MIT License
|
|
//
|
|
// See LICENSE for license information
|
|
|
|
import Foundation
|
|
|
|
struct SaveFile: Codable {
|
|
|
|
struct Run: Codable {
|
|
|
|
var metadataUUID: UUID
|
|
var results: [BenchmarkResult]
|
|
|
|
}
|
|
|
|
var metadatas: [UUID: BenchmarkMetadata]
|
|
|
|
var runs: [Run]
|
|
|
|
static func load(from path: String) throws -> SaveFile {
|
|
let decoder = JSONDecoder()
|
|
let data = try Data(contentsOf: URL(fileURLWithPath: path))
|
|
return try decoder.decode(SaveFile.self, from: data)
|
|
}
|
|
|
|
}
|