Skip to content
Snippets Groups Projects
Commit a1a2826f authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Add NewCmix functor

parent fced4806
No related branches found
No related tags found
2 merge requests!102Release 1.0.0,!18Update Bindings
import Bindings
import XCTestDynamicOverlay
public struct NewCmix {
public init(run: @escaping (String, String, Data, String?) throws -> Bool) {
self.run = run
}
public var run: (String, String, Data, String?) throws -> Bool
public func callAsFunction(
ndfJSON: String,
storageDir: String,
password: Data,
registrationCode: String?
) throws -> Bool {
try run(ndfJSON, storageDir, password, registrationCode)
}
}
extension NewCmix {
public static let live = NewCmix { ndfJSON, storageDir, password, registrationCode in
var error: NSError?
let result = BindingsNewCmix(ndfJSON, storageDir, password, registrationCode, &error)
if let error = error {
throw error
}
return result
}
}
extension NewCmix {
public static let unimplemented = NewCmix(
run: XCTUnimplemented("\(Self.self)")
)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment