1
Fork 0
This repository has been archived on 2025-04-12. You can view files and clone it, but cannot push or open issues or pull requests.
silica-viewer/Shared/Shared.swift

40 lines
974 B
Swift
Raw Normal View History

import Foundation
import ZIPFoundation
let NSKeyedArchiveVersion = 100000
let ThumbnailPath = "QuickLook/Thumbnail.png"
let DocumentArchivePath = "Document.archive"
2021-05-09 21:44:04 -04:00
let VideoPath = "video/segments/"
let DocumentClassName = "SilicaDocument"
let TrackedTimeKey = "SilicaDocumentTrackedTimeKey"
let LayersKey = "layers"
let TileSizeKey = "tileSize"
let SizeKey = "size"
2020-05-30 17:03:56 -04:00
let OrientationKey = "orientation"
let FlippedHorizontallyKey = "flippedHorizontally"
let FlippedVerticallyKey = "flippedVertically"
let NameKey = "name"
let AuthorNameKey = "authorName"
let StrokeCountKey = "strokeCount"
let LayerClassName = "SilicaLayer"
func readData(archive: Archive, entry: Entry) -> Data? {
var data = Data()
do {
let _ = try archive.extract(entry, consumer: { (d) in
data.append(d)
})
} catch {
Swift.print("Extracting entry from archive failed with error:\(error)")
return nil
}
return data
}