Poll UI improvements

This commit is contained in:
Ali
2020-01-13 00:37:27 +04:00
parent 2a6f1f811b
commit 6d5bfe1f1e
12 changed files with 142 additions and 28 deletions

View File

@@ -38,6 +38,13 @@ public struct ValueBoxKey: Equatable, Hashable, CustomStringConvertible, Compara
memcpy(self.memory, buffer.memory, buffer.length)
}
public func setData(_ offset: Int, value: Data) {
let valueLength = value.count
value.withUnsafeBytes { (bytes: UnsafePointer<UInt8>) -> Void in
memcpy(self.memory + offset, bytes, valueLength)
}
}
public func setInt32(_ offset: Int, value: Int32) {
var bigEndianValue = Int32(bigEndian: value)
memcpy(self.memory + offset, &bigEndianValue, 4)