no message

This commit is contained in:
Peter
2017-01-17 18:33:36 +03:00
parent 84c0a86d8f
commit 9835ac1b88
17 changed files with 743 additions and 33 deletions

View File

@@ -58,6 +58,11 @@ public struct ValueBoxKey: Hashable, CustomStringConvertible, Comparable {
memcpy(self.memory + offset, &varValue, 1)
}
public func setUInt8(_ offset: Int, value: UInt8) {
var varValue = value
memcpy(self.memory + offset, &varValue, 1)
}
public func getInt32(_ offset: Int) -> Int32 {
var value: Int32 = 0
memcpy(&value, self.memory + offset, 4)
@@ -82,6 +87,12 @@ public struct ValueBoxKey: Hashable, CustomStringConvertible, Comparable {
return value
}
public func getUInt8(_ offset: Int) -> UInt8 {
var value: UInt8 = 0
memcpy(&value, self.memory + offset, 1)
return value
}
public func prefix(_ length: Int) -> ValueBoxKey {
assert(length <= self.length, "length <= self.length")
let key = ValueBoxKey(length: length)