|
@@ -36,6 +36,11 @@ public class File {
|
|
|
|
|
|
|
|
public let database: Database & Writable
|
|
public let database: Database & Writable
|
|
|
|
|
|
|
|
|
|
+ public required init(from input: Input) throws {
|
|
|
|
|
+ version = Version(major: 0, minor: 0)
|
|
|
|
|
+ database = try Database0(from: input)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public required init(from input: Input, compositeKey: CompositeKey) throws {
|
|
public required init(from input: Input, compositeKey: CompositeKey) throws {
|
|
|
version = try input.read()
|
|
version = try input.read()
|
|
|
|
|
|
|
@@ -46,6 +51,12 @@ public class File {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public convenience init(xml file: URL) throws {
|
|
|
|
|
+ let bytes = try Bytes(contentsOf: file)
|
|
|
|
|
+ let stream = Input(bytes: bytes)
|
|
|
|
|
+ try self.init(from: stream)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public convenience init(from file: URL, compositeKey: CompositeKey) throws {
|
|
public convenience init(from file: URL, compositeKey: CompositeKey) throws {
|
|
|
|
|
|
|
|
let bytes = try Bytes(contentsOf: file)
|
|
let bytes = try Bytes(contentsOf: file)
|