39 lines
974 B
Swift
39 lines
974 B
Swift
import Foundation
|
|
import ZIPFoundation
|
|
|
|
let NSKeyedArchiveVersion = 100000
|
|
|
|
let ThumbnailPath = "QuickLook/Thumbnail.png"
|
|
let DocumentArchivePath = "Document.archive"
|
|
|
|
let VideoPath = "video/segments/"
|
|
|
|
let DocumentClassName = "SilicaDocument"
|
|
let TrackedTimeKey = "SilicaDocumentTrackedTimeKey"
|
|
let LayersKey = "layers"
|
|
let TileSizeKey = "tileSize"
|
|
let SizeKey = "size"
|
|
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
|
|
}
|